Skip to content

Commit

Permalink
update project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
albertlieyingadrian committed Oct 26, 2016
1 parent d25a699 commit 4b84da4
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 19 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# GET Invoice Example : #
```
cd src/
php examples/get_invoice_example.php 57ba6f57cf952cff10ebc073
```

Expand All @@ -10,6 +11,7 @@ php examples/get_invoice_example.php [invoice_id]
# Create Invoice Example : #

```
cd src/
php examples/create_invoice_example.php "CUSTOM_ID_0" 30000 "[email protected]" "this is a description"
```

Expand All @@ -19,27 +21,31 @@ php examples/create_invoice_example.php [external_id] [amount] [payer_email] [de

# Create Disbursement Example : #
```
cd src/
php examples/create_disbursement_example.php "CUSTOM_ID_1" 30000 "BCA" "Rizky" "1234567890"
```

# GET Disbursement Example : #
```
cd src/
php examples/get_disbursement_example.php "57ba93175ef9e7077bcb969e"
```

# Create Callback Virtual Account Example : #
```
cd src/
php examples/create_callback_virtual_account_example.php "CUSTOM_ID_2" "BCA" "Rizky"
```

# GET Balance Example : #
```
cd src/
php examples/get_balance_example.php
```

# Post Invoice Status Callback Example : #
```
1. Run: cd examples
1. Run: cd src/examples
2. Run: php -S localhost:8006 post_invoice_status_callback_server_example.php
3. When invoice is paid, xendit will hit localhost:8006/paid_invoice_from_xendit with POST method:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"php": ">=5.4.0"
},
"autoload": {
"psr-0": { "XenditPhpClients": "src/" }
"psr-4": { "XenditClient\\": "src/" }
}
}
2 changes: 2 additions & 0 deletions index.php → src/XenditPHPClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace XenditClient;

class XenditPHPClient {
function __construct ($options) {
if ($options['server_domain']) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
require('config/xendit_php_client_config.php');
require('index.php');

require('XenditPHPClient.php');
$options['secret_api_key'] = constant('SECRET_API_KEY');
$options['server_domain'] = constant('SERVER_DOMAIN');

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

$external_id = $argv[1];
$bank_code = $argv[2];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
require('config/xendit_php_client_config.php');
require('index.php');

require('XenditPHPClient.php');
$options['secret_api_key'] = constant('SECRET_API_KEY');
$options['server_domain'] = constant('SERVER_DOMAIN');

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

$external_id = $argv[1];
$amount = $argv[2];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
require('config/xendit_php_client_config.php');
require('index.php');

require('XenditPHPClient.php');
$options['secret_api_key'] = constant('SECRET_API_KEY');
$options['server_domain'] = constant('SERVER_DOMAIN');

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

$external_id = $argv[1];
$amount = $argv[2];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
require('config/xendit_php_client_config.php');
require('index.php');

require('XenditPHPClient.php');
$options['secret_api_key'] = constant('SECRET_API_KEY');
$options['server_domain'] = constant('SERVER_DOMAIN');

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

$response = $xenditPHPClient->getBalance();
print_r($response);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
require('config/xendit_php_client_config.php');
require('index.php');

require('XenditPHPClient.php');
$options['secret_api_key'] = constant('SECRET_API_KEY');
$options['server_domain'] = constant('SERVER_DOMAIN');

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

$disbursement_id = $argv[1];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
require('config/xendit_php_client_config.php');
require('index.php');
require('XenditPHPClient.php');

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

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

$invoice_id = $argv[1];

Expand Down

0 comments on commit 4b84da4

Please sign in to comment.