PayPal
PayPal REST Integration Guide for CellPoint Velocity API
This page provides a guide for integrating PayPal REST APIs with CellPoint Velocity API, which lets a customer use a payment method associated with their PayPal account.
Workflow
The workflow for using PayPal REST with CellPoint Velocity API is as follows:
- Initialize request - The customer clicks the payment button, prompting the merchant's front-end application to send an Initialize request for the full transaction amount to Velocity API.
- Initialize response - The API checks available payment options. If PayPal is available for the transaction, the API returns an Initialize response with PayPal information to the merchant.
- Payment method selection - The front-end application displays payment options to the customer, including the option of PayPal. The customer selects to use PayPal.
- Pay request - The front-end application sends a Pay request with PayPal information to the API.
- Pay response & redirect - In the Pay response, the API provides a URL for PayPal checkout. The front-end application redirects the user to the URL to complete the PayPal transaction. When the transaction is complete, PayPal redirects the user to the merchant's accept URL.
Prerequisite
Work with your CellPoint Digital sales representative or account manager to sign up, set up your test account, and access your testing credentials. During this process, CellPoint Digital will onboard you with PayPal at your request.
Integration
Complete the following steps to use PayPal with your integration.
1. Initialize payment
Endpoint: /mpoint/initialize-payment
Method: POST
Once the page has loaded, send a POST request to the /mpoint/initialize-payment
endpoint of the CellPoint Velocity API for the full transaction amount. For more information, see the API integration guide and our Initialize API reference.
If PayPal is available, the Initialize response includes an apms
object with Paypal information, like the sample object below:
<apms>
<card id="28" type-id="28" enabled="true" payment-type="4" processor-type="4" state-id="1">
<name>PayPal</name>
<prefixes>
<prefix id="181">
<min>-1</min>
<max>-1</max>
</prefix>
</prefixes>
</card>
</apms>
For a description of all response parameters, see Initialize Response Parameters in our API reference.
2. Offer payment options
Use the data from the Initialize response to present payment options to the customer. To present PayPal as an optional payment method, CellPoint Digital recommends displaying a button with the PayPal logo. Work with PayPal to meet its branding guidelines.
3. Send Pay request
Endpoint: /mpoint/pay
Method: POST
When the customer selects PayPal, send a POST request to the /mpoint/pay
endpoint of the CellPoint Velocity API. For more information, see our API integration guide and Pay API reference.
In addition to the required parameters, the request should include card: type-id="28"
.
4. Redirect customer to PayPal
The Pay response provides a URL for PayPal checkout in the text content of the url
element, as in the example below:
<root>
<psp-info id="99" merchant-account="[string]" type="4">
<url method="GET" type-
id="11">https://www.sandbox.paypal.com/checkoutnow?token=2NX57897383021645</url>
<hidden-fields>
<token>2NX57897383021645</token>
</hidden-fields>
<name>card_holderName</name>
<auth-token>Auth-Token</auth-token>
</psp-info>
<status code="1009">Payment Initialized with PSP</status>
</root>
For parameter definitions and more information about the Pay response, see Pay in our API Reference.
Extract the URL from the response and redirect the user to it so they can complete the PayPal transaction. When the transaction is complete, PayPal redirects the user to your accept URL.
Other operations are available for this workflow, including the following:
-
Manual capture - The Pay operation can capture the payment automatically. If you wish to capture the payment manually, see our API guide and Capture or Ticket-level Capture in API reference.
-
Reversal / Refund - If you wish to void or refund a transaction, see "Reversal / Refund" in the API guide and our Reversal / Refund API reference.
Updated 26 days ago