Pay

Pay API reference

This page and its subpages provide API reference for Velocity API's Pay (pay) operation. See Pay sample code below, and find Pay parameters' descriptions in the Request Parameters and Response Parameters subpages. For information on how to integrate this operation, see API.

Request

Endpoint: /mpoint/pay
Method: POST

See sample code for Pay API requests below, and find parameter descriptions in the following sections in the Request Parameters subpage:

Sample Request

The following is a sample Pay request:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
	<pay account="101011" client-id="10101">
		<transaction id="5057200" store-card="false">
			<card type-id="97">
				<amount country-id="405" currency-id="170">25526000</amount>
				<token>1022</token>
			</card>
			<hmac>f5ef1cfd960922babd492f06d6bf439a61de05cd395fc55225d5c1fb91801010a4dd6fa56872b6a8fa53cced7594582adb1d938f93f1859a1e794a85045f28a4</hmac>
			<billing-address country-id="640">
				<full-name>Test Automation</full-name>
				<street>MyStreet</street>
				<city>Pune</city>
			</billing-address>
		</transaction>
		<auth-token>success</auth-token>
		<client-info language="en" platform="HTML5" sdk-version="2.0.0" version="2.0.0">
			<mobile country-id="640" operator-id="64000">9898989898</mobile>
			<email>[email protected]</email>
			<customer-ref>[email protected]</customer-ref>
			<ip>223.235.105.4</ip>
		</client-info>
	</pay>
</root>

Payu and SafetyPay Sample Request

The following is a sample Pay request for Payu and SafetyPay only:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
	<pay account="101011" client-id="10101">
		<transaction id="5057200" store-card="false">
			<card type-id="97">
				<amount country-id="405" currency-id="170">25526000</amount>
				<token>1022</token>
			</card>
			<hmac>f5ef1cfd960922babd492f06d6bf439a61de05cd395fc55225d5c1fb91801010a4dd6fa56872b6a8fa53cced7594582adb1d938f93f1859a1e794a85045f28a4</hmac>
			<billing-address country-id="640">
				<full-name>Test Automation</full-name>
				<street>MyStreet</street>
				<city>Pune</city>
				<contact-details>
					<mobile operator-id="40500" country-id="405">9898989898</mobile>
					<email>[email protected]</email>
				</contact-details>
			</billing-address>
			<additional-data>
				<param name="tax_id_type">COL_NIT</param>
				<param name="tax_id">123456</param>
			</additional-data>
		</transaction>
		<auth-token>success</auth-token>
		<client-info language="en" platform="HTML5" sdk-version="2.0.0" version="2.0.0">
			<mobile country-id="640" operator-id="64000">9898989898</mobile>
			<email>[email protected]</email>
			<customer-ref>[email protected]</customer-ref>
			<ip>223.235.105.4</ip>
		</client-info>
	</pay>
</root>

Installments Sample Request

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <pay account="101012" client-id="10101">
        <transaction store-card="false" id="5297672">
            <card type-id="7">
                <amount country-id="405" currency-id="170">201000000</amount>
                <issuer-identification-number>55443300000</issuer-identification-number>
            </card>
            <hmac>b7276562910d3de13562bd827547996b92b46d7bd8ce45b60930ede9cfb1a04f29f6a9a89d938c7b9a914b1eff8df2a2998eb5805eb082db98387baa31c7a530</hmac>
            <billing-address country-id="405">
                <full-name>Test Raje</full-name>
                <street>141/2 Andul test</street>
                <postal-code>711103</postal-code>
                <city>Kolkata</city>
                <state>Kolkata</state>
            </billing-address>
            <installment>
                <value>5</value>
            </installment>
        </transaction>
        <client-info language="en" sdk-version="2.0.0" version="2.0.0" platform="HTML5" profileid="">
            <mobile operator-id="40500" country-id="405">9377178759</mobile>
            <email>[email protected]</email>
            <customer-ref>[email protected]</customer-ref>
            <device-id>2E8667F78B23402BBFF6176313BD58D314566333</device-id>
            <ip>62.242.147.103</ip>
        </client-info>
    </pay>
</root>

Response

The structure of the Pay response depends on the type of payment being made. See sample code for Pay API responses below, and find parameter descriptions in the following sections in the Response Parameters subpage:

Card Payment Sample Response

The following is a sample Pay response for a card payment:

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<psp-info id="[integer]" merchant-account="[integer]" type="1">
		<url content-type="application/x-www-form-urlencoded" method="post">[post URL]</url>
		<card-number>card_number</card-number>
		<expiry-month>expiration_month</expiry-month>
		<expiry-year>expiration_year</expiry-year>
		<cvc>securitycode</cvc>
		<name>card_holderName</name>
		<clientinfo>client_info</clientinfo>
		<accept-url>[ url]</accept-url>
		<return-url>return url</return-url>
		<hidden-fields>
			<merchant_account_id>9105bb4f-ae68-4768-9c3b-3eda968f57ea</merchant_account_id>
			<request_id>1838633_15172966764151</request_id>
			<transaction_type>10091</transaction_type>
			<requested_amount>100</requested_amount>
			<requested_amount_currency>USD</requested_amount_currency>
			<client-id>[integer]</client-id>
			<account-id>[integer]</account-id>
			<requested_amount_country>200</requested_amount_country>
			<store-card>false</store-card>
			<requested_currency_id>840</requested_currency_id>
			<transactionId>1838633</transactionId>
			<payment_ip_address>139.162.215.209</payment_ip_address>
			<email>email id</email>
			<phone>integer</phone>
			<card-type-id>7</card-type-id>
			<field_name_1>exp_month</field_name_1>
			<field_name_2>exp_year</field_name_2>
			<field_name_3>card_type_id</field_name_3>
			<field_value_3>7</field_value_3>
			<field_name_4>stored_card</field_name_4>
			<field_value_4>false</field_value_4>
			<card_type>mastercard</card_type>
			<notification_url_1>url</notification_url_1>
		</hidden-fields>
		<message language="en"/>
	</psp-info>
	<status code="1009">Payment Initialize with PSP</status>
</root>

APM Sample Response

The following is a sample Pay response for an APM payment:

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<psp-info id="24" merchant-account="[integer]" type="4">
		<url content-type="application/x-www-form-urlencoded" method="post">https://www.sandbox.com/cgi-bin/webscr?cmd=_express-checkout&amp;token=EC-9NU6Xasdjl2B&amp;useraction=commit</url>
		<hidden-fields>
			<merchant>ababababaYYRCpSSRl31ADxVAF5rd9Z-52J.7gdxYOzAv3RD</merchant>
			<order.id>CPD1516873044132</order.id>
			<order.amount>100</order.amount>
			<order.currency>GBP</order.currency>
			<session.id>EC-9NU66762XE901272B</session.id>
			<transaction.id>1838548</transaction.id>
			<sourceOfFunds.type>CARD</sourceOfFunds.type>
			<mpoint-id>1838548</mpoint-id>
			<store-card>false</store-card>
			<requested_currency_id>826</requested_currency_id>
		</hidden-fields>
		<name>card_holderName</name>
		<message language="en"/>
	</psp-info>
	<status code="1009">Payment Initialize with PSP</status>
</root>

Wallet Sample Response

The following is a sample Pay response for a payment using a wallet:

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<psp-info id="14" merchant-account="merchant.com.cellpointdigital.applepay" type="3">
		<url method="overlay"/>
		<head>&lt;script type='text/javascript'&gt; var debug = false; var countryCode = "US"; var currencyCode = "USD"; var merchantIdentifier = 'merchant.com.cellpointdigital.applepay'; var displayName ="Ethiopian Airlines"; var totalAmount = "578.34"; var supportedNetword = ['VISA','MASTERCARD','AMEX']; &lt;/script&gt; &lt;script type="text/javascript" src="https://cpmassets.s3-ap-southeast-1.amazonaws.com/et/1.3.1/applepay.js"&gt;&lt;/script&gt; &lt;style&gt; #applePay{width:150px;height:50px;display:none;border-radius:5px;background-image:-webkit-named-image(apple-pay-logo-white);background-position:50% 50%;background-color:#000;background-size:60%;background-repeat:no-repeat} &lt;/style&gt;</head>
		<body>&lt;button type="button" id="applePay"&gt;&lt;/button&gt;</body>
		<name>card_holderName</name>
		<auth-token>Auth-Token</auth-token>
		<message language="en"/>
	</psp-info>
	<status code="1009">Payment Initialize with PSP</status>
</root>

Online Banking Sample Response

The following is an example of a Pay response for online banking:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
	<psp-info id="53" merchant-account="" type="4">
		<url content-type="application/x-www-form-urlencoded" method="GET" type-id="11">https://sandbox.api/payments-api/pse-caller</url>
		<hidden-fields>
			<enc>adpc3Ryby5kZXNhcnJvbGxvLnBzZS5jb20uY28vUFNFVXNlclJlZ2lzdGVyL1N0YXJ0VHJhbnNhY3Rpb24uYXNweZUU5dUxxYW4lMmI0elBDcU94S3I1b09ySXZTSmYwRElPcno0RjV3S0pQdU0jIyMjQVYgM0JWOVBMIyMxMjM0NTY3OA==</enc>
		</hidden-fields>
		<accept-url>https://sit.cpm.dev/mpoint/aggregator/(PSP name)/redirect</accept-url>
		<name>card_holderName</name>
		<auth-token>Auth-Token</auth-token>
		<message language="en"/>
	</psp-info>
	<status code="1041">Payment Pending</status>
</root>

Installments Sample Response

The following is an example of a Pay response for a payment flow using installments:

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<psp-info id="4" merchant-account="AVIANCAECOMUSD" type="1">
		<url content-type="application/x-www-form-urlencoded" method="post">https://avianca:[email protected]/mpoint/authorize-payment</url>
		<card-number>card_number</card-number>
		<expiry-month>expiration_month</expiry-month>
		<expiry-year>expiration_year</expiry-year>
		<cvc>securitycode</cvc>
		<clientinfo>client_info</clientinfo>
		<accept-url>https://av.mesb.sit.cpm.dev/mpoint/worldpay/threed-redirect</accept-url>
		<return-url>https://av.mesb.sit.cpm.dev/mpoint/worldpay/threed-redirect</return-url>
		<decline-url>https://av.mesb.sit.cpm.dev/mpoint/worldpay/threed-redirect</decline-url>
		<cancel-url>https://av.mesb.sit.cpm.dev/mpoint/worldpay/threed-redirect</cancel-url>
		<store-card>false</store-card>
		<hidden-fields>
			<client-id>10101</client-id>
			<account-id>101012</account-id>
			<card-type-id>7</card-type-id>
			<merchant_account_id>AVIANCAECOMUSD</merchant_account_id>
			<transaction_type>10091</transaction_type>
			<requested_amount>201000000</requested_amount>
			<store-card>false</store-card>
			<requested_amount_currency>COP</requested_amount_currency>
			<requested_amount_country>405</requested_amount_country>
			<transactionId>5297672</transactionId>
			<isAccountOnFileSelectionShown>true</isAccountOnFileSelectionShown>
			<variantCode>101</variantCode>
			<isPaymentProductDetailsShown>true</isPaymentProductDetailsShown>
			<thirdPartyData>
				<installment>5</installment>
			</thirdPartyData>
		</hidden-fields>
		<name>card_holderName</name>
		<auth-token>Auth-Token</auth-token>
		<message language="en"/>
	</psp-info>
	<status code="1009">Payment Initialize with PSP</status>
</root>