API Workflow

Authorize Request

The code below is an example of the authorization request before Device Data Collection (DDC):

<root>
  <authorize-payment account="{{account_id}}" client-id="{{client_id}}">
    <transaction type-id="{{txn_type_id}}" id="{{txnid}}" store-card="false">
      <card type-id="{{card_id}}">
        <amount country-id="{{country_id}}" currency-id="{{currency_id}}">{{amount}}</amount>
        <cvc>{{cvc}}</cvc>
        <card-holder-name>{{card_holder_name}}</card-holder-name>
        <card-number>{{card_no}}</card-number>
        <expiry>{{exprity in mm/yy format}}</expiry>
        <address country-id="{{country_id}}">
          <first-name>{{billing_address_first_name}}</first-name>
          <last-name>{{billing_address_last_name}}</last-name>
          <street>{{billing_address_street}}</street>
          <postal-code>{{billing_address_postal_code}}</postal-code>
          <city>{{billing_address_city}}</city>
          <state>{{billing_address_state}}</state>
          <contact-details>
            <mobile operator-id="{{operater_id}}" country-id="{{country_id}}">{{billing_address_mobile_no}}</mobile>
            <email>{{billing_address_email}}</email>
          </contact-details>
        </address>
      </card>   
    </transaction>      
   <client-info language="{{lan}}" sdk-version="{{sdk_ver}}" version="{{ver}}" platform="{{plaform}}" profileid="{{profile_id}}">
      <mobile operator-id="64000" country-id="640">2147483647</mobile>
      <email>{{cust_email}}</email>
      <customer-ref>{{cust_ref_id}}</customer-ref>
      <ip>{{cust_public_id}}</ip>
    </client-info>
  </authorize-payment>
</root>

Authorize Response

The code below is an example of the authorization response:

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<status code="200501">DDC verification required for Authorization</status>
	<web-method>{{html encoded data}}</web-method>
	<expiry>{{in_millisecond}}</expiry>	
</root>

Get DDC Completion Notification from JavaScript

The frontend picks the JavaScript from the first Authorize response, which is mentioned in and runs on the browser. The web-method contains the pre-defined JSON format, we receive the token from CYBS. If we receive the token within eight seconds (which is the defined time), then HPP sets the value in as False. If we receive the DDC ID after the specific timeline, then that will be expiry as True. The frontend passes the received DDC ID and all response details in <device_data_info> in the second Authorize Request completes the transaction.

Contract Definition

The Contract Definitions are listed in the table below:

ParameterTypeRequiredDescription
statusNodeYesDenotes the status of the payment.
status.codeIntegerYesDefines the current status of the payment.
web-methodStringYesDDC JS/HTML
expiryIntegerYesThe Expiry defines when to force Close DDC Flow if the success/failed acknowledgement is not received in iFrame.