Skip to content

Process payment

Payment processing begins when Genstore sends an HTTP request to the payment app, and the payment app must asynchronously notify Genstore of the payment result via the Update payment result API. Once the payment status is callbacked as success (true) or failure (false), it enters the final state of the payment lifecycle, and the status cannot be changed.

The entire process relies on idempotent asynchronous communication between Genstore and the payment app. The payment app must implement:

  • Idempotency: Avoid inconsistent results due to duplicate requests.
  • Retry strategy: Safely retry in case of network errors or timeouts.

TIP

  • The payment app must support test mode. Merchants can enable or disable the test mode in the payment app. When test mode is enabled, all non-query requests will include the test: true field in their business parameters.
  • For actions involving authorization and capture, merchants can choose to authorize first. If your app does not support authorization followed by capture, you need to handle the authorization request in the payment interface yourself. The merchant's order will display the capture button once you return a payment status of "Authorized." You are required to handle the capture request yourself, rather than just returning the "Authorized" status.

Card payment

The diagram below illustrates the payment flow between Genstore and a credit card payment app:

  1. The customer triggers the payment request.
  2. Genstore sends a request to the payment app, including the amount, currency, and encrypted credit card information.
  3. The app responds with HTTP code 200 (OK), indicating the request is valid and has been received.
  4. The payment app processes the payment using the payment information received in the request.
  5. The payment app calls the Genstore Update payment result API to synchronize the payment result, and retries as needed.
  6. Genstore responds with HTTP code 200 (OK), confirming the request was received and processed.
  7. The customer continues with the checkout process.

Enabling 3D-Secure for direct card payments

In scenarios requiring 3D-Secure verification, direct card payments will involve an additional authentication step. In this flow, the payment app must return the 3D-Secure redirect URL, and Genstore will guide the customer to the authentication page. After the verification is complete, the payment app will notify Genstore of the final payment result via the Update payment result API.

The diagram below illustrates the payment flow between Genstore and a credit card payment app extension when 3D-Secure is enabled:

Process steps

  1. The customer completes checkout on Genstore, triggering the payment request.
  2. Genstore sends a request to the payment app, including the amount, currency, and encrypted credit card information.
  3. The payment app determines whether 3D-Secure redirection is needed. If authentication is required, the app returns the URL for the customer to redirect to.
  4. Genstore redirects the customer to the authentication page, where the customer completes 3D-Secure identity verification. The customer may be challenged during the 3D-Secure process.
    • If 3D-Secure verification fails, the app calls Update payment result to finalize the payment as false (failure).
    • If 3D-Secure verification succeeds, the payment continues, and the app completes the payment, using Update payment result to notify Genstore of the payment result.
  5. Genstore responds with HTTP code 200 (OK), confirming the payment status has been updated.
  6. The customer continues with the checkout process.

Offsite payments

For scenarios where the customer needs to be redirected to an external page to complete the payment, the offsite payment model is used.

Process steps

  1. The customer completes checkout on Genstore, triggering the payment request.
  2. Genstore sends a request to the payment app, including the amount and currency information.
  3. The payment app responds with HTTP 200 (OK) and returns the redirect URL for the payment page hosted by the app.
  4. Genstore redirects the customer to this URL.
  5. The customer completes the payment on the external page, and the payment app collects the payment credentials and processes the payment.
  6. The payment app calls the Update payment result API:
    • If the payment is complete -> Update as true (success) or false (failure), and retries as needed.
    • If the payment is pending from a third party (customer/payment partner/payment network) -> Initially set as processing.
  7. Genstore returns HTTP code 200 (OK) with the redirect URL.
  8. The payment app redirects the customer back to Genstore.
  9. The customer continues with the checkout process.