Card Payment and receipt Copy section link Copied!

Card payment Copy section link Copied!

AgoraPay supports the following card payment schemes:

  • Mastercard
  • Visa
  • CB

The payment methods have a dedicated user experience in the web interaction flow:

Information about Reference, Order and Transaction IDs :

The OrderReference is created by the Marketplace and the orderID and TransactionId are created by AgoraPay.

When the API request is made (paymentIframe and PaymentMethods) AgoraPay create an OrderId.

This OrderId parameter is a session ID used to link different API calls for this order.

In this payment session, it is only when the customer accesses the step of the payment form that a transaction number (TransactionId) is created.

With Payment API OrderId and TransactionId are created when the API request is made.

  • When calling paymentmethods, orderId is created
  • When calling the PaymentIframe API, orderId created by AgoraPay allowing the customer to access the 1st page (card registration/card selection page registered in the case of the card).

A transaction (transactionId) is created once the customer accesses the payment form page (for card payment), or the bank choice page in the case of the PISP, or the information entry form bank for direct debit.

Since the application of PSD2 it is mandatory to provide 3DSV2 data in the payment request :

  • Details > firstName (max length 20), lastName (max length 20), address (max length 32), city, postalCode, country, email, state, gender, phoneNumber, adress2 (optional)
  • Cart > totalQuantity

See more: https://www.agorapay.com/en/documentation/v100/api-reference/#payinpayment or https://www.agorapay.com/en/documentation/v100/api-reference/#payinpaymentiframe

Payment characteristics Copy section link Copied!

JSON
Copy
Copied
{
"resultCode": "0",
"transactionId": "2851621",
"name": "marketPlace A",
"brand": "CB",
"maskedPan": "111122*************44",
"transactionStatus": "10",
"operationDate": "20211118",
"operationTime": "14:31:00",
"safe": "N",
"type": "DEBIT",
"authNumber": "1762763",
"transNumber": "35430234",
"contract": "1111119",
"amount": {
"value": "1103.28",
"currency": "EUR"
},
"mode": "TEST"
}
Copy
Copied

Card payment processing workflow Copy section link Copied!

The main steps for a card payment transaction include :

  1. The buyer validates his cart on the marketplace website
  2. The buyer selects Card as a payment method on the marketplace website
  3. The buyer inserts his card data informations
  4. The 3DSV2 Authentication request and Authorization request processing take place
  5. Agorapay Redirect the buyer to the Marketplace
  6. The Marketplace displays the payment confirmation
  7. Two possible cases : Authorization only / Capture later or Authorization plus Capture

Authorization only - capture later / Bounce API Mode Copy section link Copied!

Authorization plus capture / Bounce API Mode Copy section link Copied!

Webhook impact usecases Copy section link Copied!

You will find below the most common card workflows examples and their webbook impacts :

Refused transaction

Only the following webhook is sent:

  • Webhook 'C' : Cancelled with the relatedMsgStatus = 201
Transaction abandoned by the client

After 2 hours, the transaction is recycled :

  • Webhook C: cancelled with the relatedMsgStatus = 200
Multiple unsuccessful card attempts for a same transaction ID

Only the following webhook is sent:

  • Webhook 'C' : Cancelled with the relatedMsgStatus = 201
Multiple card attempts for a same order and transaction ID which is successful

In the case that the customer accesses the payment form several times with at least 1 failure and then second or third accepted (3 attempts maximum)


The following webhooks are sent:

  1. Webhook 'C' : Cancelled with a relatedMsgStatus = 201 (for the unsuccessful attempts)
  2. Webhook 'R' : registered
  3. Webhook 'W': Collection processing
  4. Webhook 'E' : Collection done
Successful transaction

The following webhooks are sent:

  1. Webhook 'R' : registered
  2. Webhook 'W': Collection processing
  3. Webhook 'E' : Collection done

Webhook detail :

  • OrderRefA: First reference sent by the marketplace
  • TransactionId 1
New client transaction for a same orderRef
  1. Webhook 'R' : registered
  2. Webhook 'W': Collection processing
  3. Webhook 'E' : Collection done

Webhook detail:

  • OrderRefA : Same reference sent by the marketplace
  • TransactionID 2
Multiple card attempts for a same Order ID which is successful

The following webhooks are sent:

  1. Webhook 'C' : Cancelled with a relatedMsgStatus = 201 (for the unsuccessful attempts)
  2. Webhook 'R' : registered
  3. Webhook 'W': Collection processing
  4. Webhook 'E' : Collection done
Abandonned cart

The following webhook are sent:

  1. Webhook 'C' : Cancelled with a relatedMsgStatus = 200 (for abandoned transaction)   or 201 (for refused transaction)
  2. Webhook 'R' : registered
  3. Webhook 'W': Collection processing
  4. Webhook 'E' : Collection done

Card receipt - Payment ticket Copy section link Copied!

The payment ticket is available in two different formats:

  • Raw data available in a JSON
  • Formatted data available in a PDF
cURL
Copy
Copied
1
2
3
curl -X 'GET' \\
'<https://api.live.agorapay.com/api/v1/payin/ticket?transactionId=2097421&type=C&format=J>' \\
-H 'accept: application/json'
Copy
Copied
Request Url
Copy
Copied
1
https://api.live.agorapay.com/api/v1/payin/ticket?transactionId=2097421&type=C&format=JSON&message=Trans34725470
Copy
Copied

Ticket parameters Copy section link Copied!

Parameter Name
Required
Type
Description
transactionId
check
string
Id of the transaction. Must be a card transaction.
format
check
string
Ticket format : J JSON, P : PDF
type
check
string
Ticket type : C client, M : merchant
message
string
Message to set in the bottom of the ticket.
cURL
Copy
Copied
1
2
3
4
5
6
7
curl --get 'https://API_URL/mkp/v1/payin/ticket'  
-H 'Authorization: Bearer <your_access_token>'
-H 'id_token: <your_id_token>'
-d 'transactionId=165231523612'
-d 'format=P'
-d 'message=Thank%20you%20for%20your%20purchase'
-d 'type=C'
Copy
Copied

Retrieving the result Copy section link Copied!

If your request is successful, you will receive a getTicket response, containing the following information:

Parameter Name
Type
Description
resultCode
string
resultCodeMessage
string
transactionId
string
name
string
brand
string
maskedPan
string

Hidden card number

transactionStatus
string
operationDate
string
operationTime
string

Operation time in HH:MM:SS format

safe
string

Y if 3DS is verified

type
string

1: DEBIT, 2: CREDIT

authNumber
string
transNumber
string

Transaction number in PSP

amount
object

Purchase amount

mode
string

PROD or TEST

fileContent
string

PDF file content base64 encoded, if format is P

contract
string

Payment partner contract number

If the requested format is PDF, only the resultCode, transactionId and file content will be present in the result.

Example Copy section link Copied!

Here is the JSON payload for a successful response example:

Payment method

CB, Visa, Mastercard

Countries

World

Payment execution

Marketplace initiative

Currency

EUR

Funds collection

2 to 3 working days

Payment dispute

Yes

Refunds

Yes

Partial refunds

Yes

Partial captures

Yes

Recurring payments

Yes