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

Adyen / adyen-node-api-library / 3960154750

pending completion
3960154750

Pull #1083

github

GitHub
Merge bf1e64397 into d6b50a39b
Pull Request #1083: Release 12.2.0

90 of 144 branches covered (62.5%)

Branch coverage included in aggregate %.

750 of 750 new or added lines in 35 files covered. (100.0%)

1700 of 2264 relevant lines covered (75.09%)

20.01 hits per line

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

16.13
/src/services/management/paymentMethodsMerchantLevelApi.ts
1
/*
2
 * The version of the OpenAPI document: v1
3
 * Contact: developer-experience@adyen.com
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

11
import getJsonResponse from "../../helpers/getJsonResponse";
5✔
12
import Service from "../../service";
5✔
13
/* tslint:disable:no-unused-locals */
14
import { ApplePayInfo } from '../../typings/management/models';
15
import { PaymentMethod } from '../../typings/management/models';
16
import { PaymentMethodResponse } from '../../typings/management/models';
17
import { PaymentMethodSetupInfo } from '../../typings/management/models';
18
import { UpdatePaymentMethodInfo } from '../../typings/management/models';
19
import { IRequest } from "../../typings/requestOptions";
20
import ManagementResource from "../resource/management/managementResource";
5✔
21
import { ObjectSerializer } from "../../typings/management/models";
5✔
22

23

24
export default class PaymentMethodsMerchantLevelApi extends Service {
5✔
25
    /**
26
     * @summary Get all payment methods
27
     * @param merchantId The unique identifier of the merchant account.
28
     * @param storeId The unique identifier of the store for which to return the payment methods.
29
     * @param businessLineId The unique identifier of the Business Line for which to return the payment methods.
30
     * @param pageSize The number of items to have on a page, maximum 100. The default is 10 items on a page.
31
     * @param pageNumber The number of the page to fetch.
32
     */
33
    public async getAllPaymentMethods(merchantId: string, requestOptions?: IRequest.Options): Promise<PaymentMethodResponse> {
34
        const localVarPath = "/merchants/{merchantId}/paymentMethodSettings"
×
35
            .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId)));
36
        const resource = new ManagementResource(this, localVarPath);
×
37
        const response = await getJsonResponse<string, PaymentMethodResponse>(
×
38
            resource,
39
            "",
40
            { ...requestOptions, method: "GET" }
41
        );
42
        return ObjectSerializer.deserialize(response, "PaymentMethodResponse");
×
43
    }
44
    /**
45
     * @summary Get payment method details
46
     * @param merchantId The unique identifier of the merchant account.
47
     * @param paymentMethodId The unique identifier of the payment method.
48
     */
49
    public async getPaymentMethodDetails(merchantId: string, paymentMethodId: string, requestOptions?: IRequest.Options): Promise<PaymentMethod> {
50
        const localVarPath = "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}"
×
51
            .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId)))
52
            .replace('{' + 'paymentMethodId' + '}', encodeURIComponent(String(paymentMethodId)));
53
        const resource = new ManagementResource(this, localVarPath);
×
54
        const response = await getJsonResponse<string, PaymentMethod>(
×
55
            resource,
56
            "",
57
            { ...requestOptions, method: "GET" }
58
        );
59
        return ObjectSerializer.deserialize(response, "PaymentMethod");
×
60
    }
61
    /**
62
     * @summary Get Apple Pay domains
63
     * @param merchantId The unique identifier of the merchant account.
64
     * @param paymentMethodId The unique identifier of the payment method.
65
     */
66
    public async getApplePayDomains(merchantId: string, paymentMethodId: string, requestOptions?: IRequest.Options): Promise<ApplePayInfo> {
67
        const localVarPath = "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains"
×
68
            .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId)))
69
            .replace('{' + 'paymentMethodId' + '}', encodeURIComponent(String(paymentMethodId)));
70
        const resource = new ManagementResource(this, localVarPath);
×
71
        const response = await getJsonResponse<string, ApplePayInfo>(
×
72
            resource,
73
            "",
74
            { ...requestOptions, method: "GET" }
75
        );
76
        return ObjectSerializer.deserialize(response, "ApplePayInfo");
×
77
    }
78
    /**
79
     * @summary Update a payment method
80
     * @param merchantId The unique identifier of the merchant account.
81
     * @param paymentMethodId The unique identifier of the payment method.
82
     * @param updatePaymentMethodInfo 
83
     */
84
    public async updatePaymentMethod(merchantId: string, paymentMethodId: string, updatePaymentMethodInfo: UpdatePaymentMethodInfo, requestOptions?: IRequest.Options): Promise<PaymentMethod> {
85
        const localVarPath = "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}"
×
86
            .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId)))
87
            .replace('{' + 'paymentMethodId' + '}', encodeURIComponent(String(paymentMethodId)));
88
        const resource = new ManagementResource(this, localVarPath);
×
89
        const request: UpdatePaymentMethodInfo = ObjectSerializer.serialize(updatePaymentMethodInfo, "UpdatePaymentMethodInfo");
×
90
        const response = await getJsonResponse<UpdatePaymentMethodInfo, PaymentMethod>(
×
91
            resource,
92
            request,
93
            { ...requestOptions, method: "PATCH" }
94
        );
95
        return ObjectSerializer.deserialize(response, "PaymentMethod");
×
96
    }
97
    /**
98
     * @summary Request a payment method
99
     * @param merchantId The unique identifier of the merchant account.
100
     * @param paymentMethodSetupInfo 
101
     */
102
    public async requestPaymentMethod(merchantId: string, paymentMethodSetupInfo: PaymentMethodSetupInfo, requestOptions?: IRequest.Options): Promise<PaymentMethod> {
103
        const localVarPath = "/merchants/{merchantId}/paymentMethodSettings"
×
104
            .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId)));
105
        const resource = new ManagementResource(this, localVarPath);
×
106
        const request: PaymentMethodSetupInfo = ObjectSerializer.serialize(paymentMethodSetupInfo, "PaymentMethodSetupInfo");
×
107
        const response = await getJsonResponse<PaymentMethodSetupInfo, PaymentMethod>(
×
108
            resource,
109
            request,
110
            { ...requestOptions, method: "POST" }
111
        );
112
        return ObjectSerializer.deserialize(response, "PaymentMethod");
×
113
    }
114
    /**
115
     * @summary Add an Apple Pay domain
116
     * @param merchantId The unique identifier of the merchant account.
117
     * @param paymentMethodId The unique identifier of the payment method.
118
     * @param applePayInfo 
119
     */
120
    public async addApplePayDomain(merchantId: string, paymentMethodId: string, applePayInfo: ApplePayInfo, requestOptions?: IRequest.Options): Promise<void> {
121
        const localVarPath = "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains"
×
122
            .replace('{' + 'merchantId' + '}', encodeURIComponent(String(merchantId)))
123
            .replace('{' + 'paymentMethodId' + '}', encodeURIComponent(String(paymentMethodId)));
124
        const resource = new ManagementResource(this, localVarPath);
×
125
        const request: ApplePayInfo = ObjectSerializer.serialize(applePayInfo, "ApplePayInfo");
×
126
        await getJsonResponse<ApplePayInfo, void>(
×
127
            resource,
128
            request,
129
            { ...requestOptions, method: "POST" }
130
        );
131
    }
132
}
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