Skip to content

Commit

Permalink
Generated Xendit php SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
xendit-devx-bot committed Sep 27, 2023
1 parent 93d3dbe commit 782843b
Show file tree
Hide file tree
Showing 45 changed files with 2,415 additions and 5,943 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/generate-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
id: parse-changelog
run: |
echo "changelog<<EOF" >> "$GITHUB_OUTPUT"
echo "${{ github.event.client_payload.changelog }}" | tr -s '%0A' '\n' >> "$GITHUB_OUTPUT"
echo "${{ github.event.client_payload.changelog }}" | sed -e 's/%0A/\n/g' >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Create Release
id: create-release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
tag_name: v${{ github.event.client_payload.version }}
release_name: v${{ github.event.client_payload.version }}
tag_name: ${{ github.event.client_payload.version }}
release_name: ${{ github.event.client_payload.version }}
body: ${{ steps.parse-changelog.outputs.changelog }}
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ docs/Payout/PayoutAllOf.md
docs/Payout/PayoutApi.md
docs/Payout/ReceiptNotification.md
docs/header.jpg
lib/ApiException.php
lib/Configuration.php
lib/HeaderSelector.php
lib/Model/ModelInterface.php
Expand All @@ -42,6 +41,7 @@ lib/Payout/Payout.php
lib/Payout/PayoutAllOf.php
lib/Payout/PayoutApi.php
lib/Payout/ReceiptNotification.php
lib/XenditSdkException.php
phpunit.xml.dist
test/Api/PayoutApiTest.php
test/Model/ChannelAccountTypeTest.php
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The official Xendit PHP SDK provides a simple and convenient way to call Xendit's REST API
in applications written in PHP.

* Package version: 3.1.0
* Package version: 3.2.0

# Getting Started

Expand All @@ -28,7 +28,7 @@ To install the bindings via [Composer](https://getcomposer.org/), add the follow
}
],
"require": {
"xendit/xendit-php": "3.1.0"
"xendit/xendit-php": "3.2.0"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xendit/xendit-php",
"version": "3.1.0",
"version": "3.2.0",
"description": "Xendit PHP SDK",
"keywords": [
"openapitools",
Expand Down
3 changes: 2 additions & 1 deletion docs/BalanceAndTransaction/BalanceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ $for_user_id = "5dbf20d7c8eb0c0896f811b6"; // string | The sub-account user-id t
try {
$result = $apiInstance->getBalance($account_type, $currency, $for_user_id);
print_r($result);
} catch (Exception $e) {
} catch (\Xendit\XenditSdkException $e) {
echo 'Exception when calling BalanceApi->getBalance: ', $e->getMessage(), PHP_EOL;
echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}
```

Expand Down
6 changes: 4 additions & 2 deletions docs/BalanceAndTransaction/TransactionApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ $before_id = "'before_id_example'"; // string
try {
$result = $apiInstance->getAllTransactions($for_user_id, $types, $statuses, $channel_categories, $reference_id, $product_id, $account_identifier, $amount, $currency, $created, $updated, $limit, $after_id, $before_id);
print_r($result);
} catch (Exception $e) {
} catch (\Xendit\XenditSdkException $e) {
echo 'Exception when calling TransactionApi->getAllTransactions: ', $e->getMessage(), PHP_EOL;
echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}
```

Expand Down Expand Up @@ -115,8 +116,9 @@ $for_user_id = "5dbf20d7c8eb0c0896f811b6"; // string | The sub-account user-id t
try {
$result = $apiInstance->getTransactionByID($id, $for_user_id);
print_r($result);
} catch (Exception $e) {
} catch (\Xendit\XenditSdkException $e) {
echo 'Exception when calling TransactionApi->getTransactionByID: ', $e->getMessage(), PHP_EOL;
echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}
```

Expand Down
13 changes: 13 additions & 0 deletions docs/Invoice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ components:
enum:
- IDR
- USD
- THB
- VND
- PHP
type: string
InvoiceClientType:
Expand Down Expand Up @@ -627,6 +629,9 @@ components:
- PERMATA
- BSI
- BJB
- SAHABAT_SAMPOERNA
- CIMB
- BNC
type: string
RetailOutletName:
description: Representing the available retail outlet channels used for invoice-related
Expand All @@ -653,6 +658,9 @@ components:
- SHOPEEPAY
- GCASH
- GRABPAY
- ASTRAPAY
- NEXCASH
- JENIUSPAY
type: string
QrCodeType:
description: Representing the available QR Code channels used for invoice-related
Expand All @@ -679,6 +687,11 @@ components:
- BA_BCA_KLIKPAY
- DC_BCA_KLIKPAY
- DD_BCA_KLIKPAY
- DD_BDO_EPAY
- DD_RCBC
- DD_CHINABANK
- BA_CHINABANK
- DC_CHINABANK
type: string
PaylaterType:
description: Representing the available paylater channels used for invoice-related
Expand Down
6 changes: 6 additions & 0 deletions docs/Invoice/BankCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ use Xendit\Invoice\BankCode;

* `BJB` (value: `'BJB'`)

* `SAHABAT_SAMPOERNA` (value: `'SAHABAT_SAMPOERNA'`)

* `CIMB` (value: `'CIMB'`)

* `BNC` (value: `'BNC'`)


[[Back to README]](../../README.md)
10 changes: 10 additions & 0 deletions docs/Invoice/DirectDebitType.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,15 @@ use Xendit\Invoice\DirectDebitType;

* `DD_BCA_KLIKPAY` (value: `'DD_BCA_KLIKPAY'`)

* `DD_BDO_EPAY` (value: `'DD_BDO_EPAY'`)

* `DD_RCBC` (value: `'DD_RCBC'`)

* `DD_CHINABANK` (value: `'DD_CHINABANK'`)

* `BA_CHINABANK` (value: `'BA_CHINABANK'`)

* `DC_CHINABANK` (value: `'DC_CHINABANK'`)


[[Back to README]](../../README.md)
6 changes: 6 additions & 0 deletions docs/Invoice/EwalletType.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ use Xendit\Invoice\EwalletType;

* `GRABPAY` (value: `'GRABPAY'`)

* `ASTRAPAY` (value: `'ASTRAPAY'`)

* `NEXCASH` (value: `'NEXCASH'`)

* `JENIUSPAY` (value: `'JENIUSPAY'`)


[[Back to README]](../../README.md)
12 changes: 8 additions & 4 deletions docs/Invoice/InvoiceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ $create_invoice_request = {"external_id":"test1234","description":"Test Invoice"
try {
$result = $apiInstance->createInvoice($create_invoice_request);
print_r($result);
} catch (Exception $e) {
} catch (\Xendit\XenditSdkException $e) {
echo 'Exception when calling InvoiceApi->createInvoice: ', $e->getMessage(), PHP_EOL;
echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}
```

Expand Down Expand Up @@ -86,8 +87,9 @@ $invoice_id = "5f4708b7bd394b0400b96276"; // string | Invoice ID to be expired
try {
$result = $apiInstance->expireInvoice($invoice_id);
print_r($result);
} catch (Exception $e) {
} catch (\Xendit\XenditSdkException $e) {
echo 'Exception when calling InvoiceApi->expireInvoice: ', $e->getMessage(), PHP_EOL;
echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}
```

Expand Down Expand Up @@ -137,8 +139,9 @@ $invoice_id = "62efe4c33e45294d63f585f2"; // string | Invoice ID
try {
$result = $apiInstance->getInvoiceById($invoice_id);
print_r($result);
} catch (Exception $e) {
} catch (\Xendit\XenditSdkException $e) {
echo 'Exception when calling InvoiceApi->getInvoiceById: ', $e->getMessage(), PHP_EOL;
echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}
```

Expand Down Expand Up @@ -201,8 +204,9 @@ $recurring_payment_id = "62efe4c33e45294d63f585f2"; // string
try {
$result = $apiInstance->getInvoices($external_id, $statuses, $limit, $created_after, $created_before, $paid_after, $paid_before, $expired_after, $expired_before, $last_invoice, $client_types, $payment_channels, $on_demand_link, $recurring_payment_id);
print_r($result);
} catch (Exception $e) {
} catch (\Xendit\XenditSdkException $e) {
echo 'Exception when calling InvoiceApi->getInvoices: ', $e->getMessage(), PHP_EOL;
echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}
```

Expand Down
4 changes: 4 additions & 0 deletions docs/Invoice/InvoiceCurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ use Xendit\Invoice\InvoiceCurrency;

* `USD` (value: `'USD'`)

* `THB` (value: `'THB'`)

* `VND` (value: `'VND'`)

* `PHP` (value: `'PHP'`)


Expand Down
72 changes: 36 additions & 36 deletions docs/PaymentMethod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,42 @@ paths:
requestBody:
content:
application/json:
examples:
Account linking for E-Wallet:
value:
type: EWALLET
reusability: MULTIPLE_USE
customer:
reference_id: customer-123
type: INDIVIDUAL
individual_detail:
given_names: John
surname: Doe
ewallet:
channel_code: OVO
channel_properties:
success_return_url: https://redirect.me/success
failure_return_url: https://redirect.me/failure
cancel_return_url: https://redirect.me/cancel
metadata:
sku: example-1234
Account linking for PH Direct Debit:
value:
type: DIRECT_DEBIT
direct_debit:
channel_code: BPI
channel_properties:
success_return_url: https://redirect.me/success
failure_return_url: https://redirect.me/failure
reusability: MULTIPLE_USE
customer:
reference_id: customer-123
type: INDIVIDUAL
individual_detail:
given_names: John
surname: Doe
email: [email protected]
mobile_number: 628774494404
schema:
$ref: '#/components/schemas/PaymentMethodParameters'
responses:
Expand Down Expand Up @@ -187,42 +223,6 @@ paths:
"200":
content:
application/json:
examples:
Account linking for PH Direct Debit:
value:
type: DIRECT_DEBIT
direct_debit:
channel_code: BPI
channel_properties:
success_return_url: https://redirect.me/success
failure_return_url: https://redirect.me/failure
reusability: MULTIPLE_USE
customer:
reference_id: customer-123
type: INDIVIDUAL
individual_detail:
given_names: John
surname: Doe
email: [email protected]
mobile_number: 628774494404
Account linking for E-Wallet:
value:
type: EWALLET
reusability: MULTIPLE_USE
customer:
reference_id: customer-123
type: INDIVIDUAL
individual_detail:
given_names: John
surname: Doe
ewallet:
channel_code: OVO
channel_properties:
success_return_url: https://redirect.me/success
failure_return_url: https://redirect.me/failure
cancel_return_url: https://redirect.me/cancel
metadata:
sku: example-1234
schema:
$ref: '#/components/schemas/PaymentMethod'
description: Request successful
Expand Down
Loading

4 comments on commit 782843b

@whousehomestay
Copy link

@whousehomestay whousehomestay commented on 782843b Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any "Upgrade Guide" documentation from v2 to v3?

What i see here: https://developers.xendit.co/api-reference/#create-invoice
is still using v2

@adityarx
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whousehomestay Not yet, may I ask what sort of information could be useful to you in an upgrade guide? I'm happy to write something on our Docs if its useful.

Meanwhile, have you taken a look at this https://github.com/xendit/xendit-php/blob/master/docs/Invoice/InvoiceApi.md? It is API Reference for our new V3 SDK 🙏

@whousehomestay
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i'm not mistaken, some functions on v2 are renamed right? maybe it will be useful if there is a doc covered what actually changed from v2. So anyone who want to upgrade from v2 to v3, will see how big the effort, and how much changes must be made. Thank you. 😸

@adityarx
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sure sure, we'll put this on our roadmap to have a guide for this. Thanks for the feedback!

For Invoice, since the underlying API is the same), the changes will be quite small. So you might be able to port over with minimal effort 🙏

Please sign in to comment.