PayPal

PayPal REST Integration Guide for CellPoint Velocity API

1. Initialize a Payment

Endpoint: /mpoint/initialize-payment
Method: POST

Sample Request

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<initialize-payment account="[integer]" client-id="[integer]">
		<transaction order-no="CPM1601976034055" type-id="[integer]">
			<amount countryid="[integer]" currency-id="[integer]">100</amount>
		</transaction>
		<client-info app-version="1.43" language="en" platform="HTML5" sdk-version="1.43" version="1.43">
			<mobile country-id="200" operator-id="[integer]">[mobile number]</mobile>
			<email>[email]</email>
			<customer-ref>[customer-ref]</customer-ref>
		</client-info>
	</initialize-payment>
</root>

Sample Response

The response will include an apms object that contains Paypal information:

<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>

Key fields to capture from the Initialize response:

FieldFormatParentsDescription
idPositive Integerroot: transactionA unique transaction ID generated for the Initialize request. This identifies a transaction in CellPoint Digital's systems.
type-idPositive Integerroot: wallets: cardA unique ID that identifies your configured payment methods. type-id = 28 refers to PayPal in CellPoint Digital's systems.

2. Execute Payment

Endpoint: /mpoint/pay
Method: POST

Sample Request

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<pay account="109500" client-id="10950">
		<transaction id="80914522" store-card="false">
			<card type-id="28">
				<amount country-id="103" currency-id="826">95000</amount>
			</card>
			<hmac>[generated-hmac-value]</hmac>
			<billing-address country-id="603">
				<full-name>Test name</full-name>
				<street>123 TEST STREET</street>
				<postal-code>9876</postal-code>
				<city>PASAY</city>
				<contact-details>
					<mobile country-id="640" operator-id="64000">9898989898</mobile>
					<email>[email protected]</email>
				</contact-details>
			</billing-address>
			<foreign-exchange-info>
				<id>3606</id>
			</foreign-exchange-info>
		</transaction>
		<client-info language="en" platform="HTML5" sdk-version="2.00" version="2.00">
			<email>[email protected]</email>
			<ip>62.242.147.103</ip>
			<mobile country-id="103">5577868383</mobile>
		</client-info>
	</pay>
</root>

Sample Response

<root>
	<psp-info id="99" merchant-account="..." 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>

Action: Redirect the user to the provided URL to complete the PayPal checkout. After completion of the transaction, the user will be redirected to the accept URL.

3. Update Order Data (Ticket-Level Capture)

Endpoint: /mpoint/update-order-data
Method: POST

Sample Request

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<update-order-data>
		<transaction id="12345" order-no="FIU9YA">
			<orders>
				<line-item>
					<product order-ref="ABC1234" sku="product-ticket">
						<type>100</type>
						<name>ONE WAY</name>
						<description>MNL-CEB</description>
						<airline-data>
							<profiles>
								<profile>
									<seq>1</seq>
									<title>Mr</title>
									<first-name>dan</first-name>
									<last-name>dan</last-name>
									<type>ADT</type>
									<contact-info>
										<email>[email protected]</email>
										<mobile country-id="640">9187231231</mobile>
									</contact-info>
									<additional-data>
										<param name="loyality_id">345rtyu</param>
									</additional-data>
								</profile>
							</profiles>
							<billing-summary>
								<fare-detail>
									<fare>
										<profile-seq>1</profile-seq>
										<description>adult</description>
										<currency>PHP</currency>
										<amount>60</amount>
										<product-code>ABF</product-code>
										<product-category>FARE</product-category>
										<product-item>Base fare for adult</product-item>
									</fare>
								</fare-detail>
							</billing-summary>
							<trips>
								<trip seq="1" tag="1">
									<origin country-id="640" external-id="MNL" terminal="1" time-zone="+08:00">Ninoy Aquino International Airport</origin>
									<destination country-id="640" external-id="CEB" terminal="2" time-zone="+08:00">Mactan Cebu International Airport</destination>
									<departure-time>2021-03-07T19:35:00Z</departure-time>
									<arrival-time>2021-03-07T21:05:00Z</arrival-time>
									<booking-class>Z</booking-class>
									<service-level>Economy</service-level>
									<transportation code="5J" number="1">
										<carriers>
											<carrier code="5J" type-id="Aircraft Boeing-737-9">
												<number>563</number>
											</carrier>
										</carriers>
									</transportation>
									<additional-data>
										<param name="fare_basis">we543s3</param>
									</additional-data>
								</trip>
							</trips>
						</airline-data>
					</product>
					<amount>125056</amount>
					<quantity>1</quantity>
					<additional-data>
						<param name="key">value</param>
					</additional-data>
				</line-item>
				<line-item>
					<product order-ref="ABC1237" sku="product-ticket">
						<type>200</type>
						<name>ONE WAY</name>
						<description>MNL-CEB</description>
						<airline-data>
							<profiles>
								<profile>
									<seq>1</seq>
									<title>Mr</title>
									<first-name>dan</first-name>
									<last-name>dan</last-name>
									<type>ADT</type>
									<contact-info>
										<email>[email protected]</email>
										<mobile country-id="640">9187231231</mobile>
									</contact-info>
									<additional-data>
										<param name="loyality_id">345rtyu</param>
									</additional-data>
								</profile>
							</profiles>
							<billing-summary>
								<add-ons>
									<add-on>
										<profile-seq>1</profile-seq>
										<trip-tag>2</trip-tag>
										<trip-seq>2</trip-seq>
										<description>adult</description>
										<currency>PHP</currency>
										<amount>60</amount>
										<product-code>ABF</product-code>
										<product-category>FARE</product-category>
										<product-item>Base fare for adult</product-item>
									</add-on>
								</add-ons>
							</billing-summary>
							<trips>
								<trip seq="1" tag="1">
									<origin country-id="640" external-id="MNL" terminal="1" time-zone="+08:00">Ninoy Aquino International Airport</origin>
									<destination country-id="640" external-id="CEB" terminal="2" time-zone="+08:00">Mactan Cebu International Airport</destination>
									<departure-time>2021-03-07T19:35:00Z</departure-time>
									<arrival-time>2021-03-07T21:05:00Z</arrival-time>
									<booking-class>Z</booking-class>
									<service-level>Economy</service-level>
									<transportation code="5J" number="1">
										<carriers>
											<carrier code="5J" type-id="Aircraft Boeing-737-9">
												<number>563</number>
											</carrier>
										</carriers>
									</transportation>
									<additional-data>
										<param name="fare_basis">we543s3</param>
									</additional-data>
								</trip>
							</trips>
						</airline-data>
					</product>
					<amount>125056</amount>
					<quantity>1</quantity>
					<additional-data>
						<param name="key">value</param>
					</additional-data>
				</line-item>
			</orders>
		</transaction>
	</update-order-data>
</root>

Success Response

<root>
	<status code="100">Operation Success</status>
</root>

Failure Response

<root>
	<status code="99">Operation Failed</status>
</root>

4. Reversal / Refund

Endpoint: /mpoint/refund
Method: POST

Sample Request

<root>
	<refund client-id="[integer]">
		<transaction id="1859798" order-no="XCDFGG">
			<amount country-id="200">14000</amount>
			<external_claim_reference>ABCD1234</external_claim_reference>
		</transaction>
		<source>API</source>
	</refund>
</root>

Success Response

<root>
	<status code="1000"/>
</root>

Failure Response

<root>
	<status code="1000">
		<exception type="http">
			<code>400</code>
		</exception>
	</status>
</root>