Custom form: Single payment

In this example, personal information and credit card data are collected. The card data is sent through the browser with token.js. The API receives, stores the card data and returns the cardTokenId to the merchant.


Fill the form with a valid name, email and a valid card* number (or use default values clicking on the EXAMPLE DATA button).


Step 1
Collecting the personal information and credit card data. All required fields must be filled before sending data.
Step 2
Card data is sent to CentralPay through the browser with Token.js. CentralPay stores the card data and returns the CardToken ID to the merchant form.
Step 3
CardToken ID, currency, amount and orderData are sent back to the API to initiate the transaction. The merchant receives the Transaction ID with JSON response.
Click on the button to fill the form fields:          
Test Card number: 4000 0000 0000 0002    
Expiration date: valid date
CVV: 3 digit number


Card data

Choose your card and enter CVV   
Secure payment by CentralPay
CentralPay is a PCI-DSS compliant payment gateway.




curl -v https://test-api.centralpay.net/v2/rest/cardToken \
-H 'Origin:' \
-d card[number]=  \
-d card[expirationMonth]=  \
-d card[expirationYear]= \
-d card[cvc]=  \
-d card[country]=  \
-d card[holderName]=  \
-d card[holderEmail]=  \
-d merchantPublicKey=  \

 
curl -v customer \
-u ' ' \
-d merchantCustomerId=  \
-d cardTokenId=  \
-d firstName=  \
-d lastName=  \
-d email=  \
 

curl -v card \
-u ' ' \
-d merchantCardId=  \
-d customerId=  \
-d cardTokenId=  \


curl -v https://test-api.centralpay.net/v2/rest/transaction \
-u ' ' \
-d merchantTransactionId=  \
-d amount= \
-d capture=  \
-d currency= \
-d receiptEmail=  \
-d pointOfSaleId=  \
-d cardTokenId=  \
-d customerId=  \
-d cardId=  \
-d cvcValidation=  \
-d description=  \
-d endUserIp= 3.90.207.89 \
-d order[firstName]=  \
-d order[lastName]=  \
-d order[country]=  \
-d endUserLanguage=  \
-d browserAcceptLanguage=  \
-d browserUserAgent=  \

22