Skip to content

Commit

Permalink
release: v1.1.0 - Update to latest spec and bump dependencies (#72)
Browse files Browse the repository at this point in the history
* Adds KCP/iDEAL connection options
* Adds support for guest buyers
* Adds support for AP/GP passthrough
* Adds a few additional payment methods
* Adds sync transactions support
* Adds support for vault forward authentication
* Adds shipping method and MDD to all Cybersource connection options
* Bump dependencies
* Resolve open issue with elliptic
  • Loading branch information
cbetta authored Sep 11, 2024
1 parent 51d36d7 commit 30e0408
Show file tree
Hide file tree
Showing 38 changed files with 1,356 additions and 485 deletions.
7 changes: 7 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ model/connectionOptions.ts
model/connectionOptionsAdyenCard.ts
model/connectionOptionsCybersourceAntiFraud.ts
model/connectionOptionsCybersourceCard.ts
model/connectionOptionsCybersourceIdeal.ts
model/connectionOptionsCybersourceKcp.ts
model/connectionOptionsForterAntiFraud.ts
model/connectionOptionsForterAntiFraudCartItemsInner.ts
model/connectionOptionsForterAntiFraudCartItemsInnerBasicItemData.ts
Expand Down Expand Up @@ -307,6 +309,9 @@ model/threeDSecureV2.ts
model/tokenizedRequest.ts
model/transaction.ts
model/transactionBuyer.ts
model/transactionBuyerRequest.ts
model/transactionBuyerRequestBillingDetails.ts
model/transactionBuyerRequestShippingDetails.ts
model/transactionCaptureRequest.ts
model/transactionCardRequest.ts
model/transactionCheckoutSessionRequest.ts
Expand All @@ -315,6 +320,8 @@ model/transactionGiftCardRequest.ts
model/transactionGiftCardStoredRequest.ts
model/transactionHistoryEvent.ts
model/transactionHistoryEvents.ts
model/transactionNetworkTokenApplePayRequest.ts
model/transactionNetworkTokenGooglePayRequest.ts
model/transactionNetworkTokenRequest.ts
model/transactionPaymentMethod.ts
model/transactionPaymentMethodRequest.ts
Expand Down
4 changes: 2 additions & 2 deletions api/paymentServicesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export class PaymentServicesApi {
* @param method Filters the results to only the items for which the `method` has been set to this value. For example `card`.
* @param deleted Filters the results to only show items which have been deleted. By default, deleted items will not be returned.
*/
public async listPaymentServices (limit?: number, cursor?: string, method?: 'afterpay' | 'alipay' | 'alipayhk' | 'applepay' | 'bacs' | 'bancontact' | 'banked' | 'becs' | 'bitpay' | 'boleto' | 'boost' | 'card' | 'cashapp' | 'chaseorbital' | 'checkout-session' | 'clearpay' | 'click-to-pay' | 'dana' | 'dcb' | 'dlocal' | 'ebanx' | 'eps' | 'everydaypay' | 'gcash' | 'giropay' | 'givingblock' | 'gocardless' | 'googlepay' | 'gopay' | 'grabpay' | 'ideal' | 'kakaopay' | 'klarna' | 'laybuy' | 'linepay' | 'linkaja' | 'maybankqrpay' | 'multibanco' | 'multipago' | 'network-token' | 'oney_3x' | 'oney_4x' | 'oney_6x' | 'oney_10x' | 'oney_12x' | 'ovo' | 'oxxo' | 'payid' | 'paymaya' | 'paypal' | 'paypalpaylater' | 'payto' | 'venmo' | 'pix' | 'rabbitlinepay' | 'razorpay' | 'scalapay' | 'sepa' | 'shopeepay' | 'singteldash' | 'smartpay' | 'sofort' | 'stripedd' | 'thaiqr' | 'touchngo' | 'truemoney' | 'trustly' | 'trustlyeurope' | 'vipps' | 'waave' | 'wechat' | 'zippay', deleted?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PaymentServices; }> {
public async listPaymentServices (limit?: number, cursor?: string, method?: 'afterpay' | 'alipay' | 'alipayhk' | 'applepay' | 'bacs' | 'bancontact' | 'banked' | 'becs' | 'bitpay' | 'boleto' | 'boost' | 'card' | 'cashapp' | 'chaseorbital' | 'checkout-session' | 'clearpay' | 'click-to-pay' | 'dana' | 'dcb' | 'dlocal' | 'ebanx' | 'eps' | 'everydaypay' | 'gcash' | 'giropay' | 'givingblock' | 'gocardless' | 'googlepay' | 'googlepay_pan_only' | 'gopay' | 'grabpay' | 'id' | 'ideal' | 'kakaopay' | 'kcp' | 'klarna' | 'laybuy' | 'linepay' | 'linkaja' | 'maybankqrpay' | 'multibanco' | 'multipago' | 'network-token' | 'oney_3x' | 'oney_4x' | 'oney_6x' | 'oney_10x' | 'oney_12x' | 'ovo' | 'oxxo' | 'payid' | 'paymaya' | 'paypal' | 'paypalpaylater' | 'payto' | 'venmo' | 'pix' | 'rabbitlinepay' | 'razorpay' | 'scalapay' | 'sepa' | 'shopeepay' | 'singteldash' | 'smartpay' | 'sofort' | 'spei' | 'stripedd' | 'thaiqr' | 'touchngo' | 'truemoney' | 'trustly' | 'trustlyeurope' | 'vipps' | 'waave' | 'wechat' | 'zippay', deleted?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PaymentServices; }> {
const localVarPath = this.basePath + '/payment-services';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
Expand All @@ -346,7 +346,7 @@ export class PaymentServicesApi {
}

if (method !== undefined) {
localVarQueryParameters['method'] = ObjectSerializer.serialize(method, "'afterpay' | 'alipay' | 'alipayhk' | 'applepay' | 'bacs' | 'bancontact' | 'banked' | 'becs' | 'bitpay' | 'boleto' | 'boost' | 'card' | 'cashapp' | 'chaseorbital' | 'checkout-session' | 'clearpay' | 'click-to-pay' | 'dana' | 'dcb' | 'dlocal' | 'ebanx' | 'eps' | 'everydaypay' | 'gcash' | 'giropay' | 'givingblock' | 'gocardless' | 'googlepay' | 'gopay' | 'grabpay' | 'ideal' | 'kakaopay' | 'klarna' | 'laybuy' | 'linepay' | 'linkaja' | 'maybankqrpay' | 'multibanco' | 'multipago' | 'network-token' | 'oney_3x' | 'oney_4x' | 'oney_6x' | 'oney_10x' | 'oney_12x' | 'ovo' | 'oxxo' | 'payid' | 'paymaya' | 'paypal' | 'paypalpaylater' | 'payto' | 'venmo' | 'pix' | 'rabbitlinepay' | 'razorpay' | 'scalapay' | 'sepa' | 'shopeepay' | 'singteldash' | 'smartpay' | 'sofort' | 'stripedd' | 'thaiqr' | 'touchngo' | 'truemoney' | 'trustly' | 'trustlyeurope' | 'vipps' | 'waave' | 'wechat' | 'zippay'");
localVarQueryParameters['method'] = ObjectSerializer.serialize(method, "'afterpay' | 'alipay' | 'alipayhk' | 'applepay' | 'bacs' | 'bancontact' | 'banked' | 'becs' | 'bitpay' | 'boleto' | 'boost' | 'card' | 'cashapp' | 'chaseorbital' | 'checkout-session' | 'clearpay' | 'click-to-pay' | 'dana' | 'dcb' | 'dlocal' | 'ebanx' | 'eps' | 'everydaypay' | 'gcash' | 'giropay' | 'givingblock' | 'gocardless' | 'googlepay' | 'googlepay_pan_only' | 'gopay' | 'grabpay' | 'id' | 'ideal' | 'kakaopay' | 'kcp' | 'klarna' | 'laybuy' | 'linepay' | 'linkaja' | 'maybankqrpay' | 'multibanco' | 'multipago' | 'network-token' | 'oney_3x' | 'oney_4x' | 'oney_6x' | 'oney_10x' | 'oney_12x' | 'ovo' | 'oxxo' | 'payid' | 'paymaya' | 'paypal' | 'paypalpaylater' | 'payto' | 'venmo' | 'pix' | 'rabbitlinepay' | 'razorpay' | 'scalapay' | 'sepa' | 'shopeepay' | 'singteldash' | 'smartpay' | 'sofort' | 'spei' | 'stripedd' | 'thaiqr' | 'touchngo' | 'truemoney' | 'trustly' | 'trustlyeurope' | 'vipps' | 'waave' | 'wechat' | 'zippay'");
}

if (deleted !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion api/tokensApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export class TokensApi {
});
}
/**
* Issue a cryptogram for a stored network token of a stored card. The endpoint is disabled by default, please contact our team for more information on enablement.
* Issue a cryptogram for a stored network token of a stored card.
* @summary Issue cryptogram
* @param paymentMethodId The ID of the payment method.
* @param networkTokenId The ID of the network token.
Expand Down
76 changes: 74 additions & 2 deletions api/transactionsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ export class TransactionsApi {
* @param updatedAtGte Filters the results to only transactions last updated after this ISO date-time string. The time zone must be included. Ensure that the date-time string is URL encoded, e.g. &#x60;2022-01-01T12:00:00+08:00&#x60; must be encoded as &#x60;2022-01-01T12%3A00%3A00%2B08%3A00&#x60;.
* @param updatedAtLte Filters the results to only transactions last updated before this ISO date-time string. The time zone must be included. Ensure that the date-time string is URL encoded, e.g. &#x60;2022-01-01T12:00:00+08:00&#x60; must be encoded as &#x60;2022-01-01T12%3A00%3A00%2B08%3A00&#x60;.
*/
public async listTransactions (buyerExternalIdentifier?: string, buyerId?: string, cursor?: string, limit?: number, amountEq?: number, amountGte?: number, amountLte?: number, checkoutSessionId?: string, createdAtGte?: Date, createdAtLte?: Date, currency?: Array<string>, externalIdentifier?: string, giftCardId?: string, giftCardLast4?: string, hasGiftCardRedemptions?: boolean, hasRefunds?: boolean, id?: string, metadata?: Array<string>, method?: Array<'afterpay' | 'alipay' | 'alipayhk' | 'applepay' | 'bacs' | 'bancontact' | 'banked' | 'becs' | 'bitpay' | 'boleto' | 'boost' | 'card' | 'cashapp' | 'chaseorbital' | 'checkout-session' | 'clearpay' | 'click-to-pay' | 'dana' | 'dcb' | 'dlocal' | 'ebanx' | 'eps' | 'everydaypay' | 'gcash' | 'giropay' | 'givingblock' | 'gocardless' | 'googlepay' | 'gopay' | 'grabpay' | 'ideal' | 'kakaopay' | 'klarna' | 'laybuy' | 'linepay' | 'linkaja' | 'maybankqrpay' | 'multibanco' | 'multipago' | 'network-token' | 'oney_3x' | 'oney_4x' | 'oney_6x' | 'oney_10x' | 'oney_12x' | 'ovo' | 'oxxo' | 'payid' | 'paymaya' | 'paypal' | 'paypalpaylater' | 'payto' | 'venmo' | 'pix' | 'rabbitlinepay' | 'razorpay' | 'scalapay' | 'sepa' | 'shopeepay' | 'singteldash' | 'smartpay' | 'sofort' | 'stripedd' | 'thaiqr' | 'touchngo' | 'truemoney' | 'trustly' | 'trustlyeurope' | 'vipps' | 'waave' | 'wechat' | 'zippay'>, paymentMethodId?: string, paymentMethodLabel?: string, paymentServiceId?: Array<string>, paymentServiceTransactionId?: string, pendingReview?: boolean, reconciliationId?: string, search?: string, status?: Array<'processing' | 'buyer_approval_pending' | 'authorization_succeeded' | 'authorization_failed' | 'authorization_declined' | 'capture_pending' | 'capture_succeeded' | 'authorization_void_pending' | 'authorization_voided'>, updatedAtGte?: Date, updatedAtLte?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transactions; }> {
public async listTransactions (buyerExternalIdentifier?: string, buyerId?: string, cursor?: string, limit?: number, amountEq?: number, amountGte?: number, amountLte?: number, checkoutSessionId?: string, createdAtGte?: Date, createdAtLte?: Date, currency?: Array<string>, externalIdentifier?: string, giftCardId?: string, giftCardLast4?: string, hasGiftCardRedemptions?: boolean, hasRefunds?: boolean, id?: string, metadata?: Array<string>, method?: Array<'afterpay' | 'alipay' | 'alipayhk' | 'applepay' | 'bacs' | 'bancontact' | 'banked' | 'becs' | 'bitpay' | 'boleto' | 'boost' | 'card' | 'cashapp' | 'chaseorbital' | 'checkout-session' | 'clearpay' | 'click-to-pay' | 'dana' | 'dcb' | 'dlocal' | 'ebanx' | 'eps' | 'everydaypay' | 'gcash' | 'giropay' | 'givingblock' | 'gocardless' | 'googlepay' | 'googlepay_pan_only' | 'gopay' | 'grabpay' | 'id' | 'ideal' | 'kakaopay' | 'kcp' | 'klarna' | 'laybuy' | 'linepay' | 'linkaja' | 'maybankqrpay' | 'multibanco' | 'multipago' | 'network-token' | 'oney_3x' | 'oney_4x' | 'oney_6x' | 'oney_10x' | 'oney_12x' | 'ovo' | 'oxxo' | 'payid' | 'paymaya' | 'paypal' | 'paypalpaylater' | 'payto' | 'venmo' | 'pix' | 'rabbitlinepay' | 'razorpay' | 'scalapay' | 'sepa' | 'shopeepay' | 'singteldash' | 'smartpay' | 'sofort' | 'spei' | 'stripedd' | 'thaiqr' | 'touchngo' | 'truemoney' | 'trustly' | 'trustlyeurope' | 'vipps' | 'waave' | 'wechat' | 'zippay'>, paymentMethodId?: string, paymentMethodLabel?: string, paymentServiceId?: Array<string>, paymentServiceTransactionId?: string, pendingReview?: boolean, reconciliationId?: string, search?: string, status?: Array<'processing' | 'buyer_approval_pending' | 'authorization_succeeded' | 'authorization_failed' | 'authorization_declined' | 'capture_pending' | 'capture_succeeded' | 'authorization_void_pending' | 'authorization_voided'>, updatedAtGte?: Date, updatedAtLte?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transactions; }> {
const localVarPath = this.basePath + '/transactions';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
Expand Down Expand Up @@ -592,7 +592,7 @@ export class TransactionsApi {
}

if (method !== undefined) {
localVarQueryParameters['method'] = ObjectSerializer.serialize(method, "Array<'afterpay' | 'alipay' | 'alipayhk' | 'applepay' | 'bacs' | 'bancontact' | 'banked' | 'becs' | 'bitpay' | 'boleto' | 'boost' | 'card' | 'cashapp' | 'chaseorbital' | 'checkout-session' | 'clearpay' | 'click-to-pay' | 'dana' | 'dcb' | 'dlocal' | 'ebanx' | 'eps' | 'everydaypay' | 'gcash' | 'giropay' | 'givingblock' | 'gocardless' | 'googlepay' | 'gopay' | 'grabpay' | 'ideal' | 'kakaopay' | 'klarna' | 'laybuy' | 'linepay' | 'linkaja' | 'maybankqrpay' | 'multibanco' | 'multipago' | 'network-token' | 'oney_3x' | 'oney_4x' | 'oney_6x' | 'oney_10x' | 'oney_12x' | 'ovo' | 'oxxo' | 'payid' | 'paymaya' | 'paypal' | 'paypalpaylater' | 'payto' | 'venmo' | 'pix' | 'rabbitlinepay' | 'razorpay' | 'scalapay' | 'sepa' | 'shopeepay' | 'singteldash' | 'smartpay' | 'sofort' | 'stripedd' | 'thaiqr' | 'touchngo' | 'truemoney' | 'trustly' | 'trustlyeurope' | 'vipps' | 'waave' | 'wechat' | 'zippay'>");
localVarQueryParameters['method'] = ObjectSerializer.serialize(method, "Array<'afterpay' | 'alipay' | 'alipayhk' | 'applepay' | 'bacs' | 'bancontact' | 'banked' | 'becs' | 'bitpay' | 'boleto' | 'boost' | 'card' | 'cashapp' | 'chaseorbital' | 'checkout-session' | 'clearpay' | 'click-to-pay' | 'dana' | 'dcb' | 'dlocal' | 'ebanx' | 'eps' | 'everydaypay' | 'gcash' | 'giropay' | 'givingblock' | 'gocardless' | 'googlepay' | 'googlepay_pan_only' | 'gopay' | 'grabpay' | 'id' | 'ideal' | 'kakaopay' | 'kcp' | 'klarna' | 'laybuy' | 'linepay' | 'linkaja' | 'maybankqrpay' | 'multibanco' | 'multipago' | 'network-token' | 'oney_3x' | 'oney_4x' | 'oney_6x' | 'oney_10x' | 'oney_12x' | 'ovo' | 'oxxo' | 'payid' | 'paymaya' | 'paypal' | 'paypalpaylater' | 'payto' | 'venmo' | 'pix' | 'rabbitlinepay' | 'razorpay' | 'scalapay' | 'sepa' | 'shopeepay' | 'singteldash' | 'smartpay' | 'sofort' | 'spei' | 'stripedd' | 'thaiqr' | 'touchngo' | 'truemoney' | 'trustly' | 'trustlyeurope' | 'vipps' | 'waave' | 'wechat' | 'zippay'>");
}

if (paymentMethodId !== undefined) {
Expand Down Expand Up @@ -900,6 +900,78 @@ export class TransactionsApi {
});
});
}
/**
* Sync the transaction with the payment service to get the latest status, amounts, and some of the identifiers. This is only available for some payment service providers.
* @summary Sync transaction
* @param transactionId The ID for the transaction to get the information for.
*/
public async syncTransaction (transactionId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transaction; }> {
const localVarPath = this.basePath + '/transactions/{transaction_id}/sync'
.replace('{' + 'transaction_id' + '}', encodeURIComponent(String(transactionId)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};

// verify required parameter 'transactionId' is not null or undefined
if (transactionId === null || transactionId === undefined) {
throw new Error('Required parameter transactionId was null or undefined when calling syncTransaction.');
}

(<any>Object).assign(localVarHeaderParams, options.headers);

let localVarUseFormData = false;

let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};

let authenticationPromise = Promise.resolve();
if (this.authentications.bearerAuth.accessToken) {
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));

let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}

return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Transaction; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Transaction");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
* Voids a transaction. If the transaction was not yet successfully authorized, or was already captured, the void will not be processed. Captured transactions can be refunded instead. Voiding zero-amount authorized transactions is not supported. Once voided, the status of the transaction will be either `authorization_voided`, `authorization_void_pending`, or if the void fails the original status will remain.
* @summary Void transaction
Expand Down
Loading

0 comments on commit 30e0408

Please sign in to comment.