API Quick Start
Make a payment with our Velocity API.
This guide walks you through the simplest Velocity API integration method to process a payment. For the HPP integration method, see Hosted Payment Page (HPP). To customize your API integration or add other API functions, see API Payment Operations. This guide applies only to PCI compliant integrators.
Prerequisites
Work with your CellPoint Digital sales representative or account manager to sign up, set up your test account, and access your testing credentials.
1. Send an Initialize Request
Endpoint: /mpoint/initialize-payment
Method: POST
Add XML to your payment page that will send an Initialize (initialize-payment
) POST request to the endpoint /mpoint/initialize-payment
when your customer elects to pay.
See the sample Initialize request below:
<root>
<initialize-payment client-id="[integer]">
<transaction order-no="testOrderId1">
<amount country-id="[integer]">100</amount>
<hmac>76f8682b42d0de9ad6948d1a8aef1744b939cd0570cd2c9749173b</hmac>
</transaction>
</initialize-payment>
</root>
For more information on sending an Initialize request, see API in Integration. For a description of request parameters, and for optional parameters, see our Initialize Reference section.
When you send an Initialize request, the Velocity API does two things: It initializes the payment process, and it gets available payment methods. See the next step for information on what it returns.
2. Parse the Initialize Response
Once you have sent your Initialize request, you will receive an Initialize (initialize-payment
) response that contains the following:
- Transaction information - This includes the transaction ID and amount, which you need for this Quick Start guide.
- Payment methods - This includes the configured payment methods or card types for the customer. This is not necessary for this Quick Start guide, so we will ignore it here.
To understand and use the payment methods returned in the response, see Get Payment Methods.
Below is the sample code for the portion of the Initialize response containing transaction information:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<client-config account="[integer]" auto-capture="false" id="[integer]" mode="[integer]" store-card="[integer]">
<name>Test</name>
<callback-url>[callback url]</callback-url>
<accept-url/>
</client-config>
<transaction auto-capture="true" eua-id="[integer]" id="[integer]" language="en" mode="1" order-no="" type-id="[integer]">
<amount country-id="[integer]" currency="DKK" format="{PRICE} {CURRENCY}" symbol="">10025</amount>
<mobile country-id="[integer]" operator-id="[integer]">30206172</mobile>
<callback-url>[CALLBACK URL]</callback-url>
<accept-url/>
</transaction>
</root>
For Initialize response parameters, see our Initialize Reference section.
3. Collect Payment Info
Create an HTML form to collect the following required payment information from the customer:
- card type
- amount
- cardholder name
- card number
- expiration date
- cvc
You will use this data in the next step to request payment authorization.
For information on using stored methods of payment, see Initialize in Reference.
4. Send an Authorize Request
Endpoint: /mpoint/authorize-payment
Method: POST
Send an Authorize (authorize-payment
) POST request to the endpoint /mpoint/authorize-payment
with the data collected in the previous steps in the request body. Populate the Authorize request with customer-submitted data and with relevant data returned in the Initialize response.
See the sample Authorize request below:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<authorize-payment account="100101" client-id="10002">
<transaction type-id="30" id="1832214" store-card="false">
<card type-id="7">
<amount country-id="200">100</amount>
<card-holder-name>CardHolder Name</card-holder-name>
<card-number>”card_number”</card-number>
<expiry>01/23</expiry>
<cvc>009</cvc>
</card>
</transaction>
<client-info language="en" version="1.28" platform="iOS/9.0">
<mobile operator-id="10000" country-id="[integer]">[phone number]</mobile>
<email>[email id]</email>
<device-id>3432444444444444444FFFFFf03</device-id>
</client-info>
</authorize-payment>
</root>
For more information on sending an Authorize request, see API in Integration. For a description of parameters, see our Authorize Reference section.
5. Parse the Authorize Response
The Velocity API will respond with an Authorize (authorize-payment
) response that confirms if the transaction authorization succeeded or failed.
See the sample Authorize response below:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<status code="2000">Payment authorized</status>
</root>
For a description of response parameters, see Authorize in Reference.
If you did not receive a success response, find the status code and description in Reference.
Updated 10 days ago