Skip to content

Commit

Permalink
Merge pull request #29 from xendit/add_description
Browse files Browse the repository at this point in the history
add disbursement description
  • Loading branch information
albertlieyingadrian authored Aug 9, 2017
2 parents 305250e + 7f77bbe commit d59c59c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/XenditPHPClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ function createDisbursement ($external_id, $amount, $bank_code, $account_holder_
$data['account_holder_name'] = $account_holder_name;
$data['account_number'] = $account_number;

if (!empty($disbursement_options['description'])) {
$data['description'] = $disbursement_options['description'];
}

$payload = json_encode($data);

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
Expand Down
18 changes: 18 additions & 0 deletions src/examples/create_disbursement_with_description_example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
require('config/xendit_php_client_config.php');
require('XenditPHPClient.php');

$options['secret_api_key'] = constant('SECRET_API_KEY');

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

$external_id = $argv[1];
$amount = $argv[2];
$bank_code = $argv[3];
$account_holder_name = $argv[4];
$account_number = $argv[5];
$disbursement_options['description'] = $argv[6];

$response = $xenditPHPClient->createDisbursement($external_id, $amount, $bank_code, $account_holder_name, $account_number, $disbursement_options);
print_r($response);
?>

0 comments on commit d59c59c

Please sign in to comment.