From 06d1630b739b6d18a5620c1f629564934b4eafc1 Mon Sep 17 00:00:00 2001 From: xendit-devx-bot Date: Wed, 27 Sep 2023 05:52:45 +0000 Subject: [PATCH] Generated Xendit go SDK --- .github/workflows/generate-release-tag.yml | 6 +- README.md | 2 +- client.go | 2 +- common/common.go | 5 +- configuration.go | 2 +- docs/PaymentRequestApi.md | 10 +- docs/invoice.yaml | 13 ++ docs/invoice/BankCode.md | 6 + docs/invoice/DirectDebitType.md | 10 ++ docs/invoice/EwalletType.md | 6 + docs/invoice/InvoiceCurrency.md | 4 + docs/payment_method.yaml | 72 +++++------ docs/payment_request.yaml | 132 +++++++++------------ invoice/model_bank_code.go | 6 + invoice/model_direct_debit_type.go | 10 ++ invoice/model_ewallet_type.go | 6 + invoice/model_invoice_currency.go | 4 + payment_request/api_payment_request.go | 18 --- 18 files changed, 168 insertions(+), 146 deletions(-) diff --git a/.github/workflows/generate-release-tag.yml b/.github/workflows/generate-release-tag.yml index 344dada4..4e095204 100644 --- a/.github/workflows/generate-release-tag.yml +++ b/.github/workflows/generate-release-tag.yml @@ -12,7 +12,7 @@ jobs: id: parse-changelog run: | echo "changelog<> "$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 @@ -20,8 +20,8 @@ jobs: 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 \ No newline at end of file diff --git a/README.md b/README.md index aabe15e1..0ead36e3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/client.go b/client.go index cd1c00fa..64345552 100644 --- a/client.go +++ b/client.go @@ -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 diff --git a/common/common.go b/common/common.go index 208cfe22..f33ccd70 100644 --- a/common/common.go +++ b/common/common.go @@ -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 { @@ -66,9 +66,6 @@ func NewXenditSdkError(response *[]byte, paramStatus string, paramStatusText str _status = fmt.Sprintf("%v", val) } } - if _status == "" { - _status = paramStatus - } _errorCode := "" if _errorCode == "" { diff --git a/configuration.go b/configuration.go index 931a94a3..fbfd4647 100644 --- a/configuration.go +++ b/configuration.go @@ -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{ { diff --git a/docs/PaymentRequestApi.md b/docs/PaymentRequestApi.md index 7c852cc5..e53e62a8 100644 --- a/docs/PaymentRequestApi.md +++ b/docs/PaymentRequestApi.md @@ -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 { @@ -462,8 +456,6 @@ Other parameters are passed through a pointer to a apiGetPaymentRequestCapturesR | ------------- | ------------- | ------------- | ------------- | | | **limit** |**int32**| | | -| **afterId** |**string**| | | -| **beforeId** |**string**| | | ### Return type diff --git a/docs/invoice.yaml b/docs/invoice.yaml index 6e64ecbe..4e497fb8 100644 --- a/docs/invoice.yaml +++ b/docs/invoice.yaml @@ -590,6 +590,8 @@ components: enum: - IDR - USD + - THB + - VND - PHP type: string InvoiceClientType: @@ -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 @@ -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 @@ -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 diff --git a/docs/invoice/BankCode.md b/docs/invoice/BankCode.md index 4bdf0ce7..20e2039d 100644 --- a/docs/invoice/BankCode.md +++ b/docs/invoice/BankCode.md @@ -17,6 +17,12 @@ * `BJB` (value: `"BJB"`) +* `SAHABAT_SAMPOERNA` (value: `"SAHABAT_SAMPOERNA"`) + +* `CIMB` (value: `"CIMB"`) + +* `BNC` (value: `"BNC"`) + [[Back to README]](../../README.md) diff --git a/docs/invoice/DirectDebitType.md b/docs/invoice/DirectDebitType.md index 55fa9891..42bdfb0f 100644 --- a/docs/invoice/DirectDebitType.md +++ b/docs/invoice/DirectDebitType.md @@ -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) diff --git a/docs/invoice/EwalletType.md b/docs/invoice/EwalletType.md index 5d279018..6468f27a 100644 --- a/docs/invoice/EwalletType.md +++ b/docs/invoice/EwalletType.md @@ -17,6 +17,12 @@ * `GRABPAY` (value: `"GRABPAY"`) +* `ASTRAPAY` (value: `"ASTRAPAY"`) + +* `NEXCASH` (value: `"NEXCASH"`) + +* `JENIUSPAY` (value: `"JENIUSPAY"`) + [[Back to README]](../../README.md) diff --git a/docs/invoice/InvoiceCurrency.md b/docs/invoice/InvoiceCurrency.md index b4cd5a55..bc13b949 100644 --- a/docs/invoice/InvoiceCurrency.md +++ b/docs/invoice/InvoiceCurrency.md @@ -7,6 +7,10 @@ * `USD` (value: `"USD"`) +* `THB` (value: `"THB"`) + +* `VND` (value: `"VND"`) + * `PHP` (value: `"PHP"`) diff --git a/docs/payment_method.yaml b/docs/payment_method.yaml index 924a0cfd..2e0c6be8 100644 --- a/docs/payment_method.yaml +++ b/docs/payment_method.yaml @@ -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: testemail@email.com + mobile_number: 628774494404 schema: $ref: '#/components/schemas/PaymentMethodParameters' responses: @@ -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: testemail@email.com - 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 diff --git a/docs/payment_request.yaml b/docs/payment_request.yaml index d466b299..fdd7c67c 100644 --- a/docs/payment_request.yaml +++ b/docs/payment_request.yaml @@ -103,6 +103,65 @@ paths: requestBody: content: application/json: + examples: + E-Wallet One Time Payment via Redirect URL: + value: + reference_id: example-ref-1234 + amount: 15000 + currency: IDR + country: ID + payment_method: + type: EWALLET + ewallet: + channel_code: SHOPEEPAY + channel_properties: + success_return_url: https://redirect.me/success + reusability: ONE_TIME_USE + Fixed amount dynamic QR: + value: + reference_id: example-ref-1234 + amount: 15000 + currency: IDR + payment_method: + type: QR_CODE + reusability: ONE_TIME_USE + qr_code: + channel_code: “QRIS” + metadata: + sku: example-sku-1234 + Fixed amount single use Virtual Account: + value: + reference_id: example-ref-1234 + currency: IDR + amount: 15000 + country: ID + payment_method: + type: VIRTUAL_ACCOUNT + reusability: ONE_TIME_USE + reference_id: example-1234 + virtual_account: + channel_code: BNI + channel_properties: + customer_name: Ahmad Gunawan + expires_at: 2023-01-03T17:00:00Z + metadata: + sku: example-sku-1234 + Subsequent PH Direct Debit payments after account linking: + value: + reference_id: example-ref-1234 + amount: 1500 + currency: PHP + payment_method_id: pm-9685a196-81e9-4c73-8d62-97df5aab2762 + metadata: + sku: example-sku-1234 + Subsequent tokenized E-Wallet payments after account linking: + value: + reference_id: example-ref-1234 + amount: 15000 + currency: IDR + payment_method_id: pm-2b2c6092-2100-4843-a7fc-f5c7edac7efd + metadata: + sku: example-sku-1234 schema: $ref: '#/components/schemas/PaymentRequestParameters' responses: @@ -156,65 +215,6 @@ paths: "200": content: application/json: - examples: - E-Wallet One Time Payment via Redirect URL: - value: - reference_id: example-ref-1234 - amount: 15000 - currency: IDR - country: ID - payment_method: - type: EWALLET - ewallet: - channel_code: SHOPEEPAY - channel_properties: - success_return_url: https://redirect.me/success - reusability: ONE_TIME_USE - Fixed amount dynamic QR: - value: - reference_id: example-ref-1234 - amount: 15000 - currency: IDR - payment_method: - type: QR_CODE - reusability: ONE_TIME_USE - qr_code: - channel_code: “QRIS” - metadata: - sku: example-sku-1234 - Fixed amount single use Virtual Account: - value: - reference_id: example-ref-1234 - currency: IDR - amount: 15000 - country: ID - payment_method: - type: VIRTUAL_ACCOUNT - reusability: ONE_TIME_USE - reference_id: example-1234 - virtual_account: - channel_code: BNI - channel_properties: - customer_name: Ahmad Gunawan - expires_at: 2023-01-03T17:00:00Z - metadata: - sku: example-sku-1234 - Subsequent PH Direct Debit payments after account linking: - value: - reference_id: example-ref-1234 - amount: 1500 - currency: PHP - payment_method_id: pm-9685a196-81e9-4c73-8d62-97df5aab2762 - metadata: - sku: example-sku-1234 - Subsequent tokenized E-Wallet payments after account linking: - value: - reference_id: example-ref-1234 - amount: 15000 - currency: IDR - payment_method_id: pm-2b2c6092-2100-4843-a7fc-f5c7edac7efd - metadata: - sku: example-sku-1234 schema: $ref: '#/components/schemas/PaymentRequest' description: Request successful @@ -346,20 +346,6 @@ paths: schema: type: integer style: form - - explode: true - in: query - name: after_id - required: false - schema: - type: string - style: form - - explode: true - in: query - name: before_id - required: false - schema: - type: string - style: form responses: "200": content: diff --git a/invoice/model_bank_code.go b/invoice/model_bank_code.go index ff8fc7d0..952618d2 100644 --- a/invoice/model_bank_code.go +++ b/invoice/model_bank_code.go @@ -27,6 +27,9 @@ const ( BANKCODE_PERMATA BankCode = "PERMATA" BANKCODE_BSI BankCode = "BSI" BANKCODE_BJB BankCode = "BJB" + BANKCODE_SAHABAT_SAMPOERNA BankCode = "SAHABAT_SAMPOERNA" + BANKCODE_CIMB BankCode = "CIMB" + BANKCODE_BNC BankCode = "BNC" ) // All allowed values of BankCode enum @@ -38,6 +41,9 @@ var AllowedBankCodeEnumValues = []BankCode{ "PERMATA", "BSI", "BJB", + "SAHABAT_SAMPOERNA", + "CIMB", + "BNC", } func (v *BankCode) UnmarshalJSON(src []byte) error { diff --git a/invoice/model_direct_debit_type.go b/invoice/model_direct_debit_type.go index 85664269..acf4d724 100644 --- a/invoice/model_direct_debit_type.go +++ b/invoice/model_direct_debit_type.go @@ -34,6 +34,11 @@ const ( DIRECTDEBITTYPE_BA_BCA_KLIKPAY DirectDebitType = "BA_BCA_KLIKPAY" DIRECTDEBITTYPE_DC_BCA_KLIKPAY DirectDebitType = "DC_BCA_KLIKPAY" DIRECTDEBITTYPE_DD_BCA_KLIKPAY DirectDebitType = "DD_BCA_KLIKPAY" + DIRECTDEBITTYPE_DD_BDO_EPAY DirectDebitType = "DD_BDO_EPAY" + DIRECTDEBITTYPE_DD_RCBC DirectDebitType = "DD_RCBC" + DIRECTDEBITTYPE_DD_CHINABANK DirectDebitType = "DD_CHINABANK" + DIRECTDEBITTYPE_BA_CHINABANK DirectDebitType = "BA_CHINABANK" + DIRECTDEBITTYPE_DC_CHINABANK DirectDebitType = "DC_CHINABANK" ) // All allowed values of DirectDebitType enum @@ -52,6 +57,11 @@ var AllowedDirectDebitTypeEnumValues = []DirectDebitType{ "BA_BCA_KLIKPAY", "DC_BCA_KLIKPAY", "DD_BCA_KLIKPAY", + "DD_BDO_EPAY", + "DD_RCBC", + "DD_CHINABANK", + "BA_CHINABANK", + "DC_CHINABANK", } func (v *DirectDebitType) UnmarshalJSON(src []byte) error { diff --git a/invoice/model_ewallet_type.go b/invoice/model_ewallet_type.go index 7597730a..1aa58cb6 100644 --- a/invoice/model_ewallet_type.go +++ b/invoice/model_ewallet_type.go @@ -27,6 +27,9 @@ const ( EWALLETTYPE_SHOPEEPAY EwalletType = "SHOPEEPAY" EWALLETTYPE_GCASH EwalletType = "GCASH" EWALLETTYPE_GRABPAY EwalletType = "GRABPAY" + EWALLETTYPE_ASTRAPAY EwalletType = "ASTRAPAY" + EWALLETTYPE_NEXCASH EwalletType = "NEXCASH" + EWALLETTYPE_JENIUSPAY EwalletType = "JENIUSPAY" ) // All allowed values of EwalletType enum @@ -38,6 +41,9 @@ var AllowedEwalletTypeEnumValues = []EwalletType{ "SHOPEEPAY", "GCASH", "GRABPAY", + "ASTRAPAY", + "NEXCASH", + "JENIUSPAY", } func (v *EwalletType) UnmarshalJSON(src []byte) error { diff --git a/invoice/model_invoice_currency.go b/invoice/model_invoice_currency.go index 83ad9abf..fbbbeca0 100644 --- a/invoice/model_invoice_currency.go +++ b/invoice/model_invoice_currency.go @@ -22,6 +22,8 @@ type InvoiceCurrency string const ( INVOICECURRENCY_IDR InvoiceCurrency = "IDR" INVOICECURRENCY_USD InvoiceCurrency = "USD" + INVOICECURRENCY_THB InvoiceCurrency = "THB" + INVOICECURRENCY_VND InvoiceCurrency = "VND" INVOICECURRENCY_PHP InvoiceCurrency = "PHP" ) @@ -29,6 +31,8 @@ const ( var AllowedInvoiceCurrencyEnumValues = []InvoiceCurrency{ "IDR", "USD", + "THB", + "VND", "PHP", } diff --git a/payment_request/api_payment_request.go b/payment_request/api_payment_request.go index b847e433..9a442c13 100644 --- a/payment_request/api_payment_request.go +++ b/payment_request/api_payment_request.go @@ -682,8 +682,6 @@ type ApiGetPaymentRequestCapturesRequest struct { ApiService PaymentRequestApi paymentRequestId string limit *int32 - afterId *string - beforeId *string } func (r ApiGetPaymentRequestCapturesRequest) Limit(limit int32) ApiGetPaymentRequestCapturesRequest { @@ -691,16 +689,6 @@ func (r ApiGetPaymentRequestCapturesRequest) Limit(limit int32) ApiGetPaymentReq return r } -func (r ApiGetPaymentRequestCapturesRequest) AfterId(afterId string) ApiGetPaymentRequestCapturesRequest { - r.afterId = &afterId - return r -} - -func (r ApiGetPaymentRequestCapturesRequest) BeforeId(beforeId string) ApiGetPaymentRequestCapturesRequest { - r.beforeId = &beforeId - return r -} - func (r ApiGetPaymentRequestCapturesRequest) Execute() (*CaptureListResponse, *http.Response, *common.XenditSdkError) { return r.ApiService.GetPaymentRequestCapturesExecute(r) } @@ -747,12 +735,6 @@ func (a *PaymentRequestApiService) GetPaymentRequestCapturesExecute(r ApiGetPaym if r.limit != nil { utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } - if r.afterId != nil { - utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "after_id", r.afterId, "") - } - if r.beforeId != nil { - utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "before_id", r.beforeId, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{}