Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/services/checkout/recurringApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";

import { ObjectSerializer } from "../../typings/checkout/objectSerializer";
import { CheckoutForwardRequest } from "../../typings/checkout/models";
import { CheckoutForwardResponse } from "../../typings/checkout/models";
import { ListStoredPaymentMethodsResponse } from "../../typings/checkout/models";
import { StoredPaymentMethodRequest } from "../../typings/checkout/models";
import { StoredPaymentMethodResource } from "../../typings/checkout/models";
Expand Down Expand Up @@ -58,6 +60,26 @@ export class RecurringApi extends Service {
);
}

/**
* @summary Forward stored payment details
* @param checkoutForwardRequest {@link CheckoutForwardRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link CheckoutForwardResponse }
*/
public async forward(checkoutForwardRequest: CheckoutForwardRequest, requestOptions?: IRequest.Options): Promise<CheckoutForwardResponse> {
const endpoint = `${this.baseUrl}/forward`;
const resource = new Resource(this, endpoint);

const request: CheckoutForwardRequest = ObjectSerializer.serialize(checkoutForwardRequest, "CheckoutForwardRequest");
const response = await getJsonResponse<CheckoutForwardRequest, CheckoutForwardResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);

return ObjectSerializer.deserialize(response, "CheckoutForwardResponse");
}

/**
* @summary Get tokens for stored payment details
* @param requestOptions {@link IRequest.Options }
Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/achDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export class AchDetails {
*/
"recurringDetailReference"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
Comment on lines 51 to +54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment for sdkData is missing important information about not including sensitive data. This information was present on the sdkData property that was removed from PaymentRequest. It would be beneficial to include this warning for developers. This comment applies to all newly added sdkData properties across the different payment detail files in this PR.

Suggested change
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK to function optimally. Clients must not add unrelated or sensitive personal information.
*/
"sdkData"?: string;

/**
* This is the `recurringDetailReference` returned in the response when you created the token.
*/
"storedPaymentMethodId"?: string;
Expand Down Expand Up @@ -120,6 +124,12 @@ export class AchDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "storedPaymentMethodId",
"baseName": "storedPaymentMethodId",
Expand Down
2 changes: 1 addition & 1 deletion src/typings/checkout/additionalDataLevel23.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class AdditionalDataLevel23 {
*/
"enhancedSchemeData_freightAmount"?: string;
/**
* The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros.
* The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.ungm.org/public/unspsc) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros.
*/
"enhancedSchemeData_itemDetailLine_itemNr_commodityCode"?: string;
/**
Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/affirmDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export class AffirmDetails {
*/
"checkoutAttemptId"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* **affirm**
*/
"type"?: AffirmDetails.TypeEnum;
Expand All @@ -29,6 +33,12 @@ export class AffirmDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "type",
"baseName": "type",
Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/afterpayDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export class AfterpayDetails {
*/
"recurringDetailReference"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* This is the `recurringDetailReference` returned in the response when you created the token.
*/
"storedPaymentMethodId"?: string;
Expand Down Expand Up @@ -76,6 +80,12 @@ export class AfterpayDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "storedPaymentMethodId",
"baseName": "storedPaymentMethodId",
Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/amazonPayDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export class AmazonPayDetails {
*/
"checkoutSessionId"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* **amazonpay**
*/
"type"?: AmazonPayDetails.TypeEnum;
Expand Down Expand Up @@ -49,6 +53,12 @@ export class AmazonPayDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "type",
"baseName": "type",
Expand Down
4 changes: 2 additions & 2 deletions src/typings/checkout/amount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

export class Amount {
/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
*/
"currency": string;
/**
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
* The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
*/
"value": number;

Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/ancvDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export class AncvDetails {
*/
"recurringDetailReference"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* This is the `recurringDetailReference` returned in the response when you created the token.
*/
"storedPaymentMethodId"?: string;
Expand Down Expand Up @@ -56,6 +60,12 @@ export class AncvDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "storedPaymentMethodId",
"baseName": "storedPaymentMethodId",
Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/androidPayDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export class AndroidPayDetails {
*/
"checkoutAttemptId"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* **androidpay**
*/
"type"?: AndroidPayDetails.TypeEnum;
Expand All @@ -29,6 +33,12 @@ export class AndroidPayDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "type",
"baseName": "type",
Expand Down
13 changes: 12 additions & 1 deletion src/typings/checkout/applePayDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export class ApplePayDetails {
*/
"recurringDetailReference"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* This is the `recurringDetailReference` returned in the response when you created the token.
*/
"storedPaymentMethodId"?: string;
Expand Down Expand Up @@ -66,6 +70,12 @@ export class ApplePayDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "storedPaymentMethodId",
"baseName": "storedPaymentMethodId",
Expand All @@ -90,7 +100,8 @@ export class ApplePayDetails {
export namespace ApplePayDetails {
export enum FundingSourceEnum {
Credit = 'credit',
Debit = 'debit'
Debit = 'debit',
Prepaid = 'prepaid'
}
export enum TypeEnum {
Applepay = 'applepay'
Expand Down
13 changes: 12 additions & 1 deletion src/typings/checkout/applePayDonations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export class ApplePayDonations {
*/
"recurringDetailReference"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* This is the `recurringDetailReference` returned in the response when you created the token.
*/
"storedPaymentMethodId"?: string;
Expand Down Expand Up @@ -66,6 +70,12 @@ export class ApplePayDonations {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "storedPaymentMethodId",
"baseName": "storedPaymentMethodId",
Expand All @@ -90,7 +100,8 @@ export class ApplePayDonations {
export namespace ApplePayDonations {
export enum FundingSourceEnum {
Credit = 'credit',
Debit = 'debit'
Debit = 'debit',
Prepaid = 'prepaid'
}
export enum TypeEnum {
Applepay = 'applepay'
Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/bacsDirectDebitDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export class BacsDirectDebitDetails {
*/
"recurringDetailReference"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* This is the `recurringDetailReference` returned in the response when you created the token.
*/
"storedPaymentMethodId"?: string;
Expand Down Expand Up @@ -80,6 +84,12 @@ export class BacsDirectDebitDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "storedPaymentMethodId",
"baseName": "storedPaymentMethodId",
Expand Down
2 changes: 1 addition & 1 deletion src/typings/checkout/balanceCheckRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class BalanceCheckRequest {
"fraudOffset"?: number;
"installments"?: Installments | null;
/**
* The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters.
* The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If this parameter is left empty, not provided, or not applicable (in case of cross-border transactions), then **shopperStatement** is used. Currently, `localizedShopperStatement` is only supported for payments with Visa, Mastercard, JCB, Diners, and Discover. **Supported characters**: Hiragana, Katakana, Kanji, and alphanumeric.
*/
"localizedShopperStatement"?: { [key: string]: string; };
/**
Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/billDeskDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export class BillDeskDetails {
*/
"issuer": string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* **billdesk**
*/
"type": BillDeskDetails.TypeEnum;
Expand All @@ -39,6 +43,12 @@ export class BillDeskDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "type",
"baseName": "type",
Expand Down
10 changes: 10 additions & 0 deletions src/typings/checkout/blikDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export class BlikDetails {
*/
"recurringDetailReference"?: string;
/**
* Base64-encoded JSON object containing SDK related parameters required by the SDK
*/
"sdkData"?: string;
/**
* This is the `recurringDetailReference` returned in the response when you created the token.
*/
"storedPaymentMethodId"?: string;
Expand Down Expand Up @@ -56,6 +60,12 @@ export class BlikDetails {
"type": "string",
"format": ""
},
{
"name": "sdkData",
"baseName": "sdkData",
"type": "string",
"format": ""
},
{
"name": "storedPaymentMethodId",
"baseName": "storedPaymentMethodId",
Expand Down
Loading