• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Adyen / adyen-node-api-library / 5786763605

pending completion
5786763605

Pull #1159

github

web-flow
Merge 78b6393cf into cb8de0b32
Pull Request #1159: Release v14.0.0

97 of 149 branches covered (65.1%)

Branch coverage included in aggregate %.

1519 of 1519 new or added lines in 79 files covered. (100.0%)

1834 of 2388 relevant lines covered (76.8%)

30.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.47
/src/services/management/paymentMethodsMerchantLevelApi.ts
1
/*
2
 * The version of the OpenAPI document: v1
3
 * 
4
 *
5
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
6
 * https://openapi-generator.tech
7
 * Do not edit this class manually.
8
 */
9

10
import getJsonResponse from "../../helpers/getJsonResponse";
16✔
11
import Service from "../../service";
16✔
12
import Client from "../../client";
13
import { ApplePayInfo } from "../../typings/management/models";
14
import { PaymentMethod } from "../../typings/management/models";
15
import { PaymentMethodResponse } from "../../typings/management/models";
16
import { PaymentMethodSetupInfo } from "../../typings/management/models";
17
import { UpdatePaymentMethodInfo } from "../../typings/management/models";
18
import { IRequest } from "../../typings/requestOptions";
19
import Resource from "../resource";
16✔
20
import { ObjectSerializer } from "../../typings/management/models";
16✔
21

22
export class PaymentMethodsMerchantLevelApi extends Service {
16✔
23

24
    private readonly API_BASEPATH: string = "https://management-test.adyen.com/v1";
8✔
25
    private baseUrl: string;
26

27
    public constructor(client: Client){
28
        super(client);
8✔
29
        this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
8✔
30
    }
31

32
    /**
33
    * @summary Get all payment methods
34
    * @param merchantId {@link string } The unique identifier of the merchant account.
35
    * @param storeId {@link string } The unique identifier of the store for which to return the payment methods.
36
    * @param businessLineId {@link string } The unique identifier of the Business Line for which to return the payment methods.
37
    * @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 10 items on a page.
38
    * @param pageNumber {@link number } The number of the page to fetch.
39
    * @param requestOptions {@link IRequest.Options}
40
    * @return {@link PaymentMethodResponse }
41
    */
42
    public async getAllPaymentMethods(merchantId: string, requestOptions?: IRequest.Options): Promise<PaymentMethodResponse> {
43
        const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentMethodSettings`
2✔
44
            .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)));
45
        const resource = new Resource(this, endpoint);
2✔
46
        const response = await getJsonResponse<string, PaymentMethodResponse>(
2✔
47
            resource,
48
            "",
49
            { ...requestOptions, method: "GET" }
50
        );
51
        return ObjectSerializer.deserialize(response, "PaymentMethodResponse");
2✔
52
    }
53

54
    /**
55
    * @summary Get payment method details
56
    * @param merchantId {@link string } The unique identifier of the merchant account.
57
    * @param paymentMethodId {@link string } The unique identifier of the payment method.
58
    * @param requestOptions {@link IRequest.Options}
59
    * @return {@link PaymentMethod }
60
    */
61
    public async getPaymentMethodDetails(merchantId: string, paymentMethodId: string, requestOptions?: IRequest.Options): Promise<PaymentMethod> {
62
        const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}`
2✔
63
            .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)))
64
            .replace("{" + "paymentMethodId" + "}", encodeURIComponent(String(paymentMethodId)));
65
        const resource = new Resource(this, endpoint);
2✔
66
        const response = await getJsonResponse<string, PaymentMethod>(
2✔
67
            resource,
68
            "",
69
            { ...requestOptions, method: "GET" }
70
        );
71
        return ObjectSerializer.deserialize(response, "PaymentMethod");
2✔
72
    }
73

74
    /**
75
    * @summary Get Apple Pay domains
76
    * @param merchantId {@link string } The unique identifier of the merchant account.
77
    * @param paymentMethodId {@link string } The unique identifier of the payment method.
78
    * @param requestOptions {@link IRequest.Options}
79
    * @return {@link ApplePayInfo }
80
    */
81
    public async getApplePayDomains(merchantId: string, paymentMethodId: string, requestOptions?: IRequest.Options): Promise<ApplePayInfo> {
82
        const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains`
×
83
            .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)))
84
            .replace("{" + "paymentMethodId" + "}", encodeURIComponent(String(paymentMethodId)));
85
        const resource = new Resource(this, endpoint);
×
86
        const response = await getJsonResponse<string, ApplePayInfo>(
×
87
            resource,
88
            "",
89
            { ...requestOptions, method: "GET" }
90
        );
91
        return ObjectSerializer.deserialize(response, "ApplePayInfo");
×
92
    }
93

94
    /**
95
    * @summary Update a payment method
96
    * @param merchantId {@link string } The unique identifier of the merchant account.
97
    * @param paymentMethodId {@link string } The unique identifier of the payment method.
98
    * @param updatePaymentMethodInfo {@link UpdatePaymentMethodInfo } 
99
    * @param requestOptions {@link IRequest.Options}
100
    * @return {@link PaymentMethod }
101
    */
102
    public async updatePaymentMethod(merchantId: string, paymentMethodId: string, updatePaymentMethodInfo: UpdatePaymentMethodInfo, requestOptions?: IRequest.Options): Promise<PaymentMethod> {
103
        const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}`
2✔
104
            .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)))
105
            .replace("{" + "paymentMethodId" + "}", encodeURIComponent(String(paymentMethodId)));
106
        const resource = new Resource(this, endpoint);
2✔
107
        const request: UpdatePaymentMethodInfo = ObjectSerializer.serialize(updatePaymentMethodInfo, "UpdatePaymentMethodInfo");
2✔
108
        const response = await getJsonResponse<UpdatePaymentMethodInfo, PaymentMethod>(
2✔
109
            resource,
110
            request,
111
            { ...requestOptions, method: "PATCH" }
112
        );
113
        return ObjectSerializer.deserialize(response, "PaymentMethod");
2✔
114
    }
115

116
    /**
117
    * @summary Request a payment method
118
    * @param merchantId {@link string } The unique identifier of the merchant account.
119
    * @param paymentMethodSetupInfo {@link PaymentMethodSetupInfo } 
120
    * @param requestOptions {@link IRequest.Options}
121
    * @return {@link PaymentMethod }
122
    */
123
    public async requestPaymentMethod(merchantId: string, paymentMethodSetupInfo: PaymentMethodSetupInfo, requestOptions?: IRequest.Options): Promise<PaymentMethod> {
124
        const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentMethodSettings`
2✔
125
            .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)));
126
        const resource = new Resource(this, endpoint);
2✔
127
        const request: PaymentMethodSetupInfo = ObjectSerializer.serialize(paymentMethodSetupInfo, "PaymentMethodSetupInfo");
2✔
128
        const response = await getJsonResponse<PaymentMethodSetupInfo, PaymentMethod>(
2✔
129
            resource,
130
            request,
131
            { ...requestOptions, method: "POST" }
132
        );
133
        return ObjectSerializer.deserialize(response, "PaymentMethod");
2✔
134
    }
135

136
    /**
137
    * @summary Add an Apple Pay domain
138
    * @param merchantId {@link string } The unique identifier of the merchant account.
139
    * @param paymentMethodId {@link string } The unique identifier of the payment method.
140
    * @param applePayInfo {@link ApplePayInfo } 
141
    * @param requestOptions {@link IRequest.Options}
142
    */
143
    public async addApplePayDomain(merchantId: string, paymentMethodId: string, applePayInfo: ApplePayInfo, requestOptions?: IRequest.Options): Promise<void> {
144
        const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains`
×
145
            .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)))
146
            .replace("{" + "paymentMethodId" + "}", encodeURIComponent(String(paymentMethodId)));
147
        const resource = new Resource(this, endpoint);
×
148
        const request: ApplePayInfo = ObjectSerializer.serialize(applePayInfo, "ApplePayInfo");
×
149
        await getJsonResponse<ApplePayInfo, void>(
×
150
            resource,
151
            request,
152
            { ...requestOptions, method: "POST" }
153
        );
154
    }
155
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc