Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

Overview

Xendit API PHP Client

This library is the abstraction of Xendit API for access from applications written with PHP.


Documentation

For the API documentation, check Xendit API Reference.

Installation

Install xendit-php-clients with composer by following command:

composer require xendit/xendit-php

or add it manually in your composer.json file.

Update from v1.4.0 to v2.0.0

To update xendit-php-clients with composer, use the following command:

composer update xendit/xendit-php

To migrate, see MIGRATE.md for more information.

Usage

Configure package with your account's secret key obtained from Xendit Dashboard.

Xendit::setApiKey('secretKey');

See example codes for more details.

Use Custom HTTP Client

A custom HTTP Client that implements HttpClientInterface can be injected like so

Xendit::setHttpClient($client);

Checkout custom http client example for implementation reference.

Methods' Signature and Examples

Balance

Get Balance

\Xendit\Balance::getBalance(string $account_type);

Usage example:

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

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

\Xendit\Cards::reverseAuthorization(string $id, array $params);

Usage example:

$id = 'charge-id';
$params = ['external_id' => 'ext-id'];

$reverseAuth = \Xendit\Cards::reverseAuthorization(
    $id,
    $params
);
var_dump($reverseAuth);

Capture Charge

\Xendit\Cards::capture(string $id, array $params);

Usage example:

$id = 'charge-id';
$params = ['amount' => 100000];

$captureCharge = \Xendit\Cards::capture($id, $params);
var_dump($captureCharge);

Get Charge

\Xendit\Cards::retrieve(string $id);

Usage example:

$id = 'charge-id';

$getCharge = \Xendit\Cards::retrieve($id);
var_dump($getCharge);

Create Refund

\Xendit\Cards::createRefund(string $id, array $params);

Usage examples

Without idempotency key:

$params = [
    'external_id' => 'ext-id',
    'amount' => 20000
];

$refund = \Xendit\Cards::createRefund($id, $params);
var_dump($refund);

With idempotency key:

$params = [
    'external_id' => 'ext-id',
    'amount' => 20000,
    'X-IDEMPOTENCY-KEY' => 'unique-id'
];

$refund = \Xendit\Cards::createRefund($id, $params);
var_dump($refund);

Create Promotion

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

usage examples:

$params = [
    'reference_id' => 'reference_123',
    'description' => 'test promotion',
    'currency' => 'IDR',
    'start_time' => '2021-01-01T00:00:00.000Z',
    'end_time' => '2021-01-02T00:00:00.000Z',
    'promo_code' => 'testpromo',
    'discount_amount' => 5000
];

$createPromotion = \Xendit\Promotion::create($params);
var_dump($createPromotion);

Cardless Credit

Create Cardless Credit Payment

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

Usage example:

$params = [
    'cardless_credit_type' => 'KREDIVO',
    'external_id' => 'test-cardless-credit-02',
    'amount' => 800000,
    'payment_type' => '3_months',
    'items' => [
        [
            'id' => '123123',
            'name' => 'Phone Case',
            'price' => 200000,
            'type' => 'Smartphone',
            'url' => 'http=>//example.com/phone/phone_case',
            'quantity' => 2
        ],
        [
            'id' => '234567',
            'name' => 'Bluetooth Headset',
            'price' => 400000,
            'type' => 'Audio',
            'url' => 'http=>//example.com/phone/bluetooth_headset',
            'quantity' => 1
        ]
    ],
    'customer_details' => [
        'first_name' => 'customer first name',
        'last_name' => 'customer last name',
        'email' => '[email protected]',
        'phone' => '081513114262'
    ],
    'shipping_address' => [
        'first_name' => 'first name',
        'last_name' => 'last name',
        'address' => 'Jalan Teknologi No. 12',
        'city' => 'Jakarta',
        'postal_code' => '12345',
        'phone' => '081513114262',
        'country_code' => 'IDN'
    ],
    'redirect_url' => 'https://example.com',
    'callback_url' => 'http://example.com/callback-cardless-credit'
];

$createPayment = \Xendit\CardlessCredit::create($params);
var_dump($createPayment);

Calculate Payment Types

\Xendit\CardlessCredit::calculatePaymentTypes(array $params);

Usage example:

$params = [
    'cardless_credit_type' => 'KREDIVO',
    'amount' => 2000000,
    'items' => [
        [
            'id' => '123123',
            'name' => 'Phone Case',
            'price' => 1000000,
            'type' => 'Smartphone',
            'url' => 'http://example.com/phone/phone_case',
            'quantity' => 2
        ]
    ]
];

$calculatePaymentTypes = \Xendit\CardlessCredit::calculatePaymentTypes($params);
var_dump($calculatePaymentTypes);

Disbursements

Create Disbursement

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

Usage examples

Without idempotency key:

$params = [
    'external_id' => 'disb-12345678',
    'amount' => 15000,
    'bank_code' => 'BCA',
    'account_holder_name' => 'Joe',
    'account_number' => '1234567890',
    'description' => 'Disbursement from Example'
];

$createDisbursements = \Xendit\Disbursements::create($params);
var_dump($createDisbursements);

With idempotency key:

$params = [
    'external_id' => 'disb-12345678',
    'amount' => 15000,
    'bank_code' => 'BCA',
    'account_holder_name' => 'Joe',
    'account_number' => '1234567890',
    'description' => 'Disbursement from Example',
    'X-IDEMPOTENCY-KEY' => 'unique-id'
];

$createDisbursements = \Xendit\Disbursements::create($params);
var_dump($createDisbursements);

Create Batch Disbursement

\Xendit\Disbursements::createBatch(array $params);

Usage example:

$batch_params = [
    'reference' => 'disb_batch-12345678',
    'disbursements' => [
        [
            'amount' => 20000,
            'bank_code' => 'BCA',
            'bank_account_name' => 'Fadlan',
            'bank_account_number' => '1234567890',
            'description' => 'Batch Disbursement',
            'external_id' => 'disbursement-1'
        ],
        [
            'amount' => 30000,
            'bank_code' => 'MANDIRI',
            'bank_account_name' => 'Lutfi',
            'bank_account_number' => '1234567891',
            'description' => 'Batch Disbursement with email notifications',
            'external_id' => 'disbursement-2',
            'email_to' => ['[email protected]'],
            'email_cc' => ['[email protected]'],
            'email_bcc' => ['[email protected]', '[email protected]']
        ]
    ]
];

$createBatchDisbursements = \Xendit\Disbursements::createBatch($batch_params);
var_dump($createBatchDisbursements);

Get Disbursement by ID

\Xendit\Disbursements::retrieve(string $id);

Usage example:

$id = 'disbursements-id';
$getDisbursements = \Xendit\Disbursements::retrieve($id);
var_dump($getDisbursements);

Get Disbursement by External ID

\Xendit\Disbursements::retrieveExternal(string $external_id);

Usage example:

$external_id = 'disbursements-ext-id';
$getDisbursementsByExt = \Xendit\Disbursements::retrieveExternal($external_id);
var_dump($getDisbursementsByExt);

Get Disbursement Available Banks

\Xendit\Disbursements::getAvailableBanks();

Usage example:

$getDisbursementsBanks = \Xendit\Disbursements::getAvailableBanks();
var_dump($getDisbursementsBanks);

E-Wallets

Create E-Wallet Charge

\Xendit\EWallets::createEWalletCharge(array $params);

For more information about the params, please check Xendit API Reference - E-Wallets.

Usage example:

$ewalletChargeParams = [
    'reference_id' => 'test-reference-id',
    'currency' => 'IDR',
    'amount' => 50000,
    'checkout_method' => 'ONE_TIME_PAYMENT',
    'channel_code' => 'ID_SHOPEEPAY',
    'channel_properties' => [
        'success_redirect_url' => 'https://yourwebsite.com/order/123',
    ],
    'metadata' => [
        'meta' => 'data'
    ]
];

$createEWalletCharge = \Xendit\EWallets::createEWalletCharge($ewalletChargeParams);
var_dump($createEWalletCharge);

Get E-Wallet Charge Status

\Xendit\EWallets::getEWalletChargeStatus(string $charge_id);

Usage example:

$charge_id = 'ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c';
$getEWalletChargeStatus = \Xendit\EWallets::getEWalletChargeStatus($charge_id);
var_dump($getEWalletChargeStatus);

Invoice

Create Invoice

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

Usage example:

$params = ['external_id' => 'demo_147580196270',
    'payer_email' => '[email protected]',
    'description' => 'Trip to Bali',
    'amount' => 32000
];

$createInvoice = \Xendit\Invoice::create($params);
var_dump($createInvoice);

Get Invoice

\Xendit\Invoice::retrieve(string $id);

Usage example:

$id = 'invoice-id';
$getInvoice = \Xendit\Invoice::retrieve($id);
var_dump($getInvoice);

Get All Invoice

\Xendit\Invoice::retrieveAll();

Usage example:

$getAllInvoice = \Xendit\Invoice::retrieveAll();
var_dump(($getAllInvoice));

Expire Invoice

\Xendit\Invoice::expireInvoice(string $id);

Usage example:

$id = 'invoice-id';
$expireInvoice = \Xendit\Invoice::expireInvoice($id);
var_dump($expireInvoice);

Payouts

Create Payout

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

Usage example:

$params = [
    'external_id' => 'payouts-123456789',
    'amount' => 50000
];

$createPayout = \Xendit\Payouts::create($params);
var_dump($createPayout);

Get Payout

\Xendit\Payouts::retrieve(string $id);

Usage example:

$id = 'payout-id';

$getPayout = \Xendit\Payouts::retrieve($id);
var_dump($getPayout);

Void Payout

\Xendit\Payouts::void(string $id);

Usage example:

$id = 'payout-id';

$voidPayout = \Xendit\Payouts::void($id);
var_dump($voidPayout);

QR Code

Create a QR Code

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

Usage example:

$params = [
    'external_id' => 'demo_123456',
    'type' => 'STATIC',
    'callback_url' => 'https://webhook.site',
    'amount' => 10000,
];

$qr_code = \Xendit\QRCode::create($params);
var_dump($qr_code)

Get QR Code

\Xendit\QRCode::get(string $external_id);

Usage example:

$qr_code = \Xendit\QRCode::get('external_123');
var_dump($qr_code);

Recurring Payments

Create a Recurring Payment

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

Usage example:

$params = [
    'external_id' => 'demo_147580196270',
    'payer_email' => '[email protected]',
    'description' => 'Trip to Bali',
    'amount' => 32000,
    'interval' => 'MONTH',
    'interval_count' => 1
];

$createRecurring = \Xendit\Recurring::create($params);
var_dump($createRecurring);

Get a Recurring Payment

\Xendit\Recurring::retrieve(string $id);

Usage example:

$id = 'recurring-payment-id';

$getRecurring = \Xendit\Recurring::retrieve($id);
var_dump($getRecurring);

Edit Recurring Payment

\Xendit\Recurring::update(string $id, array $params);

Usage example:

$id = 'recurring-payment-id';
$params = ['amount' => 10000];

$editRecurring = \Xendit\Recurring::update($id, $params);
var_dump($editRecurring);

Stop Recurring Payment

\Xendit\Recurring::stop(string $id);

Usage example:

$id = 'recurring-payment-id';

$stopRecurring = \Xendit\Recurring::stop($id);
var_dump($stopRecurring);

Pause Recurring Payment

\Xendit\Recurring::pause(string $id);

Usage example:

$id = 'recurring-payment-id';

$pauseRecurring = \Xendit\Recurring::pause($id);
var_dump($pauseRecurring);

Resume Recurring Payment

\Xendit\Recurring::resume(string $id);

Usage example:

$id = 'recurring-payment-id';

$resumeRecurring = \Xendit\Recurring::resume($id);
var_dump($resumeRecurring);

Retail Outlets

Create Fixed Payment Code

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

Usage example:

$params = [
    'external_id' => 'TEST-123456789',
    'retail_outlet_name' => 'ALFAMART',
    'name' => 'JOHN DOE',
    'expected_amount' => 25000
];

$createFPC = \Xendit\Retail::create($params);
var_dump($createFPC);

Update Fixed Payment Code

\Xendit\Retail::update(string $id, array $params);

Usage example:

$id = 'FPC-id';
$updateParams = ['expected_amount' => 20000];

$updateFPC = \Xendit\Retail::update($id, $updateParams);
var_dump($updateFPC);

Get Fixed Payment Code

\Xendit\Retail::retrieve(string $id);

Usage example:

$id = 'FPC-id';
$getFPC = \Xendit\Retail::retrieve($id);
var_dump($getFPC);

Virtual Accounts

Create Fixed Virtual Account

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

Usage example:

"VA_fixed-12341234", "bank_code" => "MANDIRI", "name" => "Steve Wozniak" ]; $createVA = \Xendit\VirtualAccounts::create($params); var_dump($createVA); ">
$params = ["external_id" => "VA_fixed-12341234",
   "bank_code" => "MANDIRI",
   "name" => "Steve Wozniak"
];

$createVA = \Xendit\VirtualAccounts::create($params);
var_dump($createVA);

Get Virtual Account Bank

\Xendit\VirtualAccounts::getVABanks();

Usage example:

$getVABanks = \Xendit\VirtualAccounts::getVABanks();
var_dump($getVABanks);

Get Fixed Virtual Account

\Xendit\VirtualAccounts::retrieve(string $id);

Usage example:

$id = 'VA-id';
$getVA = \Xendit\VirtualAccounts::retrieve($id);
var_dump($getVA);

Update Fixed Virtual Account

\Xendit\VirtualAccounts::update(string $id, array $params);

Usage example:

1000]; $updateVA = \Xendit\VirtualAccounts::update($id, $updateParams); var_dump($updateVA); ">
$id = 'VA-id';
$updateParams = ["suggested_amount" => 1000];

$updateVA = \Xendit\VirtualAccounts::update($id, $updateParams);
var_dump($updateVA);

Get Fixed Virtual Account Payment

\Xendit\VirtualAccounts::getFVAPayment(string $paymentID);

Usage example:

$paymentID = 'payment-ID';
$getFVAPayment = \Xendit\VirtualAccounts::getFVAPayment($paymentID);
var_dump($getFVAPayment);

Exceptions

InvalidArgumentException

InvalidArgumentException will be thrown if the argument provided by user is not sufficient to create the request.

For example, there are required arguments such as external_id, payer_email, description, and amount to create an invoice. If user lacks one or more arguments when attempting to create one, InvalidArgumentException will be thrown.

InvalidArgumentException is derived from PHP's InvalidArgumentException. For more information about this Exception methods and properties, please check PHP Documentation.

ApiException

ApiException 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 id.

To get exception message:

try {
    $getInvoice = \Xendit\Invoice::retrieve('123');
} catch (\Xendit\Exceptions\ApiException $e) {
    var_dump($e->getMessage());
}

To get exception HTTP error code:

try {
    $getInvoice = \Xendit\Invoice::retrieve('123');
} catch (\Xendit\Exceptions\ApiException $e) {
    var_dump($e->getCode());
}

To get exception Xendit API error code:

try {
    $getInvoice = \Xendit\Invoice::retrieve('123');
} catch (\Xendit\Exceptions\ApiException $e) {
    var_dump($e->getErrorCode());
}

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 installed in your computer

composer install

Tests

Running test suite:

vendor\bin\phpunit tests

Running examples:

php examples\InvoiceExample.php

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

Comments
  • unexpected '=' at ApiRequestor.php

    unexpected '=' at ApiRequestor.php

    Error ketika production request payment

    [$rbody, $rcode, $rheaders] = $this->_httpClient()->sendRequest(

    HttpClient/GuzzleClient.php

    [$rbody, $rcode, $rheader] = $this->_executeRequest($opts, $url);

    opened by holywingsindonesia 23
  • Ewallet versi terbaru

    Ewallet versi terbaru "Failed to validate the request, 1 error occurred. " error 400

    Halo Semuanya saya ada kendala dalam implementasi pembayaran ewallet versi baru. saya sudah mengikuti semua aturan yang ditentukan oleh pihak xendit, saya udah mencoba beberapa cara, bahkan sama sampai buka doc. postman xendit untuk test secara langsung dengan menggunakan secret key milik saya. dan hasilnya tetap sama. seperti dibawah ini

    image

    ini code yang saya gunakan.. image

    image

    ini param yang saya set if($request->ewallet_type == 'SHOPEEPAY'){ $payload = [ 'reference_id' => $vendors->vendor->prefix.'-'.$request->external_id, 'currency'=>'IDR', 'checkout_method'=>'ONE_TIME_PAYMENT', 'amount' => (int)$request->amount, 'channel_code' => 'ID_'.$request->ewallet_type, 'channel_properties'=>[ 'success_redirect_url'=>$request->success_redirect_url ]
    ]; }

    opened by mfauzann 15
  • The API key is forbidden to perform this request

    The API key is forbidden to perform this request

    Hi , This is mani when i store credit card details throw below issue "exception: "Xendit\Exceptions\ApiException" file: "xendit/xendit-php/src/HttpClient/GuzzleClient.php" line: 167 message: "The API key is forbidden to perform this request" "

    mycode look like below in laravel : Xendit::setApiKey('hidden_development_key'); $params = ['amount' => 1013.5]; $captureCharge = \Xendit\Cards::capture($request->authid,$params);

    in js file : Xendit.card.createToken({
    amount: parseInt(totalAmt),
    card_number: $('#card_number').val(),
    card_exp_month: getMonth,
    card_exp_year: $('#expire_year').val(),
    card_cvn: $('#cvv_number').val() ,
    is_multiple_use: true,
    }, xenditResponseHandler); ...

    opened by msquareM 12
  • Uncaught API format Error

    Uncaught API format Error

    haii, can you help this eror

    Fatal error: Uncaught Xendit\Exceptions\ApiException: There was an error with the format submitted to the server. in C:\xampp\htdocs\xendit-php-master\src\HttpClient\GuzzleClient.php:166 Stack trace: #0 C:\xampp\htdocs\xendit-php-master\src\HttpClient\GuzzleClient.php(139): Xendit\HttpClient\GuzzleClient::_handleAPIError(Array) #1 C:\xampp\htdocs\xendit-php-master\src\HttpClient\GuzzleClient.php(92): Xendit\HttpClient\GuzzleClient->_executeRequest(Array, '/v2/invoices') #2 C:\xampp\htdocs\xendit-php-master\src\ApiRequestor.php(87): Xendit\HttpClient\GuzzleClient->sendRequest('POST', '/v2/invoices', Array, Array) #3 C:\xampp\htdocs\xendit-php-master\src\ApiRequestor.php(43): Xendit\ApiRequestor->_requestRaw('POST', '/v2/invoices', Array, Array) #4 C:\xampp\htdocs\xendit-php-master\src\ApiOperations\Request.php(76): Xendit\ApiRequestor->request('POST', '/v2/invoices', Array, Array) #5 C:\xampp\htdocs\xendit-php-master\src\ApiOperations\Create.php(40): Xendit\Invoice::_request('POST', '/v2/invoices', Array) #6 C:\xampp\htdoc in C:\xampp\htdocs\xendit-php-master\src\HttpClient\GuzzleClient.php on line 166

    investigation 
    opened by Kristina-wulandari 12
  • Error Class 'Dotenv\Dotenv' not found

    Error Class 'Dotenv\Dotenv' not found

    Tolong dibantu saya lagi integrasikan ovo payment dengan library v2 tapi malah terjadi error, Fatal error: Uncaught Error: Class 'Dotenv\Dotenv' not found in C:\xampp\htdocs\xendit\tes.php:19 Stack trace: #0 {main} thrown in C:\xampp\htdocs\xendit\tes.php on line 19

    Berikut code saya

    use Dotenv\Dotenv;
    use Xendit\Xendit;
    
    require 'vendor/autoload.php';
    
    $dotenv = Dotenv::createImmutable(__DIR__ . '/..');
    $dotenv->load();
    Xendit::setApiKey(getenv('xnd_production_aJgisgZJk9tc4bd5IM0moxxxx'));
    
    $ovoParams = [
        'external_id'	=> 'demo_' . time(),
        'amount'		=> 32000,
        'phone'			=> '081298498259',
        'ewallet_type'	=> 'OVO'
    ];
    
    try {
        $createOvo = \Xendit\EWallets::create($ovoParams);
        var_dump($createOvo);
    } catch (\Xendit\Exceptions\ApiException $exception) {
        var_dump($exception);
    }
    
    $getOvo = \Xendit\EWallets::getPaymentStatus($ovoParams['external_id'], 'OVO');
    var_dump($getOvo);
    

    Code diatas saya ambil dari folder example dari repo github disini.

    opened by rizki5411 11
  • Perubahan API KEY development ke API KEY production

    Perubahan API KEY development ke API KEY production

    saya mau bertanya, awalnya saya memasang api key development pada aplikasi saya untuk menggunakan api xendit lalu ketika saya mengubah api key development tersebut menjadi api key production semua transaksi saya seperti virtual account dan ewallet ovo tidak masuk ke live mode tetapi malah masuk ke test mode, itu kenapa ya ? saya mengakses api xendit menggunakan library xendit-php ini

    opened by AndhikaAdjie 9
  • Not respon testing API request

    Not respon testing API request

    Saya sudah membuat akun Xendit dan masih dalam tahap testing dengan menggunakan API request. Saya melakukan API request langsung dari aplikasi klien saya menggunakan codeigniter. End point yg saya coba adalah Create Customers dan Get Balance. Namun request saya tidak ada respon baik itu gagal maupun berhasil. Customers get balance

    opened by robbynurdiansyah 7
  • Install error

    Install error

    saya sudah install dengan composer dan muncul folder vendor

    lalu next stepnya, saya buka di localhost http://localhost/xendit/vendor/xendit/xendit-php/tests/TestCase.php

    keluar eror Fatal error: Uncaught Error: Class 'PHPUnit\Framework\TestCase' not found in C:\xampp\htdocs\xendit\vendor\xendit\xendit-php\tests\TestCase.php:25 Stack trace: #0 {main} thrown in C:\xampp\htdocs\xendit\vendor\xendit\xendit-php\tests\TestCase.php on line 25

    boleh tolong ??

    opened by stevanhoo 7
  • Can not pass decimal number to Xendit

    Can not pass decimal number to Xendit

    Currently, the total payment is being rounded in Xendit gateway.

    E.g: in the checkout page, total payment is 23,545.50 but the total payment in Xendit gateway is 23,545.00

    Here is our EVN info Version: 1.4 OS: Ubuntu

    I think it's happening because 'amount' is cast to (int) in XenditPHPClient::createInvoice.

    Just wondering, is there a configuration to allow payment with decimal number. Do you have a patch for it, or we need to upgrade to the latest version(2.17)? Thanks

    opened by tannguyen-iprice 6
  • Class 'XenditClient\XenditPHPClient' not found

    Class 'XenditClient\XenditPHPClient' not found

    Hi, I try to create invoice with this php code:

    require 'vendor/autoload.php';

    $options['secret_api_key'] = 'xnd_development_xxxxxx';

    $xenditPHPClient = new XenditClient\XenditPHPClient($options);

    $external_id = 'demo_1475801962607'; $amount = 230000; $payer_email = '[email protected]'; $description = 'Trip to Bali';

    $response = $xenditPHPClient->createInvoice($external_id, $amount, $payer_email, $description); print_r($response);

    I get autoload.php by installing via composer require xendit/xendit-php

    When I run the script, getting this error: Uncaught Error: Class 'XenditClient\XenditPHPClient' not found

    Please help what's wrong with my code?!

    opened by z03n87 6
  • Error When Running Balance Examples

    Error When Running Balance Examples

    Got this error when running balance PHP

    Fatal error: Uncaught Xendit\Exceptions\ApiException: Please contact customer support in /Users/ervan/Documents/xendit/project/php/xendit-php/src/HttpClient/GuzzleClient.php:166 Stack trace: #0 /Users/ervan/Documents/xendit/project/php/xendit-php/src/HttpClient/GuzzleClient.php(139): Xendit\HttpClient\GuzzleClient::_handleAPIError(Array) #1 /Users/ervan/Documents/xendit/project/php/xendit-php/src/HttpClient/GuzzleClient.php(92): Xendit\HttpClient\GuzzleClient->_executeRequest(Array, '/balance?accoun...') #2 /Users/ervan/Documents/xendit/project/php/xendit-php/src/ApiRequestor.php(84): Xendit\HttpClient\GuzzleClient->sendRequest('GET', '/balance?accoun...', Array, Array) #3 /Users/ervan/Documents/xendit/project/php/xendit-php/src/ApiRequestor.php(43): Xendit\ApiRequestor->_requestRaw('GET', '/balance?accoun...', Array, Array) #4 /Users/ervan/Documents/xendit/project/php/xendit-php/src/ApiOperations/Request.php(76): Xendit\ApiRequestor->request('GET', '/balance?accoun...', Array, Array) #5 /Users/ervan/Documents/xendit/proj in /Users/ervan/Documents/xendit/project/php/xendit-php/src/HttpClient/GuzzleClient.php on line 166

    investigation 
    opened by ErvanAdetya 6
  • Callback Virtual Akun

    Callback Virtual Akun

    #ASK

    kalo simulasi pembayaraan dengan virtual akun menggunakan bank_account_number = xxxxxx164313 (https://api.xendit.co/pool_virtual_accounts/simulate_payment) gk muncul di report callback ya? tapi jika menggunakan external_id = xxx8989 dengan enpoint (https://api.xendit.co/callback_virtual_accounts/external_id=IC-1667103700/simulate_payment) muncul di report callback, apakah ada salah config?

    pay

    opened by stenlyysamberi 0
  • Xendit.card.createToken authentication failed with reason AUTHENTICATION_FAILED

    Xendit.card.createToken authentication failed with reason AUTHENTICATION_FAILED

    The xendit.js createToken method always fails with failure reason "AUTHENTICATION_FAILED". testing on https://js.xendit.co/test_tokenize.html with the same development/test mode public key also fails with the same reason.

    opened by hlc94 0
  • xenPlatform - create invoice with

    xenPlatform - create invoice with "with-fee-rule" header value

    Hi, I tried to create an "invoice" under xenPlatform account but I can't make it work when I tried to add custom headers value $headers = [ 'Content-Type' => 'application/json', 'for-user-id' => '62d14fbebb76ff3520f7cacc', 'with-fee-rule' => 'xpfeeru_c45922a7-e88c-49f9-8164-c1aed8a76769', ];

    The invoice will be created but it will just place under the "main account" and not on the "xenPlatform user account".

    complete invoice request code:


    use Xendit\Xendit;
    
    require 'vendor/autoload.php';
    
    Xendit::setApiKey('API KEY');
    
    $headers = [];
    $headers = [
        'Content-Type' => 'application/json',
        'for-user-id' => '62d14fbebb76ff3520f7cacc',
        'with-fee-rule' => 'xpfeeru_c45922a7-e88c-49f9-8164-c1aed8a76769',
        ];
    
    $params = [
        'external_id' => 'demo_2',
        'amount' => 599,
        'description' => 'Invoice Demo #2',
        'invoice_duration' => 86400,
        'customer' => [
            'given_names' => 'Pedro',
            'surname' => 'Juan',
            'email' => '[email protected]',
            'mobile_number' => '+6287774441111',
            'addresses' => [
                [
                    'city' => 'Jakarta Selatan',
                    'country' => 'Indonesia',
                    'postal_code' => '12345',
                    'state' => 'Daerah Khusus Ibukota Jakarta',
                    'street_line1' => 'Jalan Makan',
                    'street_line2' => 'Kecamatan Kebayoran Baru'
                ]
            ]
        ],
        'customer_notification_preference' => [
            'invoice_created' => [
                'whatsapp',
                'sms',
                'email',
                'viber'
            ],
            'invoice_reminder' => [
                'whatsapp',
                'sms',
                'email',
                'viber'
            ],
            'invoice_paid' => [
                'whatsapp',
                'sms',
                'email',
                'viber'
            ],
            'invoice_expired' => [
                'whatsapp',
                'sms',
                'email',
                'viber'
            ]
        ],
        'success_redirect_url' => 'https=>//www.google.com',
        'failure_redirect_url' => 'https=>//www.google.com',
        'currency' => 'PHP',
        'items' => [
            [
                'name' => 'TIP',
                'quantity' => 1,
                'price' => 599,
                'category' => 'TIP',
                'url' => 'https://example.com'
            ]
        ]
    ];
    
    $createInvoice = \Xendit\Invoice::create($params, $headers);
    var_dump($createInvoice);
    
    opened by menjilx 1
  • Fix: check balance

    Fix: check balance

    This issuer of #191 and I are in the same team in work.

    so this is the solution for "Ledger accounts found for both IDR and PHP currency, we don't know which to pick".

    opened by AaEzha 0
  • check balance error

    check balance error "Ledger accounts found for both IDR and PHP currency, we don't know which to pick"

    hi xendit team,

    when we call balance, we got error Ledger accounts found for both IDR and PHP currency, we don't know which to pick.

    I check your documentation, but its not updated about legder account.

    after I investigation, we found you add new query string currency(IDR / PHP) for legder

    so, in balance.php i modify from :

    $url = '/balance?account_type=' . $account_type

    to $url = '/balance?account_type=' . $account_type.'&currency=IDR';

    please update to this code so we not get error

    thanks

    opened by capcaicah 0
Releases(2.19.0)
Nexmo REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Client Library for PHP Support Notice This library and it's associated packages, nexmo/client and nexmo/client-core have transitioned into a "Maintena

Nexmo 75 Sep 23, 2022
Google PHP API Client Services

Google PHP API Client Services

Google APIs 1.1k Dec 22, 2022
Laravel Package for 1APP. Learn how to integrate our APIs to build a web or mobile integration to send and accept payments for your application and businesses.

1APP Laravel Library Learn how to integrate our APIs to build a web or mobile integration to accept payments, make payment of Bills and as well custom

O'Bounce Technologies 4 Jul 25, 2022
OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

Mounir R'Quiba 6 Jun 14, 2023
The Smart-ID PHP client can be used for easy integration of the Smart-ID solution to information systems or e-services

Smart-ID PHP client Introduction The Smart-ID PHP client can be used for easy integration of the Smart-ID solution to information systems or e-service

SK ID Solutions 16 Oct 23, 2022
telegram bot for sell virtual number

Telefake Telegram bot for sell virtual number (fully automatic) Installation create bot in telegram upload script in website with php and ssl (https)

reza malekpour 4 Aug 20, 2022
AsyncAws Core - shared classes between all AWS services. It also contains the STS client to handle authentication.

AsyncAws Core The repository contains shared classes between all AWS services. It also contains the STS client to handle authentication. Install compo

Async AWS 54 Dec 14, 2022
Google-api-php-client - A PHP client library for accessing Google APIs

Google APIs Client Library for PHP Reference Docs https://googleapis.github.io/google-api-php-client/main/ License Apache 2.0 The Google API Client Li

Google APIs 8.4k Dec 30, 2022
PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD

Sergey Bykov 63 Feb 14, 2022
A PHP library for communicating with the Twilio REST API and generating TwiML.

twilio-php The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio API c

Twilio 1.4k Jan 2, 2023
Twitter REST API for PHP 5.3+

README The Wid'op Twitter REST library is a modern PHP 5.3+ API allowing you to easily interact with Twitter 1.1. In order to sign your request with t

Wid'op 24 Aug 10, 2020
PHP library to use IOTA REST API to help node management and tangle queries

iota.php About PHP library to use IOTA REST API to help node management and tangle queries. Please be aware that this library is in an early developme

IOTA Community 45 Dec 13, 2022
DigitalOcean API v2 client for Symfony and API Platform

DigitalOcean Bundle for Symfony and API Platform DunglasDigitalOceanBundle allows using the DigitalOcean API from your Symfony and API Platform projec

Kévin Dunglas 25 Jul 27, 2022
API client for ThePay - payment gate API

This is the official highly compatible public package of The Pay SDK which interacts with The Pay's REST API. To get started see examples below.

ThePay.cz s.r.o. 3 Oct 27, 2022
Code Quiz MonoRepo (API, API Client, App)

Code Quiz Welcome to the Code Quiz Open Source project from How To Code Well. This is an Open Source project that includes an API and an App for the d

How To Code Well 2 Nov 20, 2022
Interacting with Mastodon's REST API for Kirby v3

Kirby3 Mastodon This plugin provides access to your Mastodon statuses, called 'toots'. Getting started Use one of the following methods to install & u

Fundevogel 5 Dec 31, 2022
Пакет позволяющий работать с REST API SMS-сервиса «SMS Aero»

SMS-сервис «SMS Aero» ?? Пакет позволяющий работать с REST API SMS-сервиса «SMS Aero» ?? Изменения: Все заметные изменения в этом проекте будут задоку

Артём Соколовский 2 Feb 6, 2022
This library is for integration with Salesforce via REST API.

xsolve-pl/salesforce-client Introduction This library is for integration with Salesforce via REST API. Licence This library is under the MIT license.

Boldare / XSolve Sp. z o.o. 31 Oct 13, 2022
This package help you build your REST API documentation.

Laravel API Doc This package help you build your REST API documentation. Installation You can install the package via composer: composer require axeld

Axel 2 May 19, 2022