Skip to content

Commit

Permalink
Generated Xendit go SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
xendit-devx-bot committed Sep 27, 2023
1 parent e116766 commit 06d1630
Show file tree
Hide file tree
Showing 18 changed files with 168 additions and 146 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The official Xendit Go SDK provides a simple and convenient way to call Xendit's REST API
in applications written in Go.

* Package version: 3.1.0
* Package version: 3.2.0

# Getting Started

Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (c *APIClient) PrepareRequest(
headerParams["xendit-lib"] = "go"

// TODO: overwrite this line from buddy pipeline
headerParams["xendit-lib-ver"] = "3.1.0"
headerParams["xendit-lib-ver"] = "3.2.0"

var body *bytes.Buffer

Expand Down
5 changes: 1 addition & 4 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewXenditSdkError(response *[]byte, paramStatus string, paramStatusText str
_rawResponse = map[string]interface{}{}
}

_status := ""
_status := paramStatus

if _status == "" {
if val, ok := _rawResponse["status"]; ok {
Expand All @@ -66,9 +66,6 @@ func NewXenditSdkError(response *[]byte, paramStatus string, paramStatusText str
_status = fmt.Sprintf("%v", val)
}
}
if _status == "" {
_status = paramStatus
}

_errorCode := ""
if _errorCode == "" {
Expand Down
2 changes: 1 addition & 1 deletion configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var Default Configuration = *NewConfiguration()
func NewConfiguration() *Configuration {
cfg := &Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/3.1.0/go",
UserAgent: "OpenAPI-Generator/3.2.0/go",
Debug: false,
Servers: ServerConfigurations{
{
Expand Down
10 changes: 1 addition & 9 deletions docs/PaymentRequestApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,16 +420,10 @@ func main() {

limit := int32(56) // [OPTIONAL] | int32

afterId := "afterId_example" // [OPTIONAL] | string

beforeId := "beforeId_example" // [OPTIONAL] | string

xenditClient := xendit.NewClient("API-KEY")

resp, r, err := xenditClient.PaymentRequestApi.GetPaymentRequestCaptures(context.Background(), paymentRequestId).
Limit(limit).
AfterId(afterId).
BeforeId(beforeId). // [OPTIONAL]
Limit(limit). // [OPTIONAL]
Execute()

if err != nil {
Expand Down Expand Up @@ -462,8 +456,6 @@ Other parameters are passed through a pointer to a apiGetPaymentRequestCapturesR
| ------------- | ------------- | ------------- | ------------- |
|
| **limit** |**int32**| | |
| **afterId** |**string**| | |
| **beforeId** |**string**| | |

### Return type

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 @@ -17,6 +17,12 @@

* `BJB` (value: `"BJB"`)

* `SAHABAT_SAMPOERNA` (value: `"SAHABAT_SAMPOERNA"`)

* `CIMB` (value: `"CIMB"`)

* `BNC` (value: `"BNC"`)


[[Back to README]](../../README.md)

Expand Down
10 changes: 10 additions & 0 deletions docs/invoice/DirectDebitType.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@

* `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)

Expand Down
6 changes: 6 additions & 0 deletions docs/invoice/EwalletType.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

* `GRABPAY` (value: `"GRABPAY"`)

* `ASTRAPAY` (value: `"ASTRAPAY"`)

* `NEXCASH` (value: `"NEXCASH"`)

* `JENIUSPAY` (value: `"JENIUSPAY"`)


[[Back to README]](../../README.md)

Expand Down
4 changes: 4 additions & 0 deletions docs/invoice/InvoiceCurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

* `USD` (value: `"USD"`)

* `THB` (value: `"THB"`)

* `VND` (value: `"VND"`)

* `PHP` (value: `"PHP"`)


Expand Down
72 changes: 36 additions & 36 deletions docs/payment_method.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

0 comments on commit 06d1630

Please sign in to comment.