Skip to content

Commit

Permalink
Update all services (#1377)
Browse files Browse the repository at this point in the history
* [reformat][adyen-sdk-automation] automated change

* style(fmt): code formatted

* Update transferRoute.ts

removed faulty import until sustainable fix implemented

---------

Co-authored-by: AdyenAutomationBot <Adyen Automation [email protected]>
Co-authored-by: Djoyke Reijans <[email protected]>
  • Loading branch information
3 people authored Aug 15, 2024
1 parent a4df4c0 commit 541bde8
Show file tree
Hide file tree
Showing 50 changed files with 1,159 additions and 131 deletions.
20 changes: 20 additions & 0 deletions src/services/checkout/donationsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import {
DonationCampaignsRequest,
DonationCampaignsResponse,
DonationPaymentRequest,
DonationPaymentResponse,
ObjectSerializer
Expand All @@ -28,6 +30,24 @@ export class DonationsApi extends Service {
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
}

/**
* @summary Get a list of donation campaigns.
* @param donationCampaignsRequest {@link DonationCampaignsRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link DonationCampaignsResponse }
*/
public async donationCampaigns(donationCampaignsRequest: DonationCampaignsRequest, requestOptions?: IRequest.Options): Promise<DonationCampaignsResponse> {
const endpoint = `${this.baseUrl}/donationCampaigns`;
const resource = new Resource(this, endpoint);
const request: DonationCampaignsRequest = ObjectSerializer.serialize(donationCampaignsRequest, "DonationCampaignsRequest");
const response = await getJsonResponse<DonationCampaignsRequest, DonationCampaignsResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "DonationCampaignsResponse");
}

/**
* @summary Start a transaction for donations
* @param donationPaymentRequest {@link DonationPaymentRequest }
Expand Down
135 changes: 135 additions & 0 deletions src/services/paymentsAppApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/

import Client from "../client";
import getJsonResponse from "../helpers/getJsonResponse";
import Service from "../service";
import { BoardingTokenRequest } from "../typings/paymentsApp/models";
import { BoardingTokenResponse } from "../typings/paymentsApp/models";
import { PaymentsAppResponse } from "../typings/paymentsApp/models";
import { IRequest } from "../typings/requestOptions";
import Resource from "./resource";
import { ObjectSerializer } from "../typings/paymentsApp/models";

export class PaymentsAppAPI extends Service {

private readonly API_BASEPATH: string = "https://management-live.adyen.com/v1";
private baseUrl: string;

public constructor(client: Client) {
super(client);
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
}

/**
* @summary Create a boarding token - merchant level
* @param merchantId {@link string } The unique identifier of the merchant account.
* @param boardingTokenRequest {@link BoardingTokenRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link BoardingTokenResponse }
*/
public async generatePaymentsAppBoardingTokenForMerchant(merchantId: string, boardingTokenRequest: BoardingTokenRequest, requestOptions?: IRequest.Options): Promise<BoardingTokenResponse> {
const endpoint = `${this.baseUrl}/merchants/{merchantId}/generatePaymentsAppBoardingToken`
.replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)));
const resource = new Resource(this, endpoint);
const request: BoardingTokenRequest = ObjectSerializer.serialize(boardingTokenRequest, "BoardingTokenRequest");
const response = await getJsonResponse<BoardingTokenRequest, BoardingTokenResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "BoardingTokenResponse");
}

/**
* @summary Create a boarding token - store level
* @param merchantId {@link string } The unique identifier of the merchant account.
* @param storeId {@link string } The unique identifier of the store.
* @param boardingTokenRequest {@link BoardingTokenRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link BoardingTokenResponse }
*/
public async generatePaymentsAppBoardingTokenForStore(merchantId: string, storeId: string, boardingTokenRequest: BoardingTokenRequest, requestOptions?: IRequest.Options): Promise<BoardingTokenResponse> {
const endpoint = `${this.baseUrl}/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken`
.replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)))
.replace("{" + "storeId" + "}", encodeURIComponent(String(storeId)));
const resource = new Resource(this, endpoint);
const request: BoardingTokenRequest = ObjectSerializer.serialize(boardingTokenRequest, "BoardingTokenRequest");
const response = await getJsonResponse<BoardingTokenRequest, BoardingTokenResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "BoardingTokenResponse");
}

/**
* @summary Get a list of Payments Apps - merchant level
* @param merchantId {@link string } The unique identifier of the merchant account.
* @param requestOptions {@link IRequest.Options }
* @param statuses {@link string } The status of the Payments App. Comma-separated list of one or more values. If no value is provided, the list returns all statuses. Possible values: * **BOARDING** * **BOARDED** * **REVOKED**
* @param limit {@link number } The number of items to return.
* @param offset {@link number } The number of items to skip.
* @return {@link PaymentsAppResponse }
*/
public async listPaymentsAppForMerchant(merchantId: string, requestOptions?: IRequest.Options): Promise<PaymentsAppResponse> {
const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentsApps`
.replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)));
const resource = new Resource(this, endpoint);
const response = await getJsonResponse<string, PaymentsAppResponse>(
resource,
"",
{ ...requestOptions, method: "GET" }
);
return ObjectSerializer.deserialize(response, "PaymentsAppResponse");
}

/**
* @summary Get a list of Payments Apps - store level
* @param merchantId {@link string } The unique identifier of the merchant account.
* @param storeId {@link string } The unique identifier of the store.
* @param requestOptions {@link IRequest.Options }
* @param statuses {@link string } The status of the Payments App. Comma-separated list of one or more values. If no value is provided, the list returns all statuses. Possible values: * **BOARDING** * **BOARDED** * **REVOKED**
* @param limit {@link number } The number of items to return.
* @param offset {@link number } The number of items to skip.
* @return {@link PaymentsAppResponse }
*/
public async listPaymentsAppForStore(merchantId: string, storeId: string, requestOptions?: IRequest.Options): Promise<PaymentsAppResponse> {
const endpoint = `${this.baseUrl}/merchants/{merchantId}/stores/{storeId}/paymentsApps`
.replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)))
.replace("{" + "storeId" + "}", encodeURIComponent(String(storeId)));
const resource = new Resource(this, endpoint);
const response = await getJsonResponse<string, PaymentsAppResponse>(
resource,
"",
{ ...requestOptions, method: "GET" }
);
return ObjectSerializer.deserialize(response, "PaymentsAppResponse");
}

/**
* @summary Revoke Payments App instance authentication
* @param merchantId {@link string } The unique identifier of the merchant account.
* @param installationId {@link string } The unique identifier of the Payments App instance on a device.
* @param requestOptions {@link IRequest.Options }
*/
public async revokePaymentsApp(merchantId: string, installationId: string, requestOptions?: IRequest.Options): Promise<void> {
const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentsApps/{installationId}/revoke`
.replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)))
.replace("{" + "installationId" + "}", encodeURIComponent(String(installationId)));
const resource = new Resource(this, endpoint);
await getJsonResponse<string, void>(
resource,
"",
{ ...requestOptions, method: "POST" }
);
}
}

export default PaymentsAppAPI;
9 changes: 9 additions & 0 deletions src/typings/checkout/achDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export class AchDetails {
*/
'storedPaymentMethodId'?: string;
/**
* The unique identifier of your user\'s verified transfer instrument, which you can use to top up their balance accounts.
*/
'transferInstrumentId'?: string;
/**
* **ach**
*/
'type'?: AchDetails.TypeEnum;
Expand Down Expand Up @@ -98,6 +102,11 @@ export class AchDetails {
"baseName": "storedPaymentMethodId",
"type": "string"
},
{
"name": "transferInstrumentId",
"baseName": "transferInstrumentId",
"type": "string"
},
{
"name": "type",
"baseName": "type",
Expand Down
39 changes: 39 additions & 0 deletions src/typings/checkout/amounts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* The version of the OpenAPI document: v71
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/


export class Amounts {
/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
*/
'currency': string;
/**
* The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)).
*/
'values': Array<number>;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "currency",
"baseName": "currency",
"type": "string"
},
{
"name": "values",
"baseName": "values",
"type": "Array<number>"
} ];

static getAttributeTypeMap() {
return Amounts.attributeTypeMap;
}
}

9 changes: 9 additions & 0 deletions src/typings/checkout/bacsDirectDebitDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export class BacsDirectDebitDetails {
*/
'storedPaymentMethodId'?: string;
/**
* The unique identifier of your user\'s verified transfer instrument, which you can use to top up their balance accounts.
*/
'transferInstrumentId'?: string;
/**
* **directdebit_GB**
*/
'type'?: BacsDirectDebitDetails.TypeEnum;
Expand Down Expand Up @@ -71,6 +75,11 @@ export class BacsDirectDebitDetails {
"baseName": "storedPaymentMethodId",
"type": "string"
},
{
"name": "transferInstrumentId",
"baseName": "transferInstrumentId",
"type": "string"
},
{
"name": "type",
"baseName": "type",
Expand Down
14 changes: 14 additions & 0 deletions src/typings/checkout/createCheckoutSessionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ export class CreateCheckoutSessionRequest {
*/
'store'?: string;
/**
* Specifies how payment methods should be filtered based on the \'store\' parameter: - \'exclusive\': Only payment methods belonging to the specified \'store\' are returned. - \'inclusive\': Payment methods from the \'store\' and those not associated with any other store are returned. - \'skipFilter\': All payment methods are returned, regardless of store association.
*/
'storeFiltrationMode'?: CreateCheckoutSessionRequest.StoreFiltrationModeEnum;
/**
* When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types).
*/
'storePaymentMethod'?: boolean;
Expand Down Expand Up @@ -488,6 +492,11 @@ export class CreateCheckoutSessionRequest {
"baseName": "store",
"type": "string"
},
{
"name": "storeFiltrationMode",
"baseName": "storeFiltrationMode",
"type": "CreateCheckoutSessionRequest.StoreFiltrationModeEnum"
},
{
"name": "storePaymentMethod",
"baseName": "storePaymentMethod",
Expand Down Expand Up @@ -550,6 +559,11 @@ export namespace CreateCheckoutSessionRequest {
Moto = 'Moto',
Pos = 'POS'
}
export enum StoreFiltrationModeEnum {
Exclusive = 'exclusive',
Inclusive = 'inclusive',
SkipFilter = 'skipFilter'
}
export enum StorePaymentMethodModeEnum {
AskForConsent = 'askForConsent',
Disabled = 'disabled',
Expand Down
14 changes: 14 additions & 0 deletions src/typings/checkout/createCheckoutSessionResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ export class CreateCheckoutSessionResponse {
*/
'store'?: string;
/**
* Specifies how payment methods should be filtered based on the \'store\' parameter: - \'exclusive\': Only payment methods belonging to the specified \'store\' are returned. - \'inclusive\': Payment methods from the \'store\' and those not associated with any other store are returned. - \'skipFilter\': All payment methods are returned, regardless of store association.
*/
'storeFiltrationMode'?: CreateCheckoutSessionResponse.StoreFiltrationModeEnum;
/**
* When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types).
*/
'storePaymentMethod'?: boolean;
Expand Down Expand Up @@ -510,6 +514,11 @@ export class CreateCheckoutSessionResponse {
"baseName": "store",
"type": "string"
},
{
"name": "storeFiltrationMode",
"baseName": "storeFiltrationMode",
"type": "CreateCheckoutSessionResponse.StoreFiltrationModeEnum"
},
{
"name": "storePaymentMethod",
"baseName": "storePaymentMethod",
Expand Down Expand Up @@ -577,6 +586,11 @@ export namespace CreateCheckoutSessionResponse {
Moto = 'Moto',
Pos = 'POS'
}
export enum StoreFiltrationModeEnum {
Exclusive = 'exclusive',
Inclusive = 'inclusive',
SkipFilter = 'skipFilter'
}
export enum StorePaymentMethodModeEnum {
AskForConsent = 'askForConsent',
Disabled = 'disabled',
Expand Down
57 changes: 57 additions & 0 deletions src/typings/checkout/donation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* The version of the OpenAPI document: v71
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/


export class Donation {
/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
*/
'currency': string;
/**
* The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).\"Possible values:\\n\\n**roundup**: a donation where the original transaction amount is rounded up as a donation.**fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from.
*/
'donationType': string;
/**
* The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.
*/
'maxRoundupAmount'?: number;
/**
* The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**.
*/
'values'?: Array<number>;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "currency",
"baseName": "currency",
"type": "string"
},
{
"name": "donationType",
"baseName": "donationType",
"type": "string"
},
{
"name": "maxRoundupAmount",
"baseName": "maxRoundupAmount",
"type": "number"
},
{
"name": "values",
"baseName": "values",
"type": "Array<number>"
} ];

static getAttributeTypeMap() {
return Donation.attributeTypeMap;
}
}

Loading

0 comments on commit 541bde8

Please sign in to comment.