Payment
Payment
When the consumer initiates a payment using a credit card, you need to call the POST Payment
interface to initiate the payment. Once EVO Cloud has processed the request, you will receive the payment result.
The main process is as follows:
When calling the
Payment
interface, you need to include, but not limited to, the following parameters. For field details, refer to the API documentation:paymentMethod.type
: Filed that indicates the transaction type.paymentMethod.card
: Object contains the shopper's card information. Mandatory whenpaymentMethod.type
iscard
.paymentMethod.token.value
: Filed that contains the token of your shopper. Mandatory whenpaymentMethod.type
is token.transAmount
: Object contains the currency and value of the payment.transInitiator
: Object that contains the shopper's device type.authentication.authenticationOnly
: The filed used to indicate the request is only get authentication(3DS, Secureplus) result or not.authentication.authenticationMethod
: The filed to indicate the authentication way when this transaction need to authorise.authentication.authenticationType
: The filed used to indicate the authentication type.
Check the
payment.status
field in the EVO Cloud response. If the value isCaptured
,Authorised
, orCapturing
(depending on the value of thecaptureAfterHours
field), then the transaction was successful. Otherwise, checkresult.code
andresult.message
for the reason for the transaction failure.TIP
The relationship between
captureAfterHours
andpayment.status
is as follows:captureAfterHours payment.status Explanation 0 Captured Payment successful, no further action needed; the transaction will be settled. 1 - 168 Capturing Authorization successful; delayed settlement in progress. The transaction will be settled after the delay period ends, and you can also trigger settlement early by calling the POST Capture
interface.None Authorised Authorization successful; you need to manually call the POST Capture
interface to trigger settlement.If you do not receive a response message from EVO Cloud, you will need to call
GET Payment
to query the transaction result. When you receive the query response, you should also determine the transaction result based on thepayment.status
field, using the same method as in Step 2. If the transaction fails, you can refer topayment.failureCode
andpayment.failureReason
to understand the reason for the failure.If you included a
webhook
in yourPOST Payment
request and the transactionpayment.status
isCaptured
,Authorised
, orCapturing
, you can also receive the transaction result through asynchronous notifications, where theeventCode
will bePayment
. Again, you should determine the transaction result based on thepayment.status
field, using the same method as in Step 2.Present the payment result to the consumer.