Transmitting data to the payment gateway

After the mobile application retrieves the payment data, you must transmit it to your server.

Once the data is received on the server side, you must call the payment creation Web Service (createPayment) of the SOAP Web service API v5

Your query must consist of the following elements:

SOAP headers Required Allows to identify the merchant and to secure the exchanges with the payment gateway.
A commonRequest object Optional Allows to force the contract number to be used for the payment.
A cardRequest object Required Allows to transmit the payload to the payment gateway. Once decrypted, the data will be used to perform the payment.
A paymentRequest object Required Allows to transmit the payment details (amount, currency, etc.)
A customerRequest object Optional Allows to transmit the buyer details
A billingRequest sub-object Optional Allows to transmit the buyer's billing address
A shippingRequest sub-object Optional Allows to transmit the buyer's shipping address
A shoppingCartRequest object Optional Allows to transmit information about the content of the shopping cart

Note:

The current Google Pay™ implementation is not compatible with 3D Secure. Therefore, there is no need to transmit the threeDSRequest object in your query.

Step 1: Generate the SOAP-HEADER as defined in the documentation.

Example of a header:

<?xml version="1.0" encoding="UTF-8"?> 
  <SOAP-ENV:Enveloppe xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="http://v5.ws.vads.lyra.com/"
    xmlns:ns2="http://v5.ws.vads.lyra.com/Header/">
  <SOAP-ENV:Header>
    <ns2:shopId>12345678</ns2:shopId>
    <ns2:requestId>70c08d51-214b-4a9b-9e74-eadcdde6710c</ns2:requestId>
    <ns2:timestamp>2018-07-06T13:51:32Z</ns2:timestamp>
    <ns2:mode>TEST</ns2:mode>
    <ns2:authToken>o53KmUXgjqhiyTooIfRjh6wF+NJwVQg790mpbrjTg18=</ns2:authToken>
  </SOAP-ENV:Header>
...

Step 2: Create a commonRequest object as defined in the documentation if you wish to force the number of the MID to use for the payment.

Step 3: Create a cardRequest object:

Attributes of the cardRequest object Value
scheme GOOGLEPAY
walletPayload The PaymentData object in json format as it was received by the merchant server.

The number, expiryYear and expiryMonth attributes become optional when the scheme attribute is populated with GOOGLEPAY.

Step 4: Create a paymentRequest object:

Attributes of the cardRequest object Description
amount Amount to be paid. May be different from the value transmitted in the PaymentDataRequest object.
currency Numeric code of the currency to be used for the payment.

E.g.: E.g.: 978 for euro (EUR)

Step 5: Create a orderRequest object:

Attribute of the orderRequest object Description
orderId Order reference.

It is recommended to use unique order references. In case of timeout, this reference will be used to find the corresponding transaction.

Step 6: Manage shipping and billing addresses.

If you have opted for express checkout, the data will be automatically transmitted to the payment gateway. You can move on to step 7.

If you manage address selection via your mobile application, you can transmit this information to the payment gateway so that it becomes visible in the Back Office. To do this, create a customerRequest object.

Step 6.1: Create a billingRequest object:

Attributes of the billingRequest object Description
email Buyer's e-mail address.

If you leave this field empty, the payment gateway will automatically retrieve the “email” property value of the payload.

address First line of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “paymentMethodData.Info.billingAddress.address1” property value of the payload.

zipCode

Zip code of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “paymentMethodData.Info.billingAddress.postalCode” property value of the payload.
city

City of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “paymentMethodData.Info.billingAddress.locality” property value of the payload.
country

Country of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “paymentMethodData.Info.billingAddress.countryCode” property value of the payload.
firstName

Name of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “paymentMethodData.Info.billingAddress.name” property value of the payload.
cellPhoneNumber

Cell phone number

If you leave this field empty, the payment gateway will automatically retrieve the “paymentMethodData.Info.billingAddress.phoneNumber” property value of the payload.

Step 6.2: Create a shippingRequest object:

Attributes of the shippingRequest object Description
email Buyer’s e-mail address.

If you leave this field empty, the payment gateway will automatically retrieve the “email” property value of the payload.

address First line of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “shippingAddress.address1” property value of the payload.

zipCode

Zip code of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “shippingAddress.postalCode” property value of the payload.
city

City of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “shippingAddress.locality” property value of the payload.
country

Country of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “shippingAddress.countryCode” property value of the payload.
firstName

Name of the billing address.

If you leave this field empty, the payment gateway will automatically retrieve the “shippingAddress.name” property value of the payload.
cellPhoneNumber

Cell phone number

If you leave this field empty, the payment gateway will automatically retrieve the “shippingAddress.phoneNumber” property value of the payload.

Step 7: Create a shoppingCartRequest object if you wish to transmit the information on the shopping cart content.

See Implementation guide - SOAP Web service API v5 for more details on the integration of the createPayment() method.

Example of an XML message generated during the call to the createPayment() method:

<?xml version="1.0" encoding="UTF-8"?> 
  <SOAP-ENV:Envelope 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ns1="http://v5.ws.vads.lyra.com/" 
    xmlns:ns2="http://v5.ws.vads.lyra.com/Header/">
  <SOAP-ENV:Header>
    <ns2:shopId>12345678</ns2:shopId>
    <ns2:requestId>88c53eb7-6015-4ec6-8045-206e5caa2e2c</ns2:requestId>
    <ns2:timestamp>2018-07-09T10:15:54Z</ns2:timestamp>
    <ns2:mode>TEST</ns2:mode>
    <ns2:authToken>ALxESNJ+mE5htqWccF5OTkYC2noxnDr570DrnI2+5SE=</ns2:authToken>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:createPayment>
      <commonRequest>
        <paymentSource>EC</paymentSource>               
      </commonRequest>
      <paymentRequest>
        <amount>2990</amount>
        <currency>978</currency>
      </paymentRequest>
      <orderRequest>
        <orderId>myOder</orderId>
      </orderRequest>
      <cardRequest>
        <scheme>GOOGLEPAY</scheme>
        <walletPayload>{"apiVersionMinor":0,"apiVersion":2,"paymentMethodData":{"description":
        "Visa •••• 3513","tokenizationData":{"type":"PAYMENT_GATEWAY","token":"{\"signature\":
        \"MEUCIC1+XSqhtgCWQa\/3k7OFIesJX0SYBtCeOKjD+O2JBWO9AiEAg03FhXVVwD0
        NRhiPnjGWdfTqTXm39fnzr+XvHdbecY4\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"
        {\\\"encryptedMessage\\\":\\\"qjXoUw7ptqWE\/G+PSOb8QoR+hqzM7h1S7iQ3jH\/mxmjJi\/\/M
        Y5Kem6WmuQxMQbz0pXeX5mxjmUxvbIQzGhtLLELoTWxuAF\/mLSuoIznPbvJNxQ9xGOVM
      QYuo0jTKqUUv6QrjMBTSCcQx2ktkDS3EjHOWBPTw22mI\/kXz0wn5x6jlMLEUTFkNlPZYjeoFR
      vUXpw0XoECNdouiiJwub52zmyebY7pz1JlG5DQOMWRvrCnj5Kgs9sxzXp1VJJ+rIqewoBOgl\/B
      gKsf87fOxVJFYqOmq+LR\/wk8PDKE9VE1XakQBG8kxhSflMQaqC+ObObJfoUC9ruIDK7iFkT8
      EFV3FVWHu8ZVYmoek3HWabZ36NdRPUyGtDCjOR+CmT8tneRHyqRzy8S4Yk5LyCObTZ+rb
      I0toveNchZdakUhMLyFFLqkgnc\/g3WJnLpujRy3jgOe6\/+ymb1gaiOnQQA\\\\u003d\\\\u003d\\\",\\\"e
      phemeralPublicKey\\\":\\\"BKB3qFuCrmNI0bOxVg\/kVCcCtswHrwabcrm18JtPTB+w5L\/d39dnrga
      GajdYvdLrFRQc5RyQ52Ug3e151yDNE6E\\\\u003d\\\",\\\"tag\\\":\\\"rJ5SapWOGc\/f4eqzif+P9D\/wS
      g\/yvfOJ63yVbRc1lGY\\\\u003d\\\"}\"}"},"type":"CARD","info":{"cardNetwork":"VISA","cardDetails":
      "3513","billingAddress":{"address3":"","sortingCode":"","address2":"","countryCode":"FR","address1"
      :"109Ruedel'Innovation","postalCode":"31670","name":"Lyranetwork","locality":"Labège",
      "administrativeArea":""}}},"shippingAddress":{"address3":"","sortingCode":"","address2":"",
      "countryCode":"FR","address1":"109Ruedel'Innovation","postalCode":"31670","name":"MyNetwork",
      "locality":"Labège","administrativeArea":""},"email":"test.gpay@gmail.com"}</walletPayload>
      </cardRequest>
      <customerRequest>
        <billingDetails>
          <email>test@test.com</email>
        </billingDetails>
        </customerRequest>
        <techRequest/>
      </ns1:createPayment>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>