This model allows customers to enter their credit card details directly on the Shoplazza checkout page.
Sequence Diagram
Sequence Diagram Steps:
- The customer enters their credit card information and clicks to complete the payment.
- The browser sends the payment request to the Shoplazza server.
- The Shoplazza server forwards the payment request to the payments app server.
- The payments app server returns the payment status to the Shoplazza server.
- The Shoplazza server sends the payment result back to the browser.
- If 3DS verification is required, the browser redirects the customer to the 3DS verification page. Otherwise, the process skips to Sequence 12.
- The customer submits payment verification details on the 3DS page.
- The payments app server initiates a payment completion callback to the Shoplazza server.
- For more information about Complete payment callback API, please view Complete payment callback API.
- The Shoplazza server returns a redirect URL to the payments app server.
- If the payment fails, the customer is redirected to the
cancel_url
provided in the payment request. - If the payment is successful, the customer is redirected to the
complete_url
returned by the Shoplazza server. - The customer is directed to the order payment result page based on the payment outcome.
- The payments app server sends a final payment result notification to the specified callback URL.
- For more information about Notify Payment API, please view Notify Payment API.
- The Shoplazza server acknowledges receipt of the notification with an HTTP 200 response.
step 10 &11 Direct Credit Card Payment Response
- If 3DS is not required, the following content is returned (format is consistent with " Asynchronous Notification Payment Results ")
```json
{
"app_id": "12345",
"payment_id": "7eb3fefb-6b43-4400-b40a-a2a0531364ae",
"amount": "254.20",
"currency": "CAD",
"status": "failed",
"transaction_no": "123456789",
"type": "sale",
"message": "Charge invalid parameter",
"error_code": "charge_invalid_parameter",
"test": false,
"extension": {
"foo": "bar"
},
"timestamp": "2021-09-01T18:32:20Z"
}
Response Structure
Key | Required | Type | Description |
---|---|---|---|
app_id | Y | string | Payments app ID. |
payment_id | Y | string | Payment ID, returns the ID of the request message. |
amount | Y | number | Order amount. |
currency | Y | string | Currency type. |
status | Y | string | Payment status: - paid : Payment successful - failed : Payment failure - paying : Processing payment |
transaction_no | Y | string | Third-party payment system order number. |
type | Y | string | Payment type, e.g., sale . |
message | N | string | Payment failure message, required if payment fails. |
error_code | N | string | Error code (required when status is failed ). |
test | Y | boolean | Indicates whether the transaction was in test mode. |
extension | N | object | Custom extended fields. |
timestamp | Y | string | ISO 8601 formatted timestamp, e.g., 2021-09-01T18:32:20Z . |
- 3DS Required: Return a redirect URL for 3DS verification.
Success: Return a redirect URL for the payment gateway.
{
"redirect_url": "https://3ds-verification.example"
}
Failure: Return an error code and message.
{
"code": "ERR-1234",
"message": "amount less than 1000"
}