Cara menggunakan rest api php github

GetPaymentChannels is in

composer update xendit/xendit-php
75. Existing behavior on the endpoint will continue to work as before, but newer channels will be missing from the returned result.

\Xendit\PaymentChannels::list();

Usage example:

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);

Cards

Create Charge

\Xendit\Cards::create(array $params);

Usage example:

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);

Reverse Authorization

composer update xendit/xendit-php
0

Usage example:

composer update xendit/xendit-php
1

Capture Charge

composer update xendit/xendit-php
2

Usage example:

composer update xendit/xendit-php
3

Get Charge

composer update xendit/xendit-php
4

Usage example:

composer update xendit/xendit-php
5

Create Refund

composer update xendit/xendit-php
6

Usage examples

Without idempotency key:

composer update xendit/xendit-php
7

With idempotency key:

composer update xendit/xendit-php
8

Create Promotion

composer update xendit/xendit-php
9

usage examples:

Xendit::setApiKey('secretKey');
0

Cardless Credit

Create Cardless Credit Payment

Xendit::setApiKey('secretKey');
1

Usage example:

Xendit::setApiKey('secretKey');
2

Calculate Payment Types

Xendit::setApiKey('secretKey');
3

Usage example:

Xendit::setApiKey('secretKey');
4

Customers

Create Customer

Xendit::setApiKey('secretKey');
5

Usage example:

Xendit::setApiKey('secretKey');
6

Get Customer by Reference ID

Xendit::setApiKey('secretKey');
7

Usage example:

Xendit::setApiKey('secretKey');
8

Direct Debit

Initialize linked account tokenization

Xendit::setApiKey('secretKey');
9

Usage example:

Xendit::setHttpClient($client);
0

Validate OTP for Linked Account Token

Xendit::setHttpClient($client);
1

Usage example:

Xendit::setHttpClient($client);
2

Retrieve accessible accounts by linked account token

Xendit::setHttpClient($client);
3

Usage example:

Xendit::setHttpClient($client);
4

Unbind linked account token

Xendit::setHttpClient($client);
5

Usage example:

Xendit::setHttpClient($client);
6

Create payment method

Xendit::setHttpClient($client);
7

Usage example:

Xendit::setHttpClient($client);
8

Get payment methods by customer ID

Xendit::setHttpClient($client);
9

Usage example:

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
0

Create direct debit payment

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
1

Usage example:

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
2

Validate OTP for direct debit payment

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
3

Usage example:

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
4

Get direct debit payment by ID

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
5

Usage example:

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
6

Get direct debit payment by reference ID

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
7

Usage example:

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
8

IDR Disbursements for Indonesia

Create an IDR Disbursement

$params = array(
    'for-user-id' => '<sub account user id>' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
9

Usage examples

Without idempotency key:

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
0

With idempotency key:

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
1

Create an IDR Batch Disbursement

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
2

Usage example:

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
3

Get an IDR Disbursement by ID

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
4

Usage example:

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
5

Get an IDR Disbursement by External ID

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
6

Usage example:

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
7

Get an IDR Disbursement Available Banks

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
8

Usage example:

$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
9

PHP Disbursements for Philippines

Create a PHP Disbursement

\Xendit\PaymentChannels::list();
0

Usage examples

Without optional fields:

\Xendit\PaymentChannels::list();
1

With beneficiary optional field:

\Xendit\PaymentChannels::list();
2

With receipt_notification optional field:

\Xendit\PaymentChannels::list();
3

Get a PHP Disbursement by ID

\Xendit\PaymentChannels::list();
4

Usage example:

\Xendit\PaymentChannels::list();
5

Get a PHP Disbursement by Reference ID

\Xendit\PaymentChannels::list();
6

Usage example:

\Xendit\PaymentChannels::list();
7

Disbursement Channels

Get Disbursement Channels

\Xendit\PaymentChannels::list();
8

Usage examples

\Xendit\PaymentChannels::list();
9

Get Disbursement Channels By Channel Category

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
0

Usage examples

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
1

Get Disbursement Channels By Channel Code

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
2

Usage examples

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
3

E-Wallets

Create E-Wallet Charge

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
4

For more information about the params, please check .

Usage example:

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
5

Get E-Wallet Charge Status

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
6

Usage example:

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
7

Void E-Wallet Charge

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
8

Usage example:

$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
9

Refund E-Wallet Charge

\Xendit\Cards::create(array $params);
0

Usage example:

\Xendit\Cards::create(array $params);
1

Get Refund By ID

\Xendit\Cards::create(array $params);
2

Usage example:

\Xendit\Cards::create(array $params);
3

List Refunds

\Xendit\Cards::create(array $params);
4

Usage example:

\Xendit\Cards::create(array $params);
5

Invoice

Create Invoice

\Xendit\Cards::create(array $params);
6

Usage example:

\Xendit\Cards::create(array $params);
7

Get Invoice

\Xendit\Cards::create(array $params);
8

Usage example:

\Xendit\Cards::create(array $params);
9

Get All Invoice

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
0

Usage example:

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
1

Expire Invoice

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
2

Usage example:

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
3

Paylater

Initiate PayLater Plans

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
4

Usage example:

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
5

Create Paylater Charges

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
6

Usage example:

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
7

Get PayLater Charge by ID

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
8

Usage example:

$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
9

Refund Paylater Charge

composer update xendit/xendit-php
00

Usage example:

composer update xendit/xendit-php
01

Create Paylater Refund

composer update xendit/xendit-php
00

Usage example:

composer update xendit/xendit-php
03

Get PayLater Refund by ID

composer update xendit/xendit-php
04

Usage example:

composer update xendit/xendit-php
05

List PayLater Refunds

composer update xendit/xendit-php
06

Usage example:

composer update xendit/xendit-php
07

Void Payout

composer update xendit/xendit-php
08

Usage example:

composer update xendit/xendit-php
09

Payouts

Create Payout

composer update xendit/xendit-php
10

Usage example:

composer update xendit/xendit-php
11

Get Payout

composer update xendit/xendit-php
12

Usage example:

composer update xendit/xendit-php
13

Void Payout

composer update xendit/xendit-php
08

Usage example:

composer update xendit/xendit-php
09

QR Code

Create a QR Code

composer update xendit/xendit-php
16

Usage example:

composer update xendit/xendit-php
17

Get QR Code

composer update xendit/xendit-php
18

Usage example:

composer update xendit/xendit-php
19

Recurring Payments

Create a Recurring Payment

composer update xendit/xendit-php
20

Usage example:

composer update xendit/xendit-php
21

Get a Recurring Payment

composer update xendit/xendit-php
22

Usage example:

composer update xendit/xendit-php
23

Edit Recurring Payment

composer update xendit/xendit-php
24

Usage example:

composer update xendit/xendit-php
25

Stop Recurring Payment

composer update xendit/xendit-php
26

Usage example:

composer update xendit/xendit-php
27

Pause Recurring Payment

composer update xendit/xendit-php
28

Usage example:

composer update xendit/xendit-php
29

Resume Recurring Payment

composer update xendit/xendit-php
30

Usage example:

composer update xendit/xendit-php
31

Retail Outlets

Create Fixed Payment Code

composer update xendit/xendit-php
32

Usage example:

composer update xendit/xendit-php
33

Update Fixed Payment Code

composer update xendit/xendit-php
34

Usage example:

composer update xendit/xendit-php
35

Get Fixed Payment Code

composer update xendit/xendit-php
36

Usage example:

composer update xendit/xendit-php
37

Virtual Accounts

Create Fixed Virtual Account

composer update xendit/xendit-php
38

Usage example:

composer update xendit/xendit-php
39

Get Virtual Account Bank

composer update xendit/xendit-php
40

Usage example:

composer update xendit/xendit-php
41

Get Fixed Virtual Account

composer update xendit/xendit-php
42

Usage example:

composer update xendit/xendit-php
43

Update Fixed Virtual Account

composer update xendit/xendit-php
44

Usage example:

composer update xendit/xendit-php
45

Get Fixed Virtual Account Payment

composer update xendit/xendit-php
46

Usage example:

composer update xendit/xendit-php
47

xenPlatform

Create Account

composer update xendit/xendit-php
48

Usage example:

composer update xendit/xendit-php
49

Get Account

composer update xendit/xendit-php
50

Usage example:

composer update xendit/xendit-php
51

Update Account

composer update xendit/xendit-php
52

Usage example:

composer update xendit/xendit-php
53

Create Transfers

composer update xendit/xendit-php
54

Usage example:

composer update xendit/xendit-php
55

Create Fee Rule

composer update xendit/xendit-php
56

Usage example:

composer update xendit/xendit-php
57

Set Callback URLs

composer update xendit/xendit-php
58

Usage example:

composer update xendit/xendit-php
59

Transaction

List of Transactions

composer update xendit/xendit-php
60

Usage example:

composer update xendit/xendit-php
61

Detail of Transaction

composer update xendit/xendit-php
62

Usage example:

composer update xendit/xendit-php
63

Report

Generate Report

composer update xendit/xendit-php
64

Usage example:

composer update xendit/xendit-php
65

Detail of Report

composer update xendit/xendit-php
66

Usage example:

composer update xendit/xendit-php
67

Exceptions

InvalidArgumentException

composer update xendit/xendit-php
76 will be thrown if the argument provided by user is not sufficient to create the request.

For example, there are required arguments such as

composer update xendit/xendit-php
77,
composer update xendit/xendit-php
78,
composer update xendit/xendit-php
79, and
composer update xendit/xendit-php
80 to create an invoice. If user lacks one or more arguments when attempting to create one,
composer update xendit/xendit-php
76 will be thrown.

composer update xendit/xendit-php
76 is derived from PHP's
composer update xendit/xendit-php
76. For more information about this Exception methods and properties, please check PHP Documentation.

ApiException

composer update xendit/xendit-php
84 wraps up Xendit API error. This exception will be thrown if there are errors from Xendit API side, e.g. get fixed virtual account with invalid
composer update xendit/xendit-php
85.

To get exception message:

composer update xendit/xendit-php
68

To get exception HTTP error code:

composer update xendit/xendit-php
69

To get exception Xendit API error code:

composer update xendit/xendit-php
70

Contributing

For any requests, bugs, or comments, please open an issue or submit a pull request.

Installing Packages

Before you start to code, run this command to install all of the required packages. Make sure you have

composer update xendit/xendit-php
86 installed in your computer

composer update xendit/xendit-php
71

Tests

Running test suite:

composer update xendit/xendit-php
72

Running examples:

composer update xendit/xendit-php
73

There is a pre-commit hook to run phpcs and phpcbf. Please make sure they passed before making commits/pushes.