Business - Payment Methods
The user can specify several payment methods, and store pre-authorization binary blobs on the server.
The base url for the APIs in this page is at:
/api/business-mobile/
A JSON file with OpenAPI data about all business-related mobile APIs can be downloaded here
.
List actual methods
- GET /v1/payment-methods/list
Lists all configured Payment Methods for this user
- Status Codes
200 OK – Success
If there is an error the response will be negative without any further indications.
If positive, Data
will be:
[
{
ID: 7, // Int
CreatedDate: "2001-01-01T01:01:01Z", // DateTime
Name: "Personal PayPal Account", // String
Type: 3, // Int (enum)
LastValidTransaction: "2001-01-01T01:01:01Z", // DateTime (nullable)
LastErrorDescription: "", // String
IsPreferred: true, // Boolean
CardHolderName: "Credit card holder", // String (nullable)
CardNumber: "Credit card number", // String (nullable)
CardBrand: "Credit card circuit", // String (nullable)
CardExpiryYear: "Credit card expiry year", // String (nullable)
CardExpiryMonth: "Credit card expiry month" // String (nullable)
},
...
]
Type
can be one of the PaymentMethodTypes enumeration.
Add new method
- POST /v1/payment-methods/new
Add a new payment method for the current user
- Status Codes
200 OK – Success
With a request body like this:
{
Name: "Personal PayPal Account", // String
Type: 3 // Int
}
Where Type
can be one of the PaymentMethodTypes enumeration.
Furthermore, the API accepts the parameters needed for the payment gateway to retrieve the recurrent payment authorization data and the credit card data. The request body for this varies depending on the payment method’s type, that can be one of the values defined in the PaymentMethodTypes enumeration.
For WorldPay the body is the following:
{
Session: "session token", // String
CardHolderName "Credit card holder" // String
}
Possible errors are:
err_InvalidElement
One of the required request body properties is missing or not set
Update data
- POST /v1/payment-methods/edit/{id}
Update a payment method for the current user
- Parameters
id (integer) – The payment method to update
- Status Codes
200 OK – Success
With a request body like this:
{
Name: "Personal PayPal Account", // String
Type: 3 // Int
}
Where Type
can be one of the PaymentMethodTypes enumeration.
The result can be a plain positive response or a negative response with no additional data.
Delete one
- DELETE /v1/payment-methods/{id}
Delete a payment method
- Parameters
id (integer) – The payment method to delete
- Status Codes
200 OK – Success
The result can be a plain positive response or a negative response with no additional data.