SparkPay OpenAPI Docs
English
  • English
  • 简体中文
English
  • English
  • 简体中文
  1. Integration Scenarios
  • Product Introduction
  • Quick Guide
    • Integration Preparation
    • Interface Signature Description
  • Must-Read for Integration
    • Interface Rules
    • Asynchronous Notification
    • Interface Error Codes
    • Network and Currency
  • Integration Scenarios
    • Payment
    • Close Order
  • API List
    • Payment Order Creation
      POST
    • Payment Order Query
      GET
    • Payment Order Closure
      POST
    • Payment Order Creation(Pro Edition)
      POST
    • Payment Order Query(Pro Edition)
      GET
  • Frequently Asked Questions
    • Notification Related Issues
    • Redirect Failure Issues
    • Interface Error Issues
    • Test Token Acquisition/Test Network Connection
  • Integration Example
    • Interface Signature Example - PHP
    • Interface Signature Example - Postman
  • Version Notes
    • Version Notes
  1. Integration Scenarios

Payment

Scenario Overview#

When a user places an order to buy a product and chooses to pay using SPARK, the merchant application needs to call the unified checkout payment interface to create a payment order, specify the payment account, and have the user log in to complete the payment.
SPARK supports the following two payment scenarios:
1.
Users paying merchants;
2.
Buyers within the merchant application paying sellers, with support for splitting payments among the merchant platform or other lower-level business roles.

Related Interfaces#

Payment Order Creation
Payment Order Query

Flowchart#

image.png
Key Steps Explained:
Step 2: After a successful order on the merchant platform, the merchant calls the payment platform's Payment Order Creation to generate a prepayment transaction and obtain the cashier payment link, cashier_url;
After the merchant calls the Payment Order Creation , there can be normal and abnormal return cases:
Normal Return: Returns cashier_url. The merchant can proceed to the next step using the returned cashier_url.
Abnormal Return: Returns an HTTP code or error code. The merchant can troubleshoot the reason based on the error code from the interface and take the next steps.
Steps 7-9: After the user successfully pays, the merchant can obtain the order status through two methods:
Method 1: Payment Result Notification. After the user successfully pays, the payment platform will sync the successful payment result back to the merchant in the form of a callback notification. The merchant's callback address needs to include the notify_url parameter when calling the payment platform's Payment Order Creation : If the merchant does not receive the callback notification due to network fluctuations or issues with the notify_url itself, they can proactively call the Payment Order Query API to retrieve the order status.
Modified at 2024-09-12 06:11:44
Previous
Network and Currency
Next
Close Order
Built with