Skip to content

Commit

Permalink
Generated Xendit node SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
xendit-devx-bot committed Jan 30, 2025
1 parent 6dfd603 commit d7bd4c0
Show file tree
Hide file tree
Showing 21 changed files with 271 additions and 39 deletions.
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 Node SDK provides a simple and convenient way to call Xendit's REST API
in applications written in Node.

* Package version: 6.0.0
* Package version: 6.1.0

# Getting Started

Expand Down Expand Up @@ -53,8 +53,8 @@ Find detailed API information and examples for each of our product’s by clicki
* [PaymentRequest](docs/PaymentRequest.md)
* [PaymentMethod](docs/PaymentMethod.md)
* [Refund](docs/Refund.md)
* [Balance](docs/Balance.md)
* [Transaction](docs/Transaction.md)
* [Balance](docs/Balance.md)
* [Customer](docs/Customer.md)
* [Payout](docs/Payout.md)

Expand Down
14 changes: 14 additions & 0 deletions docs/invoice/BankCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ Representing the available bank channels used for invoice-related transactions.

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

* `Vietcapital` (value: `'VIETCAPITAL'`)

* `Woori` (value: `'WOORI'`)

* `Pv` (value: `'PV'`)

* `Msb` (value: `'MSB'`)

* `Vpb` (value: `'VPB'`)

* `Bidv` (value: `'BIDV'`)

* `Cake` (value: `'CAKE'`)

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

* `Hana` (value: `'HANA'`)
Expand Down
1 change: 1 addition & 0 deletions docs/invoice/ChannelPropertiesCards.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ An object representing properties specific for credit card payment method.
| Name | Type | Required | Description | Examples |
|------------|:-------------:|:-------------:|-------------|:-------------:|
| **allowedBins** |string[] | | An array of allowed BINs (6 or 8 digits) for credit card payments. | | |
| **installmentConfiguration** |[ChannelPropertiesCardsInstallmentConfiguration](ChannelPropertiesCardsInstallmentConfiguration.md) | | | | |



Expand Down
14 changes: 14 additions & 0 deletions docs/invoice/ChannelPropertiesCardsInstallmentConfiguration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ChannelPropertiesCardsInstallmentConfiguration

An object to pre-set cards installment for a specific invoice

## Properties

| Name | Type | Required | Description | Examples |
|------------|:-------------:|:-------------:|-------------|:-------------:|
| **allowFullPayment** |boolean | | Indicate whether full payment (without installment) is allowed | | |
| **allowedTerms** |[ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner[]](ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner.md) | | An object to set what kind (from specific bank / specific tenor) of cards installments will be available on a specific invoice | | |



[[Back to README]](../../README.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner



## Properties

| Name | Type | Required | Description | Examples |
|------------|:-------------:|:-------------:|-------------|:-------------:|
| **issuer** |string | | The bank code of the installment provider / issuer | | |
| **allowedTerms** |number[] | | An array containing list of installment tenor available to choose | | |



[[Back to README]](../../README.md)
3 changes: 2 additions & 1 deletion docs/invoice/CreateInvoiceRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ An object representing for an invoice creation request.
| **shouldAuthenticateCreditCard** |boolean | | Indicates whether credit card authentication is required. | | |
| **currency** |string | | The currency of the invoice. | | |
| **reminderTime** |number | | The reminder time. | | |
| **local** |string | | The local. | | |
| **locale** |string | | The default language to display. | | |
| **reminderTimeUnit** |string | | The unit of the reminder time. | | |
| **items** |[InvoiceItem[]](InvoiceItem.md) | | An array of items included in the invoice. | | |
| **fees** |[InvoiceFee[]](InvoiceFee.md) | | An array of fees associated with the invoice. | | |
| **channelProperties** |[ChannelProperties](ChannelProperties.md) | | | | |
| **metadata** |object | | A free-format JSON for additional information that you may use. Object can be up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. | | |



Expand Down
1 change: 1 addition & 0 deletions docs/invoice/Invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ An object representing details for an invoice.
| **customerNotificationPreference** |[NotificationPreference](NotificationPreference.md) | | | | |
| **fees** |[InvoiceFee[]](InvoiceFee.md) | | An array of fees associated with the invoice. | | |
| **channelProperties** |[ChannelProperties](ChannelProperties.md) | | | | |
| **metadata** |object | | A free-format JSON for additional information that you may use. Object can be up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. | | |



Expand Down
2 changes: 2 additions & 0 deletions docs/invoice/InvoiceCurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Representing the currency used for an invoice.

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

* `Myr` (value: `'MYR'`)

* `XenditEnumDefaultFallback` (value: `UNKNOWN_ENUM_VALUE`)

If you encounter `UNKNOWN_ENUM_VALUE`, it means that this ENUM is unavailable in your current SDK version. Please upgrade to get the newest ENUM.
Expand Down
2 changes: 2 additions & 0 deletions docs/invoice/QrCodeType.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Representing the available QR Code channels used for invoice-related transaction

* `Promptpay` (value: `'PROMPTPAY'`)

* `Qrph` (value: `'QRPH'`)

* `XenditEnumDefaultFallback` (value: `UNKNOWN_ENUM_VALUE`)

If you encounter `UNKNOWN_ENUM_VALUE`, it means that this ENUM is unavailable in your current SDK version. Please upgrade to get the newest ENUM.
Expand Down
50 changes: 25 additions & 25 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@
/* eslint-disable */
export * from './runtime';

import { Customer } from './customer';
export { Customer } from './customer';
import { Invoice } from './invoice';
export { Invoice } from './invoice';

import { Payout } from './payout';
export { Payout } from './payout';

import { PaymentMethod } from './payment_method';
export { PaymentMethod } from './payment_method';

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 { Customer } from './customer';
export { Customer } from './customer';

import { Refund } from './refund';
export { Refund } from './refund';

import { Balance, Transaction } from './balance_and_transaction';
export { Balance, Transaction } from './balance_and_transaction';

import { PaymentMethod } from './payment_method';
export { PaymentMethod } from './payment_method';


export interface XenditOpts {
secretKey: string;
xenditURL?: string;
}
export class Xendit {
opts: XenditOpts;
Customer: Customer;
PaymentRequest: PaymentRequest;
Payout: Payout;
Invoice: Invoice;
Refund: Refund;
Balance: Balance;
Transaction: Transaction;
Payout: Payout;
PaymentMethod: PaymentMethod;
PaymentRequest: PaymentRequest;
Transaction: Transaction;
Balance: Balance;
Customer: Customer;
Refund: Refund;


constructor({ secretKey: _secretKey, xenditURL: _xenditURL }: XenditOpts) {
Expand All @@ -58,20 +58,20 @@ export class Xendit {
}


this.Customer = new Customer(this.opts);

this.PaymentRequest = new PaymentRequest(this.opts);
this.Invoice = new Invoice(this.opts);

this.Payout = new Payout(this.opts);

this.Invoice = new Invoice(this.opts);
this.PaymentMethod = new PaymentMethod(this.opts);

this.Refund = new Refund(this.opts);
this.PaymentRequest = new PaymentRequest(this.opts);

this.Balance = new Balance(this.opts);
this.Transaction = new Transaction(this.opts);
this.Balance = new Balance(this.opts);

this.PaymentMethod = new PaymentMethod(this.opts);
this.Customer = new Customer(this.opts);

this.Refund = new Refund(this.opts);

}
}
Expand Down
7 changes: 7 additions & 0 deletions invoice/models/BankCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export const BankCode = {
Bjb: 'BJB',
SahabatSampoerna: 'SAHABAT_SAMPOERNA',
Cimb: 'CIMB',
Vietcapital: 'VIETCAPITAL',
Woori: 'WOORI',
Pv: 'PV',
Msb: 'MSB',
Vpb: 'VPB',
Bidv: 'BIDV',
Cake: 'CAKE',
Bnc: 'BNC',
Hana: 'HANA',
Muamalat: 'MUAMALAT',
Expand Down
15 changes: 15 additions & 0 deletions invoice/models/ChannelPropertiesCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
*/

import { exists, mapValues } from '../../runtime';
import type { ChannelPropertiesCardsInstallmentConfiguration } from './ChannelPropertiesCardsInstallmentConfiguration';
import {
ChannelPropertiesCardsInstallmentConfigurationFromJSON,
ChannelPropertiesCardsInstallmentConfigurationFromJSONTyped,
ChannelPropertiesCardsInstallmentConfigurationToJSON,
} from './ChannelPropertiesCardsInstallmentConfiguration';

/**
* An object representing properties specific for credit card payment method.
* @export
Expand All @@ -19,6 +26,12 @@ export interface ChannelPropertiesCards {
* @memberof ChannelPropertiesCards
*/
allowedBins?: Array<string>;
/**
*
* @type {ChannelPropertiesCardsInstallmentConfiguration}
* @memberof ChannelPropertiesCards
*/
installmentConfiguration?: ChannelPropertiesCardsInstallmentConfiguration;
}

/**
Expand All @@ -41,6 +54,7 @@ export function ChannelPropertiesCardsFromJSONTyped(json: any, ignoreDiscriminat
return {

'allowedBins': !exists(json, 'allowed_bins') ? undefined : json['allowed_bins'],
'installmentConfiguration': !exists(json, 'installment_configuration') ? undefined : ChannelPropertiesCardsInstallmentConfigurationFromJSON(json['installment_configuration']),
};
}

Expand All @@ -54,6 +68,7 @@ export function ChannelPropertiesCardsToJSON(value?: ChannelPropertiesCards | nu
return {

'allowed_bins': value.allowedBins,
'installment_configuration': ChannelPropertiesCardsInstallmentConfigurationToJSON(value.installmentConfiguration),
};
}

74 changes: 74 additions & 0 deletions invoice/models/ChannelPropertiesCardsInstallmentConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* 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';
import type { ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner } from './ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner';
import {
ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerFromJSON,
ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerFromJSONTyped,
ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerToJSON,
} from './ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner';

/**
* An object to pre-set cards installment for a specific invoice
* @export
* @interface ChannelPropertiesCardsInstallmentConfiguration
*/
export interface ChannelPropertiesCardsInstallmentConfiguration {
/**
* Indicate whether full payment (without installment) is allowed
* @type {boolean}
* @memberof ChannelPropertiesCardsInstallmentConfiguration
*/
allowFullPayment?: boolean;
/**
* An object to set what kind (from specific bank / specific tenor) of cards installments will be available on a specific invoice
* @type {Array<ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner>}
* @memberof ChannelPropertiesCardsInstallmentConfiguration
*/
allowedTerms?: Array<ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInner>;
}

/**
* Check if a given object implements the ChannelPropertiesCardsInstallmentConfiguration interface.
*/
export function instanceOfChannelPropertiesCardsInstallmentConfiguration(value: object): boolean {
let isInstance = true;

return isInstance;
}

export function ChannelPropertiesCardsInstallmentConfigurationFromJSON(json: any): ChannelPropertiesCardsInstallmentConfiguration {
return ChannelPropertiesCardsInstallmentConfigurationFromJSONTyped(json, false);
}

export function ChannelPropertiesCardsInstallmentConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChannelPropertiesCardsInstallmentConfiguration {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'allowFullPayment': !exists(json, 'allow_full_payment') ? undefined : json['allow_full_payment'],
'allowedTerms': !exists(json, 'allowed_terms') ? undefined : ((json['allowed_terms'] as Array<any>).map(ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerFromJSON)),
};
}

export function ChannelPropertiesCardsInstallmentConfigurationToJSON(value?: ChannelPropertiesCardsInstallmentConfiguration | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'allow_full_payment': value.allowFullPayment,
'allowed_terms': value.allowedTerms === undefined ? undefined : ((value.allowedTerms as Array<any>).map(ChannelPropertiesCardsInstallmentConfigurationAllowedTermsInnerToJSON)),
};
}

Loading

0 comments on commit d7bd4c0

Please sign in to comment.