All URIs are relative to https://api.swirepay.com/v1
Method | HTTP request | Description |
---|---|---|
addPaymentMethod | POST /payment-method | Add a payment method |
getPaymentMethod | GET /payment-method | Get payment methods |
InlineResponse2005 addPaymentMethod(body, xApiKey)
Add a payment method
Adds a payment method to an account
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PaymentMethodApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
PaymentMethodApi apiInstance = new PaymentMethodApi();
PaymentMethodRequest body = new PaymentMethodRequest(); // PaymentMethodRequest | Payment method object that needs to be added to the account
String xApiKey = "xApiKey_example"; // String |
try {
InlineResponse2005 result = apiInstance.addPaymentMethod(body, xApiKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentMethodApi#addPaymentMethod");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | PaymentMethodRequest | Payment method object that needs to be added to the account | |
xApiKey | String |
- Content-Type: application/json
- Accept: application/json
InlineResponse2004 getPaymentMethod(xApiKey)
Get payment methods
Get payment methods
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.PaymentMethodApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
PaymentMethodApi apiInstance = new PaymentMethodApi();
String xApiKey = "xApiKey_example"; // String |
try {
InlineResponse2004 result = apiInstance.getPaymentMethod(xApiKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentMethodApi#getPaymentMethod");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
xApiKey | String |
- Content-Type: Not defined
- Accept: application/json