Processing the payment result

When the payment gateway receives your createPayment request, it performs different verification processes.

These processes may result in:
  • exceptions (SOAP Fault Exception)
  • application errors

In case of an exception, the response will contain a Fault object specifying the encountered error (format error, etc.).

Example of a response when the shop does not have the options required for Google Pay payment:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
   <soap:Body>
      <soap:Fault>
         <faultcode xmlns:ns1="http://www.w3.org/2003/05/soap-envelope">ns1:Sender</faultcode>
         <faultstring>
              bad.shopId: The shop with shopId 12345678 is not allowed to call the Web Service
         </faultstring>
         <detail>
            <requestId>f269ff49-3b8a-4314-b999-24b39ce03287</requestId>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

If the request is valid, the response contains the commonReponse object.

The commonReponse.responseCode field gives an indication on request processing.

When responseCode is set to 0 in the response, the transaction has been created.

Any values other than responseCode indicate that the request has been rejected before the payment.

The responseCodeDetail field provides the details of the encountered error.

To verify the payment status, you must analyze the value of the commonResponse.transactionStatusLabel field

The only statuses that can guarantee an accepted payment are:

  • CAPTURED
  • AUTHORIZED
  • AUTHORIZED_TO_VALIDATE

When transactionStatusLabel is set to REFUSED, you must verify the presence of the paymentError field in the paymentResponse object.

This field provides indications on the reason of the refusal.

If paymentError is not populated, analyze the result field of the authorizationResponse object to know the reason of payment rejection.

See Implementation guide - SOAP Web service API v5 to obtain the complete list of possible errors.

Example of a response returned in case of accepted payment

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/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>
   <shopId>12345678</shopId>
   <requestId>8bb621fa-8512-45cc-b695-a30fe104cb06</requestId>
   <timestamp>2018-07-11T09:51:00Z</timestamp>
   <mode>TEST</mode>
   <authToken>Le5sPmTnoE8xh3qtU7F1SxhaieO3rh9uLxQpy/4bEu4=</authToken>
</SOAP-ENV:Header>
<soap:Body>
   <ns2:createPaymentResponse>
      <createPaymentResult>
         <requestId>8bb621fa-8512-45cc-b695-a30fe104cb06</requestId>
         <commonResponse>
            <responseCode>0</responseCode>
            <responseCodeDetail>Action successfully completed</responseCodeDetail>
            <transactionStatusLabel>AUTHORISED</transactionStatusLabel>
            <shopId>91335531</shopId>
            <paymentSource>EC</paymentSource>
            <submissionDate>2018-07-11T11:51:00.749+02:00</submissionDate>
            <contractNumber>5555555</contractNumber>
         </commonResponse>
         <paymentResponse>
            <transactionId>927452</transactionId>
            <amount>2990</amount>
            <currency>978</currency>
            <expectedCaptureDate>2018-07-11T11:51:00.791+02:00</expectedCaptureDate>
            <operationType>0</operationType>
            <creationDate>2018-07-11T11:51:00.791+02:00</creationDate>
            <liabilityShift>NO</liabilityShift>
            <transactionUuid>3257eebe44ab4b409315022735c45c2a</transactionUuid>
            <sequenceNumber>1</sequenceNumber>
            <paymentType>SINGLE</paymentType>
         </paymentResponse>
         <orderResponse>
            <orderId>myOder</orderId>
         </orderResponse>
         <cardResponse>
            <number>411111XXXXXX1111</number>
            <scheme>VISA</scheme>
            <brand>VISA</brand>
            <country>GB</country>
            <bankCode>0169</bankCode>
            <expiryMonth>12</expiryMonth>
            <expiryYear>2023</expiryYear>
         </cardResponse>
         <authorizationResponse>
            <mode>FULL</mode>
            <amount>2990</amount>
            <currency>9788</currency>
            <date>2018-07-11T11:51:00.791+02:00</date>
            <number>3fe3c2</number>
            <result>0</result>
         </authorizationResponse>
         <captureResponse/>
         <customerResponse>
            <billingDetails>
               <language>fr_FR</language>
            </billingDetails>
            <shippingDetails/>
            <extraDetails/>
         </customerResponse>
         <markResponse/>
         <threeDSResponse>
            <authenticationResultData>
            <transactionCondition>COND_SSL</transactionCondition>
            </authenticationResultData>
         </threeDSResponse>
         <extraResponse/>
         <fraudManagementResponse>
            <riskControl>
            <name>CARD_FRAUD</name>
            <result>OK</result>
         </riskControl>
         </fraudManagementResponse>
      </createPaymentResult>
   </ns2:createPaymentResponse>
</soap:Body>
</soap:Envelope>