From 98f2b9518f6b9a0255a5b82f530ca39013969435 Mon Sep 17 00:00:00 2001 From: xendit-devx-bot Date: Fri, 15 Sep 2023 10:06:29 +0000 Subject: [PATCH] Generated Xendit node SDK --- README.md | 8 +-- docs/Balance.md | 42 ++++++++++++ docs/Invoice.md | 9 ++- docs/PaymentMethod.md | 5 +- docs/PaymentRequest.md | 5 +- docs/Payout.md | 5 +- docs/Refund.md | 5 +- ...alanceAndTransaction.md => Transaction.md} | 48 +------------ docs/invoice/models/AlternativeDisplayItem.md | 12 ++++ docs/invoice/models/Bank.md | 1 + docs/invoice/models/CreateInvoiceRequest.md | 1 - docs/invoice/models/Invoice.md | 2 - docs/invoice/models/InvoiceClientType.md | 2 - docs/invoice/models/InvoiceStatus.md | 4 -- .../models/EWalletChannelCode.md | 8 +++ .../models/VirtualAccountChannelCode.md | 2 + .../models/VirtualAccountChannelCode.md | 2 + docs/payout/models/ChannelCategory.md | 2 + index.ts | 32 ++++----- invoice/apis/Invoice.ts | 33 +++------ invoice/models/AlternativeDisplayItem.ts | 67 +++++++++++++++++++ invoice/models/Bank.ts | 14 ++++ invoice/models/CreateInvoiceRequest.ts | 8 --- invoice/models/Invoice.ts | 24 ------- invoice/models/InvoiceClientType.ts | 3 +- invoice/models/InvoiceStatus.ts | 4 +- invoice/models/index.ts | 1 + package.json | 8 +-- payment_method/models/EWalletChannelCode.ts | 6 +- .../models/VirtualAccountChannelCode.ts | 3 +- .../models/VirtualAccountChannelCode.ts | 3 +- payout/models/ChannelCategory.ts | 3 +- runtime.ts | 2 +- 33 files changed, 211 insertions(+), 163 deletions(-) create mode 100644 docs/Balance.md rename docs/{BalanceAndTransaction.md => Transaction.md} (65%) create mode 100644 docs/invoice/models/AlternativeDisplayItem.md create mode 100644 invoice/models/AlternativeDisplayItem.ts diff --git a/README.md b/README.md index 8d79f2d..45d69eb 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The official Xendit Node SDK provides a simple and convenient way to call Xendit's REST API in applications written in Node. -* Package version: 3.0.0-beta.1 +* Package version: 3.0.0-beta.2 # Getting Started @@ -49,12 +49,12 @@ const xenditClient = new Xendit({ # Documentation Find detailed API information and examples for each of our product’s by clicking the links below, -* [PaymentRequest](docs/PaymentRequest.md) -* [Payout](docs/Payout.md) * [BalanceAndTransaction](docs/BalanceAndTransaction.md) -* [Invoice](docs/Invoice.md) +* [PaymentRequest](docs/PaymentRequest.md) * [PaymentMethod](docs/PaymentMethod.md) * [Refund](docs/Refund.md) +* [Invoice](docs/Invoice.md) +* [Payout](docs/Payout.md) Further Reading diff --git a/docs/Balance.md b/docs/Balance.md new file mode 100644 index 0000000..21d5ffa --- /dev/null +++ b/docs/Balance.md @@ -0,0 +1,42 @@ +## Balance +You can use the APIs below to interface with Xendit's `Balance` API. +To start using the API, you need to destruct instantiated Xendit client or directly import the module and set the secret key. + +```typescript +import { Xendit, Balance as BalanceClient } from 'xendit-node'; + +const xenditClient = new Xendit({secretKey: YOUR_SECRET_KEY}) +const { Balance } = xenditClient + +const xenditBalanceClient = new BalanceClient({secretKey: YOUR_SECRET_KEY}) + +// At this point, `Balance` and `xenditBalanceClient` will have no usage difference, for example: +// Balance. +// or +// xenditBalanceClient. +``` +## Retrieves balances for a business, default to CASH type + + +### Function Signature +| Name | Value | +|--------------------|:-------------:| +| Function Name | `getBalance` | +| Request Parameters | [GetBalanceRequest](#request-parameters--GetBalanceRequest) | +| Return Type | [Balance](balance_and_transaction/models/Balance.md) | + +### Request Parameters — `GetBalanceRequest` +| Field Name | Required | Type | +|-----------|:----------:|:----------:| +| accountType| | 'CASH' | 'HOLDING' | 'TAX' | +| currency| | string | +| forUserId| | string | +| idempotencyKey| | string | + +### Usage Examples +#### Minimum API Usage +```typescript +import { Balance } from 'xendit-node/balance_and_transaction/models' + +const response: Balance = await xenditBalanceClient.getBalance({ }) +``` diff --git a/docs/Invoice.md b/docs/Invoice.md index 8db8334..5b44a27 100644 --- a/docs/Invoice.md +++ b/docs/Invoice.md @@ -11,11 +11,10 @@ const { Invoice } = xenditClient const xenditInvoiceClient = new InvoiceClient({secretKey: YOUR_SECRET_KEY}) // At this point, `Invoice` and `xenditInvoiceClient` will have no usage difference, for example: -// Invoice.createInvoice() +// Invoice. // or -// xenditInvoiceClient.createInvoice() +// xenditInvoiceClient. ``` - ## Create an invoice @@ -114,7 +113,7 @@ const response: Invoice = await xenditInvoiceClient.getInvoiceById({ | Field Name | Required | Type | |-----------|:----------:|:----------:| | externalId| | string | -| statuses| | []string | +| statuses| | [[]InvoiceStatus](invoice/models/InvoiceStatus.md) | | limit| | number | | createdAfter| | Date | | createdBefore| | Date | @@ -123,7 +122,7 @@ const response: Invoice = await xenditInvoiceClient.getInvoiceById({ | expiredAfter| | Date | | expiredBefore| | Date | | lastInvoice| | string | -| clientTypes| | []string | +| clientTypes| | [[]InvoiceClientType](invoice/models/InvoiceClientType.md) | | paymentChannels| | []string | | onDemandLink| | string | | recurringPaymentId| | string | diff --git a/docs/PaymentMethod.md b/docs/PaymentMethod.md index b393360..c6b834f 100644 --- a/docs/PaymentMethod.md +++ b/docs/PaymentMethod.md @@ -11,11 +11,10 @@ const { PaymentMethod } = xenditClient const xenditPaymentMethodClient = new PaymentMethodClient({secretKey: YOUR_SECRET_KEY}) // At this point, `PaymentMethod` and `xenditPaymentMethodClient` will have no usage difference, for example: -// PaymentMethod.authPaymentMethod() +// PaymentMethod. // or -// xenditPaymentMethodClient.authPaymentMethod() +// xenditPaymentMethodClient. ``` - ## Validate a payment method\'s linking OTP diff --git a/docs/PaymentRequest.md b/docs/PaymentRequest.md index f7767b7..97ab37e 100644 --- a/docs/PaymentRequest.md +++ b/docs/PaymentRequest.md @@ -11,11 +11,10 @@ const { PaymentRequest } = xenditClient const xenditPaymentRequestClient = new PaymentRequestClient({secretKey: YOUR_SECRET_KEY}) // At this point, `PaymentRequest` and `xenditPaymentRequestClient` will have no usage difference, for example: -// PaymentRequest.authorizePaymentRequest() +// PaymentRequest. // or -// xenditPaymentRequestClient.authorizePaymentRequest() +// xenditPaymentRequestClient. ``` - ## Payment Request Authorize diff --git a/docs/Payout.md b/docs/Payout.md index 3801a9e..6f8ff37 100644 --- a/docs/Payout.md +++ b/docs/Payout.md @@ -11,11 +11,10 @@ const { Payout } = xenditClient const xenditPayoutClient = new PayoutClient({secretKey: YOUR_SECRET_KEY}) // At this point, `Payout` and `xenditPayoutClient` will have no usage difference, for example: -// Payout.cancelPayout() +// Payout. // or -// xenditPayoutClient.cancelPayout() +// xenditPayoutClient. ``` - ## API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. diff --git a/docs/Refund.md b/docs/Refund.md index 86875b8..9cde870 100644 --- a/docs/Refund.md +++ b/docs/Refund.md @@ -11,11 +11,10 @@ const { Refund } = xenditClient const xenditRefundClient = new RefundClient({secretKey: YOUR_SECRET_KEY}) // At this point, `Refund` and `xenditRefundClient` will have no usage difference, for example: -// Refund.cancelRefund() +// Refund. // or -// xenditRefundClient.cancelRefund() +// xenditRefundClient. ``` - ## diff --git a/docs/BalanceAndTransaction.md b/docs/Transaction.md similarity index 65% rename from docs/BalanceAndTransaction.md rename to docs/Transaction.md index 81a0ae9..5d7528b 100644 --- a/docs/BalanceAndTransaction.md +++ b/docs/Transaction.md @@ -1,46 +1,3 @@ -## Balance -You can use the APIs below to interface with Xendit's `Balance` API. -To start using the API, you need to destruct instantiated Xendit client or directly import the module and set the secret key. - -```typescript -import { Xendit, Balance as BalanceClient } from 'xendit-node'; - -const xenditClient = new Xendit({secretKey: YOUR_SECRET_KEY}) -const { Balance } = xenditClient - -const xenditBalanceClient = new BalanceClient({secretKey: YOUR_SECRET_KEY}) - -// At this point, `Balance` and `xenditBalanceClient` will have no usage difference, for example: -// Balance.getBalance() -// or -// xenditBalanceClient.getBalance() -``` - -## Retrieves balances for a business, default to CASH type - - -### Function Signature -| Name | Value | -|--------------------|:-------------:| -| Function Name | `getBalance` | -| Request Parameters | [GetBalanceRequest](#request-parameters--GetBalanceRequest) | -| Return Type | [Balance](balance_and_transaction/models/Balance.md) | - -### Request Parameters — `GetBalanceRequest` -| Field Name | Required | Type | -|-----------|:----------:|:----------:| -| accountType| | 'CASH' | 'HOLDING' | 'TAX' | -| currency| | string | -| forUserId| | string | -| idempotencyKey| | string | - -### Usage Examples -#### Minimum API Usage -```typescript -import { Balance } from 'xendit-node/balance_and_transaction/models' - -const response: Balance = await xenditBalanceClient.getBalance({ }) -``` ## Transaction You can use the APIs below to interface with Xendit's `Transaction` API. To start using the API, you need to destruct instantiated Xendit client or directly import the module and set the secret key. @@ -54,11 +11,10 @@ const { Transaction } = xenditClient const xenditTransactionClient = new TransactionClient({secretKey: YOUR_SECRET_KEY}) // At this point, `Transaction` and `xenditTransactionClient` will have no usage difference, for example: -// Transaction.getAllTransactions() +// Transaction. // or -// xenditTransactionClient.getAllTransactions() +// xenditTransactionClient. ``` - ## Get a list of transactions diff --git a/docs/invoice/models/AlternativeDisplayItem.md b/docs/invoice/models/AlternativeDisplayItem.md new file mode 100644 index 0000000..5a30d2e --- /dev/null +++ b/docs/invoice/models/AlternativeDisplayItem.md @@ -0,0 +1,12 @@ +# AlternativeDisplayItem + +An object representing alternative display of a VA. + +## Properties + +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +| **type** | string | | Represent type of alternative display. | +**value** | string | | Represent value of alternative display value. | + + diff --git a/docs/invoice/models/Bank.md b/docs/invoice/models/Bank.md index b039f0a..4e90025 100644 --- a/docs/invoice/models/Bank.md +++ b/docs/invoice/models/Bank.md @@ -12,5 +12,6 @@ An object representing bank details for invoices. **bankAccountNumber** | string | | The bank account number. | **accountHolderName** | string | ✅ | The name of the account holder. | **transferAmount** | number | | The transfer amount. | +**alternativeDisplays** | [[]AlternativeDisplayItem](AlternativeDisplayItem.md) | | | diff --git a/docs/invoice/models/CreateInvoiceRequest.md b/docs/invoice/models/CreateInvoiceRequest.md index b853f1e..2c2b244 100644 --- a/docs/invoice/models/CreateInvoiceRequest.md +++ b/docs/invoice/models/CreateInvoiceRequest.md @@ -10,7 +10,6 @@ An object representing for an invoice creation request. **amount** | number | ✅ | The invoice amount. | **payerEmail** | string | | The email address of the payer. | **description** | string | | A description of the payment. | -**clientType** | string | | The client type (internal use). | **invoiceDuration** | string | | The duration of the invoice. | **callbackVirtualAccountId** | string | | The ID of the callback virtual account. | **shouldSendEmail** | boolean | | Indicates whether email notifications should be sent. | diff --git a/docs/invoice/models/Invoice.md b/docs/invoice/models/Invoice.md index 73e7437..9da0744 100644 --- a/docs/invoice/models/Invoice.md +++ b/docs/invoice/models/Invoice.md @@ -9,7 +9,6 @@ An object representing details for an invoice. | **id** | string | | The unique identifier for the invoice. | **externalId** | string | ✅ | The external identifier for the invoice. | **userId** | string | ✅ | The user ID associated with the invoice. | -**isHigh** | boolean | ✅ | Indicates if it\'s a high-value invoice. | **payerEmail** | string | | The email address of the payer. | **description** | string | | A description of the invoice. | **paymentMethod** | [InvoicePaymentMethod](InvoicePaymentMethod.md) | | | @@ -28,7 +27,6 @@ An object representing details for an invoice. **availablePaylaters** | [[]Paylater](Paylater.md) | ✅ | An array of available pay-later options for payment. | **shouldExcludeCreditCard** | boolean | | Indicates whether credit card payments should be excluded. | **shouldSendEmail** | boolean | ✅ | Indicates whether email notifications should be sent. | -**clientType** | [InvoiceClientType](InvoiceClientType.md) | ✅ | | **created** | Date | ✅ | Representing a date and time in ISO 8601 format. | **updated** | Date | ✅ | Representing a date and time in ISO 8601 format. | **successRedirectUrl** | string | | The URL to redirect to on successful payment. | diff --git a/docs/invoice/models/InvoiceClientType.md b/docs/invoice/models/InvoiceClientType.md index d71e03c..efffcf2 100644 --- a/docs/invoice/models/InvoiceClientType.md +++ b/docs/invoice/models/InvoiceClientType.md @@ -18,6 +18,4 @@ Representing the client type or source of an invoice. * `Mobile` (value: `'MOBILE'`) - * `Storefront` (value: `'STOREFRONT'`) - diff --git a/docs/invoice/models/InvoiceStatus.md b/docs/invoice/models/InvoiceStatus.md index 969d736..79dd27b 100644 --- a/docs/invoice/models/InvoiceStatus.md +++ b/docs/invoice/models/InvoiceStatus.md @@ -8,14 +8,10 @@ Representing the status of an invoice. * `Pending` (value: `'PENDING'`) - * `Completing` (value: `'COMPLETING'`) - * `Paid` (value: `'PAID'`) * `Settled` (value: `'SETTLED'`) * `Expired` (value: `'EXPIRED'`) - * `Reminder` (value: `'REMINDER'`) - diff --git a/docs/payment_method/models/EWalletChannelCode.md b/docs/payment_method/models/EWalletChannelCode.md index 366bfae..ad5a207 100644 --- a/docs/payment_method/models/EWalletChannelCode.md +++ b/docs/payment_method/models/EWalletChannelCode.md @@ -38,4 +38,12 @@ EWallet Channel Code * `Zalopay` (value: `'ZALOPAY'`) + * `Wechatpay` (value: `'WECHATPAY'`) + + * `Linepay` (value: `'LINEPAY'`) + + * `Truemoney` (value: `'TRUEMONEY'`) + + * `Alipay` (value: `'ALIPAY'`) + diff --git a/docs/payment_method/models/VirtualAccountChannelCode.md b/docs/payment_method/models/VirtualAccountChannelCode.md index 5db01b4..119dc20 100644 --- a/docs/payment_method/models/VirtualAccountChannelCode.md +++ b/docs/payment_method/models/VirtualAccountChannelCode.md @@ -34,4 +34,6 @@ Virtual Account Channel Code * `Msb` (value: `'MSB'`) + * `StandardChartered` (value: `'STANDARD_CHARTERED'`) + diff --git a/docs/payment_request/models/VirtualAccountChannelCode.md b/docs/payment_request/models/VirtualAccountChannelCode.md index 5db01b4..119dc20 100644 --- a/docs/payment_request/models/VirtualAccountChannelCode.md +++ b/docs/payment_request/models/VirtualAccountChannelCode.md @@ -34,4 +34,6 @@ Virtual Account Channel Code * `Msb` (value: `'MSB'`) + * `StandardChartered` (value: `'STANDARD_CHARTERED'`) + diff --git a/docs/payout/models/ChannelCategory.md b/docs/payout/models/ChannelCategory.md index 21514c3..f0f4ec1 100644 --- a/docs/payout/models/ChannelCategory.md +++ b/docs/payout/models/ChannelCategory.md @@ -10,4 +10,6 @@ Category of channel code, as some channels might require more fields during proc * `Ewallet` (value: `'EWALLET'`) + * `Otc` (value: `'OTC'`) + diff --git a/index.ts b/index.ts index 58df92e..22712f4 100644 --- a/index.ts +++ b/index.ts @@ -2,17 +2,11 @@ /* eslint-disable */ export * from './runtime'; -import { PaymentRequest } from './payment_request'; -export { PaymentRequest } from './payment_request'; - -import { Payout } from './payout'; -export { Payout } from './payout'; - import { Transaction, Balance } from './balance_and_transaction'; export { Transaction, Balance } from './balance_and_transaction'; -import { Invoice } from './invoice'; -export { Invoice } from './invoice'; +import { PaymentRequest } from './payment_request'; +export { PaymentRequest } from './payment_request'; import { PaymentMethod } from './payment_method'; export { PaymentMethod } from './payment_method'; @@ -20,6 +14,12 @@ export { PaymentMethod } from './payment_method'; import { Refund } from './refund'; export { Refund } from './refund'; +import { Invoice } from './invoice'; +export { Invoice } from './invoice'; + +import { Payout } from './payout'; +export { Payout } from './payout'; + export interface XenditOpts { secretKey: string; @@ -27,13 +27,13 @@ export interface XenditOpts { } export class Xendit { opts: XenditOpts; - PaymentRequest: PaymentRequest; - Payout: Payout; Transaction: Transaction; Balance: Balance; - Invoice: Invoice; + PaymentRequest: PaymentRequest; PaymentMethod: PaymentMethod; Refund: Refund; + Invoice: Invoice; + Payout: Payout; constructor({ secretKey: _secretKey, xenditURL: _xenditURL }: XenditOpts) { @@ -54,19 +54,19 @@ export class Xendit { } - this.PaymentRequest = new PaymentRequest(this.opts); - - this.Payout = new Payout(this.opts); - this.Transaction = new Transaction(this.opts); this.Balance = new Balance(this.opts); - this.Invoice = new Invoice(this.opts); + this.PaymentRequest = new PaymentRequest(this.opts); this.PaymentMethod = new PaymentMethod(this.opts); this.Refund = new Refund(this.opts); + this.Invoice = new Invoice(this.opts); + + this.Payout = new Payout(this.opts); + } } diff --git a/invoice/apis/Invoice.ts b/invoice/apis/Invoice.ts index 3f91ed1..e106734 100644 --- a/invoice/apis/Invoice.ts +++ b/invoice/apis/Invoice.ts @@ -13,8 +13,10 @@ import type { CreateInvoiceRequest, ForbiddenError, Invoice, + InvoiceClientType, InvoiceError404ResponseDefinition, InvoiceNotFoundError, + InvoiceStatus, ServerError, UnauthorizedError, } from '../models'; @@ -27,10 +29,14 @@ import { ForbiddenErrorToJSON, InvoiceFromJSON, InvoiceToJSON, + InvoiceClientTypeFromJSON, + InvoiceClientTypeToJSON, InvoiceError404ResponseDefinitionFromJSON, InvoiceError404ResponseDefinitionToJSON, InvoiceNotFoundErrorFromJSON, InvoiceNotFoundErrorToJSON, + InvoiceStatusFromJSON, + InvoiceStatusToJSON, ServerErrorFromJSON, ServerErrorToJSON, UnauthorizedErrorFromJSON, @@ -53,7 +59,7 @@ export interface GetInvoiceByIdRequest { export interface GetInvoicesRequest { externalId?: string; - statuses?: Array; + statuses?: Array; limit?: number; createdAfter?: Date; createdBefore?: Date; @@ -62,7 +68,7 @@ export interface GetInvoicesRequest { expiredAfter?: Date; expiredBefore?: Date; lastInvoice?: string; - clientTypes?: Array; + clientTypes?: Array; paymentChannels?: Array; onDemandLink?: string; recurringPaymentId?: string; @@ -277,26 +283,3 @@ export class InvoiceApi extends runtime.BaseAPI { } } - -/** - * @export - */ -export const GetInvoicesStatusesEnum = { - Pending: 'PENDING', - Paid: 'PAID', - Settled: 'SETTLED', - Expired: 'EXPIRED' -} as const; -export type GetInvoicesStatusesEnum = typeof GetInvoicesStatusesEnum[keyof typeof GetInvoicesStatusesEnum]; -/** - * @export - */ -export const GetInvoicesClientTypesEnum = { - ApiGateway: 'API_GATEWAY', - Dashboard: 'DASHBOARD', - Integration: 'INTEGRATION', - OnDemand: 'ON_DEMAND', - Recurring: 'RECURRING', - Mobile: 'MOBILE' -} as const; -export type GetInvoicesClientTypesEnum = typeof GetInvoicesClientTypesEnum[keyof typeof GetInvoicesClientTypesEnum]; diff --git a/invoice/models/AlternativeDisplayItem.ts b/invoice/models/AlternativeDisplayItem.ts new file mode 100644 index 0000000..48507d9 --- /dev/null +++ b/invoice/models/AlternativeDisplayItem.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * NOTE: This file is auto generated by Xendit. + * Do not edit the class manually. + * Improvements? Share your ideas at https://github.com/xendit/xendit-node + */ + +import { exists, mapValues } from '../../runtime'; +/** + * An object representing alternative display of a VA. + * @export + * @interface AlternativeDisplayItem + */ +export interface AlternativeDisplayItem { + /** + * Represent type of alternative display. + * @type {string} + * @memberof AlternativeDisplayItem + */ + type?: string; + /** + * Represent value of alternative display value. + * @type {string} + * @memberof AlternativeDisplayItem + */ + value?: string; +} + +/** + * Check if a given object implements the AlternativeDisplayItem interface. + */ +export function instanceOfAlternativeDisplayItem(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function AlternativeDisplayItemFromJSON(json: any): AlternativeDisplayItem { + return AlternativeDisplayItemFromJSONTyped(json, false); +} + +export function AlternativeDisplayItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlternativeDisplayItem { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'type': !exists(json, 'type') ? undefined : json['type'], + 'value': !exists(json, 'value') ? undefined : json['value'], + }; +} + +export function AlternativeDisplayItemToJSON(value?: AlternativeDisplayItem | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'type': value.type, + 'value': value.value, + }; +} + diff --git a/invoice/models/Bank.ts b/invoice/models/Bank.ts index 5fe4ce6..77d6a96 100644 --- a/invoice/models/Bank.ts +++ b/invoice/models/Bank.ts @@ -7,6 +7,12 @@ */ import { exists, mapValues } from '../../runtime'; +import type { AlternativeDisplayItem } from './AlternativeDisplayItem'; +import { + AlternativeDisplayItemFromJSON, + AlternativeDisplayItemFromJSONTyped, + AlternativeDisplayItemToJSON, +} from './AlternativeDisplayItem'; import type { BankCode } from './BankCode'; import { BankCodeFromJSON, @@ -56,6 +62,12 @@ export interface Bank { * @memberof Bank */ transferAmount?: number; + /** + * + * @type {Array} + * @memberof Bank + */ + alternativeDisplays?: Array; } /** @@ -86,6 +98,7 @@ export function BankFromJSONTyped(json: any, ignoreDiscriminator: boolean): Bank 'bankAccountNumber': !exists(json, 'bank_account_number') ? undefined : json['bank_account_number'], 'accountHolderName': json['account_holder_name'], 'transferAmount': !exists(json, 'transfer_amount') ? undefined : json['transfer_amount'], + 'alternativeDisplays': !exists(json, 'alternative_displays') ? undefined : ((json['alternative_displays'] as Array).map(AlternativeDisplayItemFromJSON)), }; } @@ -104,6 +117,7 @@ export function BankToJSON(value?: Bank | null): any { 'bank_account_number': value.bankAccountNumber, 'account_holder_name': value.accountHolderName, 'transfer_amount': value.transferAmount, + 'alternative_displays': value.alternativeDisplays === undefined ? undefined : ((value.alternativeDisplays as Array).map(AlternativeDisplayItemToJSON)), }; } diff --git a/invoice/models/CreateInvoiceRequest.ts b/invoice/models/CreateInvoiceRequest.ts index 2801c5a..a013c2c 100644 --- a/invoice/models/CreateInvoiceRequest.ts +++ b/invoice/models/CreateInvoiceRequest.ts @@ -62,12 +62,6 @@ export interface CreateInvoiceRequest { * @memberof CreateInvoiceRequest */ description?: string; - /** - * The client type (internal use). - * @type {string} - * @memberof CreateInvoiceRequest - */ - clientType?: string; /** * The duration of the invoice. * @type {string} @@ -191,7 +185,6 @@ export function CreateInvoiceRequestFromJSONTyped(json: any, ignoreDiscriminator 'amount': json['amount'], 'payerEmail': !exists(json, 'payer_email') ? undefined : json['payer_email'], 'description': !exists(json, 'description') ? undefined : json['description'], - 'clientType': !exists(json, 'client_type') ? undefined : json['client_type'], 'invoiceDuration': !exists(json, 'invoice_duration') ? undefined : json['invoice_duration'], 'callbackVirtualAccountId': !exists(json, 'callback_virtual_account_id') ? undefined : json['callback_virtual_account_id'], 'shouldSendEmail': !exists(json, 'should_send_email') ? undefined : json['should_send_email'], @@ -224,7 +217,6 @@ export function CreateInvoiceRequestToJSON(value?: CreateInvoiceRequest | null): 'amount': value.amount, 'payer_email': value.payerEmail, 'description': value.description, - 'client_type': value.clientType, 'invoice_duration': value.invoiceDuration, 'callback_virtual_account_id': value.callbackVirtualAccountId, 'should_send_email': value.shouldSendEmail, diff --git a/invoice/models/Invoice.ts b/invoice/models/Invoice.ts index 19896ca..f08a1a3 100644 --- a/invoice/models/Invoice.ts +++ b/invoice/models/Invoice.ts @@ -31,12 +31,6 @@ import { EwalletFromJSONTyped, EwalletToJSON, } from './Ewallet'; -import type { InvoiceClientType } from './InvoiceClientType'; -import { - InvoiceClientTypeFromJSON, - InvoiceClientTypeFromJSONTyped, - InvoiceClientTypeToJSON, -} from './InvoiceClientType'; import type { InvoiceCurrency } from './InvoiceCurrency'; import { InvoiceCurrencyFromJSON, @@ -116,12 +110,6 @@ export interface Invoice { * @memberof Invoice */ userId: string; - /** - * Indicates if it's a high-value invoice. - * @type {boolean} - * @memberof Invoice - */ - isHigh: boolean; /** * The email address of the payer. * @type {string} @@ -230,12 +218,6 @@ export interface Invoice { * @memberof Invoice */ shouldSendEmail: boolean; - /** - * - * @type {InvoiceClientType} - * @memberof Invoice - */ - clientType: InvoiceClientType; /** * Representing a date and time in ISO 8601 format. * @type {Date} @@ -317,7 +299,6 @@ export function instanceOfInvoice(value: object): boolean { let isInstance = true; isInstance = isInstance && "externalId" in value; isInstance = isInstance && "userId" in value; - isInstance = isInstance && "isHigh" in value; isInstance = isInstance && "status" in value; isInstance = isInstance && "merchantName" in value; isInstance = isInstance && "merchantProfilePictureUrl" in value; @@ -331,7 +312,6 @@ export function instanceOfInvoice(value: object): boolean { isInstance = isInstance && "availableDirectDebits" in value; isInstance = isInstance && "availablePaylaters" in value; isInstance = isInstance && "shouldSendEmail" in value; - isInstance = isInstance && "clientType" in value; isInstance = isInstance && "created" in value; isInstance = isInstance && "updated" in value; @@ -351,7 +331,6 @@ export function InvoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): I 'id': !exists(json, 'id') ? undefined : json['id'], 'externalId': json['external_id'], 'userId': json['user_id'], - 'isHigh': json['is_high'], 'payerEmail': !exists(json, 'payer_email') ? undefined : json['payer_email'], 'description': !exists(json, 'description') ? undefined : json['description'], 'paymentMethod': !exists(json, 'payment_method') ? undefined : InvoicePaymentMethodFromJSON(json['payment_method']), @@ -370,7 +349,6 @@ export function InvoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): I 'availablePaylaters': ((json['available_paylaters'] as Array).map(PaylaterFromJSON)), 'shouldExcludeCreditCard': !exists(json, 'should_exclude_credit_card') ? undefined : json['should_exclude_credit_card'], 'shouldSendEmail': json['should_send_email'], - 'clientType': InvoiceClientTypeFromJSON(json['client_type']), 'created': (new Date(json['created'])), 'updated': (new Date(json['updated'])), 'successRedirectUrl': !exists(json, 'success_redirect_url') ? undefined : json['success_redirect_url'], @@ -398,7 +376,6 @@ export function InvoiceToJSON(value?: Invoice | null): any { 'id': value.id, 'external_id': value.externalId, 'user_id': value.userId, - 'is_high': value.isHigh, 'payer_email': value.payerEmail, 'description': value.description, 'payment_method': InvoicePaymentMethodToJSON(value.paymentMethod), @@ -417,7 +394,6 @@ export function InvoiceToJSON(value?: Invoice | null): any { 'available_paylaters': ((value.availablePaylaters as Array).map(PaylaterToJSON)), 'should_exclude_credit_card': value.shouldExcludeCreditCard, 'should_send_email': value.shouldSendEmail, - 'client_type': InvoiceClientTypeToJSON(value.clientType), 'created': (value.created.toISOString()), 'updated': (value.updated.toISOString()), 'success_redirect_url': value.successRedirectUrl, diff --git a/invoice/models/InvoiceClientType.ts b/invoice/models/InvoiceClientType.ts index 8fe1c48..ce4848b 100644 --- a/invoice/models/InvoiceClientType.ts +++ b/invoice/models/InvoiceClientType.ts @@ -17,8 +17,7 @@ export const InvoiceClientType = { Integration: 'INTEGRATION', OnDemand: 'ON_DEMAND', Recurring: 'RECURRING', - Mobile: 'MOBILE', - Storefront: 'STOREFRONT' + Mobile: 'MOBILE' } as const; export type InvoiceClientType = typeof InvoiceClientType[keyof typeof InvoiceClientType]; diff --git a/invoice/models/InvoiceStatus.ts b/invoice/models/InvoiceStatus.ts index e6dcb70..e6bc5af 100644 --- a/invoice/models/InvoiceStatus.ts +++ b/invoice/models/InvoiceStatus.ts @@ -13,11 +13,9 @@ */ export const InvoiceStatus = { Pending: 'PENDING', - Completing: 'COMPLETING', Paid: 'PAID', Settled: 'SETTLED', - Expired: 'EXPIRED', - Reminder: 'REMINDER' + Expired: 'EXPIRED' } as const; export type InvoiceStatus = typeof InvoiceStatus[keyof typeof InvoiceStatus]; diff --git a/invoice/models/index.ts b/invoice/models/index.ts index ff1c74b..a4c4af0 100644 --- a/invoice/models/index.ts +++ b/invoice/models/index.ts @@ -1,6 +1,7 @@ /* tslint:disable */ /* eslint-disable */ export * from './AddressObject'; +export * from './AlternativeDisplayItem'; export * from './BadRequestError'; export * from './Bank'; export * from './BankCode'; diff --git a/package.json b/package.json index 465f8c9..a7c1831 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xendit-node", - "version": "3.0.0-beta.1", + "version": "3.0.0-beta.2", "description": "OpenAPI client for xendit-node", "author": "OpenAPI-Generator", "repository": { @@ -8,12 +8,12 @@ "url": "https://github.com/xendit/xendit-node.git" }, "files": [ - "payment_request/**", - "payout/**", "balance_and_transaction/**", - "invoice/**", + "payment_request/**", "payment_method/**", "refund/**", + "invoice/**", + "payout/**", "docs/**", "images/**", "README.md", diff --git a/payment_method/models/EWalletChannelCode.ts b/payment_method/models/EWalletChannelCode.ts index 726619e..a070660 100644 --- a/payment_method/models/EWalletChannelCode.ts +++ b/payment_method/models/EWalletChannelCode.ts @@ -27,7 +27,11 @@ export const EWalletChannelCode = { Momo: 'MOMO', Vnptwallet: 'VNPTWALLET', Viettelpay: 'VIETTELPAY', - Zalopay: 'ZALOPAY' + Zalopay: 'ZALOPAY', + Wechatpay: 'WECHATPAY', + Linepay: 'LINEPAY', + Truemoney: 'TRUEMONEY', + Alipay: 'ALIPAY' } as const; export type EWalletChannelCode = typeof EWalletChannelCode[keyof typeof EWalletChannelCode]; diff --git a/payment_method/models/VirtualAccountChannelCode.ts b/payment_method/models/VirtualAccountChannelCode.ts index 39a81d9..7d77834 100644 --- a/payment_method/models/VirtualAccountChannelCode.ts +++ b/payment_method/models/VirtualAccountChannelCode.ts @@ -25,7 +25,8 @@ export const VirtualAccountChannelCode = { Pv: 'PV', Vietcapital: 'VIETCAPITAL', Woori: 'WOORI', - Msb: 'MSB' + Msb: 'MSB', + StandardChartered: 'STANDARD_CHARTERED' } as const; export type VirtualAccountChannelCode = typeof VirtualAccountChannelCode[keyof typeof VirtualAccountChannelCode]; diff --git a/payment_request/models/VirtualAccountChannelCode.ts b/payment_request/models/VirtualAccountChannelCode.ts index 39a81d9..7d77834 100644 --- a/payment_request/models/VirtualAccountChannelCode.ts +++ b/payment_request/models/VirtualAccountChannelCode.ts @@ -25,7 +25,8 @@ export const VirtualAccountChannelCode = { Pv: 'PV', Vietcapital: 'VIETCAPITAL', Woori: 'WOORI', - Msb: 'MSB' + Msb: 'MSB', + StandardChartered: 'STANDARD_CHARTERED' } as const; export type VirtualAccountChannelCode = typeof VirtualAccountChannelCode[keyof typeof VirtualAccountChannelCode]; diff --git a/payout/models/ChannelCategory.ts b/payout/models/ChannelCategory.ts index 9b83829..8259b1d 100644 --- a/payout/models/ChannelCategory.ts +++ b/payout/models/ChannelCategory.ts @@ -13,7 +13,8 @@ */ export const ChannelCategory = { Bank: 'BANK', - Ewallet: 'EWALLET' + Ewallet: 'EWALLET', + Otc: 'OTC' } as const; export type ChannelCategory = typeof ChannelCategory[keyof typeof ChannelCategory]; diff --git a/runtime.ts b/runtime.ts index bd8792c..541c92f 100644 --- a/runtime.ts +++ b/runtime.ts @@ -136,7 +136,7 @@ export class BaseAPI { const headers = Object.assign({}, this.configuration.headers, context.headers); Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); headers['xendit-lib'] = 'node'; - headers['xendit-lib-ver'] = '3.0.0-beta.1'; + headers['xendit-lib-ver'] = '3.0.0-beta.2'; const initParams = { method: context.method,