Step 1: Generate an OAuth token
See Create an OAuth token for details.
Step 2. Create a card payment method for a customer
The following Postman and cURL code sample performs the following task:
-
Creates an Card payment method
Postman example:
{{opencell.url}}/payment/payment
{
"paymentMethodType":"CARD",
"alias":"Stripe",
"disabled":false,
"customerAccountCode":"{{account.code}}",
"cardNumber":"4111 1111 1111 1111",
"cardType":"VISA",
"monthExpiration":"12","
yearExpiration":"24",
"owner":"{{account.firstname}} {{account.lastname}}",
"untdidPaymentMeans":"54"
}
cURL example:
curl --location 'https://sandbox.oc-sb.eu/opencell/api/rest/payment/payment' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--data-raw '{
"paymentMethodType":"CARD",
"alias":"stripe",
"disabled":false,
"customerAccountCode":"CLASSIC-C00",
"cardNumber":"4111 1111 1111 1111",
"cardType":"VISA",
"monthExpiration":"12","
yearExpiration":"24",
"owner":"John Smith",
"untdidPaymentMeans":"54"
}'
Answer: Code 200 with the following body
{
"status": "SUCCESS",
"message": ""
}