Initialize Payment

Velocity API Integration Guide: Value Added Services

The Initialize Payment operation initiates a new payment transaction using the Velocity POP. It returns the required transaction information and merchant configuration for the payment to be successfully processed.

The table below specifies the endpoint and request requirements for this operation:

NameDetails
Endpoint[ VELOCITY URL]/mpoint/initialize-payment
Request MethodPOST
AuthenticationHTTP basic access authentication
Format/Content Typetext/xml

Initialize Request

<root>
  <initialize-payment account="[integer]" client-id="[integer]">
    <transaction order-no="testOrderId1" type-id="[integer]" session-id=”[integer]” product-type=”[integer]” booking-ref=”[PNR]”>
      <amount country-id="[integer]" currency-id=”[integer]”>100</amount>
<callback-url> [merchant callback url] </callback-url>      
<accept-url>[merchant accept url</accept-url>
<hmac>76f8682b42d0de9ad6948d1a8aef1744b939cd0570cd2c9749173b</hmac>
</
change-info>
   <service-type-id>[integer]</service-type-id>
</foreign-exchange-info>
    </transaction>
<auth-token>profilesuccessvalidation</auth-token>
    <client-info language="en" sdk-version="2.1.0" version="2.1.0" platform="[platform type]" profileid="[integer]">
      <mobile operator-id="[integer]" country-id="[integer]"> [mobile number]</mobile>
      <email>[email id]</email>
      <device-id>ABCdefr6732</device-id>
    </client-info>
  </initialize-payment>
</root>

📘

Note: Merchants from a specific domain, such as airlines or rail, can display the booking information to customers after they make payment. For example, ticket details along with the address of a customer.

Initialize Response

The Initialize Payment response has information about the transaction such as the transaction ID and amount along with the configured payment methods or cards types. The merchant must use this operation when a customer checks out.

The Initialize Payment response can be divided into these chunks:

  • Merchant configuration
  • Transaction information
  • Card information

Card Payment

The code below is an example of an Initialize Payment response that the Velocity server sends to a merchant’s customer:

<?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>
  <cards>
  .....
    <card cvc-length=“3” cvcmandatory=“false” dcc=“false” presentment ="true"  enabled=“true” id=“8” instalment=“0" max-length=“19” min-length=“13" payment-type=“1” preferred=“false” processor-type=“1” psp-id=“21" state-id=“1” type-id=“8">
    <name>Visa</name>
    <prefixes>
                <prefix>
                    <min>4000</min>
                    <max>4999</max>
                </prefix>
                <prefix>
                    <min>413222</min>
                    <max>413222</max>
                </prefix>
</prefixes>Visa</card> 
<!—This is list of settlement currencies for PCC flow These currencies are configured as per merchant’s preference per card. This node will come only if PCC is turned on -- >
 
<settlement-currencies>
    <settlement-currency>
        <id>640</id>
    </settlement-currency>
    <settlement-currency>
        <id>684</id>
    </settlement-currency>
 
 
</settlement-currencies>
  </cards>
  <stored-cards>
    <card id="[integer]" preferred="true" psp-id="2" type-id="2" dcc="true”>
      <name>myVisa</name>
      <card-number-mask>4711 10** **** 0000</card-number-mask>
      <expiry>06/24</expiry>
    </card>
  </stored-cards>
</root>

Wallet

The code below is an example response for a payment using a wallet:

<wallets>
        <card cvc-length="-1" enabled="true" id="15" max-length="-1" min-length="-1" payment-type="3" preferred="false" processor-type="3" psp-id="18" state-id="1" type-id="[integer]">
            <name>[wallet name]</name>
            <prefixes>
                <prefix>
                    <min>0</min>
                    <max>0</max>
                </prefix>
            </prefixes>
            <url method="overlay" />
            <head><script type='text/javascript'> var debug = false; var countryCode = "US"; var currencyCode = "USD"; var merchantIdentifier = 'merchant.com.cellpointmobile.applepay'; var displayName ="UATP"; var totalAmount = "1"; var supportedNetword = ['AMEX','MASTERCARD','VISA']; </script> <script type="text/javascript" src="https://s3.ap-southeast-1.amazonaws.com/cpmassets/psp/applepay.js"></script> <style> #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} </style></head>
            <body><button type="button" id="applePay"></button></body>
        </card>
</wallets>


The code below is an example response for a payment using Apple Pay:

?xml version="1.0" encoding="UTF-8"?>
<root>
    <url method="overlay" />
    <head>&lt;script type='text/javascript'&gt; var debug = false; var countryCode = "US"; var currencyCode = "USD"; var merchantIdentifier = 'merchant.com.CPD.iphone.qa'; var displayName ="UATP"; var totalAmount = "1"; var supportedNetword = ['AMEX','MASTERCARD','VISA']; &lt;/script&gt; &lt;script type="text/javascript" src="https://s3.ap-southeast-1.amazonaws.com/cpmassets/psp/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>
</root>