Card ECOM
Description
Card ECOM is a merchant's decision to take a specific type of payment card, like a credit or debit card, from a customer. A merchant can choose which brands and types of cards they accept, such as Visa, Mastercard, or American Express, and must display this information to customers. For merchants, accepting card payments is a way to increase sales, while for cardholders, it means they have the ability to use their card for payment.
Availability
Mastercard and Visa are accepted in over 200 countries and territories worldwide.
Transaction Types
The following transaction types are currently available:
Integration Types
The following integration types are currently available:
Payment Flow
- Payment Page Redirect
- Server-to-Server
API Implementation
Required value for payment_type parameter: cardecom
Server-to-Server Processing
Send cardholder data directly in case you meet the necessary PCI DSS compliance requirements.
Implementation flow:
- Make a Payment API request with card data.
- Receive API response.
- If the response contains a
client_action, handle it accordingly:postForm: Build a form on your frontend and POST thefieldsfromaction_datato the providedurl. This redirects the customer to the 3DS authentication page.redirect: Redirect the customer to theurlinaction_data.
- After 3DS is completed, the customer is returned to your
success_urlorerror_url. - Receive asynchronous postback notification to
postback_urlwith the final transaction status.
If you have your own 3DS MPI (Merchant Plug-In), you can pass threeds_authentication_value and threeds_directory_server_trans_id directly in the payment request. In this case, the gateway will use your 3DS authentication results and return a direct response without triggering its own 3DS flow. See the Cardholder Data Parameters for details.
Payment API Request
payment_typeStringrequiredcardecomorder_idStringrequiredamountFloatrequiredcurrencyStringrequiredpostback_urlStringrequiredsuccess_urlStringrequirederror_urlStringrequiredcard_numberStringrequiredcard_holderStringrequiredcard_cvvStringrequiredcard_expiry_monthStringrequiredcard_expiry_yearStringrequiredPOST https://{testapi|api}.betterpayment.de/rest/payment
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"payment_type": "cardecom",
"order_id": "12345678",
"amount": "15.90",
"currency": "EUR",
"postback_url": "https://your-postback.url.com",
"success_url": "https://your-success.url.com",
"error_url": "https://your-error.url.com",
"card_number": "4761070000000509",
"card_holder": "John Doe",
"card_cvv": "196",
"card_expiry_month": "12",
"card_expiry_year": "2026"
}
Payment API Response
- Direct (with own MPI)
- 3DS Required (without own MPI)
When threeds_authentication_value and threeds_directory_server_trans_id are provided in the request, the gateway uses the merchant's 3DS results and returns a direct response.
When no 3DS authentication values are provided, the gateway triggers its own 3DS flow. The response will have status: "pending" and a client_action that the merchant must handle.
The merchant must build a form on their frontend and POST the fields to the provided url in action_data. This redirects the customer to the 3DS authentication page. Once completed, the customer returns to success_url or error_url.
transaction_idStringpayment_typeStringstatus_codeIntegerstatusStringorder_idStringmessageStringadditional_transaction_dataStringamountFloatincluded_feesStringerror_codeIntegerclient_actionStringaction_dataObjecturl (target URL) and, for postForm, fields (key/value pairs to post).{
"transaction_id": "938834bc-769f-44e7-ab25-da9aeaad5346",
"payment_type": "cardecom",
"status_code": 3,
"status": "completed",
"order_id": "12345678",
"message": null,
"additional_transaction_data": "",
"included_fees": "0.00",
"error_code": 0
}
Payment Page Redirect
Redirect the customer to our PCI DSS compliant payment page.
Implementation flow:
- Make a Payment API request.
- Receive API response with
client_action. - Redirect your customer to the
payment pageURL inaction_data. - Customer is redirected to
success_urlorerror_url. - Receive asynchronous postback notifications to
postback_urlabout transaction status.
Payment API Request
payment_typeStringrequiredcardecomorder_idStringrequiredamountFloatrequiredcurrencyStringrequiredpostback_urlStringrequiredsuccess_urlStringrequirederror_urlStringrequiredPOST https://{testapi|api}.betterpayment.de/rest/payment
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"payment_type": "cardecom",
"order_id": "12345678",
"amount": "15.90",
"currency": "EUR",
"postback_url": "https://your-postback.url.com",
"success_url": "https://your-success.url.com",
"error_url": "https://your-error.url.com"
}
Payment API Response
transaction_idStringpayment_typeStringstatus_codeIntegerstatusStringorder_idStringerror_codeIntegerclient_actionStringaction_dataObjecturl (target URL) and, for postForm, fields (key/value pairs to post).{
"transaction_id": "d1bf9fdf-7268-406f-9e08-8d5a9540ab97",
"order_id": "12345678",
"error_code": 0,
"status_code": 1,
"status": "started",
"client_action": "redirect",
"action_data": {
"url": "https://testapi.betterpayment.de/payment/d1bf9fdf-7268-406f-9e08-8d5a9540ab97"
}
}
Postbacks
transaction_idStringpayment_typeStringstatus_codeStringstatusStringorder_idStringmessageStringadditional_transaction_dataStringcard_last_fourStringcard_expiry_yearStringcard_expiry_monthStringcard_brandStringcard_typeStringcard_countryStringincluded_feesStringexternal_transaction_idStringchecksumString{
"transaction_id": "938834bc-769f-44e7-ab25-da9aeaad5346",
"payment_type": "cardecom",
"status_code": "3",
"status": "completed",
"order_id": "12345678",
"message": "",
"additional_transaction_data": "",
"card_last_four": "0509",
"card_expiry_year": "2026",
"card_expiry_month": "12",
"card_brand": "VISA",
"card_type": "",
"card_country": "",
"included_fees": "0.00",
"external_transaction_id": "0I66TOoXap2bNLZ2m89tm1",
"checksum": "73a93b8a2d5260f592d98e386c4e5784ee551d1c"
}
For refund postbacks, see the Refund API. For retry policy and signature verification, see Postbacks.
Test Data
Visa
| Parameter | Test Value |
|---|---|
card_number | 4761070000000509 |
card_holder | any name |
card_cvv | any 3 digit number |
card_expiry_month | any month (e.g. 12) |
card_expiry_year | any year in the future (e.g. 2026) |
mastercard
| Parameter | Test Value |
|---|---|
card_number | 5286940020000908 |
card_holder | any name |
card_cvv | any 3 digit number |
card_expiry_month | any month (e.g. 12) |
card_expiry_year | any year in the future (e.g. 2026) |
3DS Passthrough
For merchants using their own MPI for 3DS authentication, use the following test values alongside the Mastercard test card above:
| Parameter | Test Value |
|---|---|
threeds_authentication_value | AUTHENTICATION_VALUE |
threeds_directory_server_trans_id | 54c64c00-eef8-4a8b-af44-fee8cc57e530 |
card_number | 5286940020000908 |
card_holder | Max Mustermann |
card_cvv | 196 |
card_expiry_month | 12 |
card_expiry_year | 2026 |