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

Adyen / adyen-java-api-library / #3177

21 Mar 2024 10:28AM CUT coverage: 12.294%. First build
#3177

push

web-flow
Merge 3d6ff7572 into d61048882

0 of 208 new or added lines in 10 files covered. (0.0%)

12446 of 101233 relevant lines covered (12.29%)

0.12 hits per line

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

72.22
/src/main/java/com/adyen/service/checkout/RecurringApi.java
1
/*
2
 * Adyen Checkout API
3
 *
4
 * The version of the OpenAPI document: 71
5
 * 
6
 *
7
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
 * https://openapi-generator.tech
9
 * Do not edit the class manually.
10
 */
11

12
package com.adyen.service.checkout;
13

14
import com.adyen.Client;
15
import com.adyen.Service;
16
import com.adyen.constants.ApiConstants;
17
import com.adyen.model.checkout.ListStoredPaymentMethodsResponse;
18
import com.adyen.model.checkout.StoredPaymentMethodRequest;
19
import com.adyen.model.checkout.StoredPaymentMethodResource;
20
import com.adyen.model.RequestOptions;
21
import com.adyen.service.exception.ApiException;
22
import com.adyen.service.resource.Resource;
23

24
import java.io.IOException;
25
import java.util.HashMap;
26
import java.util.Map;
27

28
public class RecurringApi extends Service {
29

30
    public static final String API_VERSION = "71";
31

32
    protected String baseURL;
33

34
    /**
35
    * Recurring constructor in {@link com.adyen.service.checkout package}.
36
    * @param client {@link Client } (required)
37
    */
38
    public RecurringApi(Client client) {
39
        super(client);
1✔
40
        this.baseURL = createBaseURL("https://checkout-test.adyen.com/v71");
1✔
41
    }
1✔
42

43
    /**
44
    * Recurring constructor in {@link com.adyen.service.checkout package}.
45
    * Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
46
    * @param client {@link Client } (required)
47
    * @param baseURL {@link String } (required)
48
    */
49
    public RecurringApi(Client client, String baseURL) {
50
        super(client);
×
51
        this.baseURL = baseURL;
×
52
    }
×
53

54
    /**
55
    * Delete a token for stored payment details
56
    *
57
    * @param storedPaymentMethodId {@link String } The unique identifier of the token. (required)
58
    * @param shopperReference {@link String } Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (required)
59
    * @param merchantAccount {@link String } Your merchant account. (required)
60
    * @throws ApiException if fails to make API call
61
    */
62
    public void deleteTokenForStoredPaymentDetails(String storedPaymentMethodId, String shopperReference, String merchantAccount) throws ApiException, IOException {
63
        deleteTokenForStoredPaymentDetails(storedPaymentMethodId, shopperReference,  merchantAccount,  null);
1✔
64
    }
1✔
65

66
    /**
67
    * Delete a token for stored payment details
68
    *
69
    * @param storedPaymentMethodId {@link String } The unique identifier of the token. (required)
70
    * @param shopperReference {@link String } Query: Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (required)
71
    * @param merchantAccount {@link String } Query: Your merchant account. (required)
72
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
73
    * @throws ApiException if fails to make API call
74
    */
75
    public void deleteTokenForStoredPaymentDetails(String storedPaymentMethodId, String shopperReference, String merchantAccount, RequestOptions requestOptions) throws ApiException, IOException {
76
        //Add path params
77
        Map<String, String> pathParams = new HashMap<>();
1✔
78
        if (storedPaymentMethodId == null) {
1✔
79
            throw new IllegalArgumentException("Please provide the storedPaymentMethodId path parameter");
×
80
        }
81
        pathParams.put("storedPaymentMethodId", storedPaymentMethodId);
1✔
82
        //Add query params
83
        Map<String, String> queryParams = new HashMap<>();
1✔
84
        if (shopperReference != null) {
1✔
85
        queryParams.put("shopperReference", shopperReference);
1✔
86
        }
87
        if (merchantAccount != null) {
1✔
88
        queryParams.put("merchantAccount", merchantAccount);
1✔
89
        }
90

91
        String requestBody = null;
1✔
92
        Resource resource = new Resource(this, this.baseURL + "/storedPaymentMethods/{storedPaymentMethodId}", null);
1✔
93
        resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams, queryParams);
1✔
94
    }
1✔
95

96
    /**
97
    * Get tokens for stored payment details
98
    *
99
    * @return {@link ListStoredPaymentMethodsResponse }
100
    * @throws ApiException if fails to make API call
101
    */
102
    public ListStoredPaymentMethodsResponse getTokensForStoredPaymentDetails() throws ApiException, IOException {
103
        return getTokensForStoredPaymentDetails(null,  null,  null);
×
104
    }
105

106
    /**
107
    * Get tokens for stored payment details
108
    *
109
    * @param shopperReference {@link String } Query: Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. &gt; Your reference must not include personally identifiable information (PII), for example name or email address. (optional)
110
    * @param merchantAccount {@link String } Query: Your merchant account. (optional)
111
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
112
    * @return {@link ListStoredPaymentMethodsResponse }
113
    * @throws ApiException if fails to make API call
114
    */
115
    public ListStoredPaymentMethodsResponse getTokensForStoredPaymentDetails(String shopperReference, String merchantAccount, RequestOptions requestOptions) throws ApiException, IOException {
116
        //Add query params
117
        Map<String, String> queryParams = new HashMap<>();
1✔
118
        if (shopperReference != null) {
1✔
119
        queryParams.put("shopperReference", shopperReference);
1✔
120
        }
121
        if (merchantAccount != null) {
1✔
122
        queryParams.put("merchantAccount", merchantAccount);
1✔
123
        }
124

125
        String requestBody = null;
1✔
126
        Resource resource = new Resource(this, this.baseURL + "/storedPaymentMethods", null);
1✔
127
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams);
1✔
128
        return ListStoredPaymentMethodsResponse.fromJson(jsonResult);
1✔
129
    }
130

131
    /**
132
    * Create a token to store payment details
133
    *
134
    * @param storedPaymentMethodRequest {@link StoredPaymentMethodRequest }  (required)
135
    * @return {@link StoredPaymentMethodResource }
136
    * @throws ApiException if fails to make API call
137
    */
138
    public StoredPaymentMethodResource storedPaymentMethods(StoredPaymentMethodRequest storedPaymentMethodRequest) throws ApiException, IOException {
NEW
139
        return storedPaymentMethods(storedPaymentMethodRequest, null);
×
140
    }
141

142
    /**
143
    * Create a token to store payment details
144
    *
145
    * @param storedPaymentMethodRequest {@link StoredPaymentMethodRequest }  (required)
146
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
147
    * @return {@link StoredPaymentMethodResource }
148
    * @throws ApiException if fails to make API call
149
    */
150
    public StoredPaymentMethodResource storedPaymentMethods(StoredPaymentMethodRequest storedPaymentMethodRequest, RequestOptions requestOptions) throws ApiException, IOException {
151

NEW
152
        String requestBody = storedPaymentMethodRequest.toJson();
×
NEW
153
        Resource resource = new Resource(this, this.baseURL + "/storedPaymentMethods", null);
×
NEW
154
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
NEW
155
        return StoredPaymentMethodResource.fromJson(jsonResult);
×
156
    }
157
}
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

© 2025 Coveralls, Inc