Card: Credit Card Direct Payment

This model allows customers to enter their credit card details directly on the Shoplazza checkout page.

Sequence Diagram


Sequence Diagram Steps:

  1. The customer enters their credit card information and clicks to complete the payment.
  2. The browser sends the payment request to the Shoplazza server.
  3. The Shoplazza server forwards the payment request to the payments app server.
  4. The payments app server returns the payment status to the Shoplazza server.
  5. The Shoplazza server sends the payment result back to the browser.
  6. If 3DS verification is required, the browser redirects the customer to the 3DS verification page. Otherwise, the process skips to Sequence 12.
  7. The customer submits payment verification details on the 3DS page.
  8. The payments app server initiates a payment completion callback to the Shoplazza server.
    1. For more information about Complete payment callback API, please view Complete payment callback API.
  9. The Shoplazza server returns a redirect URL to the payments app server.
  10. If the payment fails, the customer is redirected to the cancel_url provided in the payment request.
  11. If the payment is successful, the customer is redirected to the complete_url returned by the Shoplazza server.
  12. The customer is directed to the order payment result page based on the payment outcome.
  13. The payments app server sends a final payment result notification to the specified callback URL.
    1. For more information about Notify Payment API, please view Notify Payment API.
  14. 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

KeyRequiredTypeDescription
app_idYstringPayments app ID.
payment_idYstringPayment ID, returns the ID of the request message.
amountYnumberOrder amount.
currencyYstringCurrency type.
statusYstringPayment status:
- paid: Payment successful
- failed: Payment failure
- paying: Processing payment
transaction_noYstringThird-party payment system order number.
typeYstringPayment type, e.g., sale.
messageNstringPayment failure message, required if payment fails.
error_codeNstringError code (required when status is failed).
testYbooleanIndicates whether the transaction was in test mode.
extensionNobjectCustom extended fields.
timestampYstringISO 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"
}