Payment Products

Product Introduction

This document is the official integration manual for Trusty Payment APIs, tailored for technical architects, R&D engineers, testing engineers, and operation engineers who need to integrate Trusty's payment system with merchant systems (e.g., online shopping platforms, cash register systems, in-app e-commerce).

Note: It is recommended to read the following sections in order, as cross-references to "previous topics" and "upcoming content" are linked. Advanced reading of specific modules is allowed based on integration needs.

1. Payment Method Overview

Trusty provides 4 types of payment solutions, covering offline, in-app, web, and cross-scenario payment needs. Among them, In-App Payment is the most widely used. Below is a detailed introduction to each method, including technical logic, integration processes, and applicable scenarios (sorted by usage frequency).

2. Detailed Payment Methods

2.1 In-App Payment (Merchant App Embedded Payment) - Most Widely Used

  • Core Definition: The payer selects products and submits orders in the merchant's App, chooses "Trusty Payment", and completes payment by jumping to the Trusty Pay APP. As the most commonly used payment mode, it supports seamless integration with merchant App scenarios and maintains high conversion rates.
  • Technical Adaptation: Requires calling Trusty's Unified Order API and processing appUrl redirection; supports deep linking between merchant App and Trusty Pay APP; compatible with mainstream mobile systems (iOS/Android).
  • Integration Process:
    1. Payer selects products in the merchant's App → submits order → selects "Trusty Payment" (recommended to place the option in a prominent position on the payment page);
    2. Merchant backend calls Trusty's Unified Order API (carrying order details, merchant App ID, callback address, signature information, etc.);
    3. Trusty payment system verifies the request legitimacy → returns a valid appUrl (jump link) to the merchant backend;
    4. Merchant App invokes the appUrl to open the Trusty Pay APP and automatically fills in the order information (no need for the payer to re-enter);
    5. Payer enters the payment password (or uses biometric authentication such as fingerprint/face ID) to confirm payment;
    6. Trusty system deducts the amount → sends a payment success notification to the merchant backend via the pre-configured callback address (with signature to ensure data security);
    7. Merchant App refreshes the order status in real time and displays the payment result (success/failure) to the payer; for abnormal jumps, provide a "refresh payment status" or "retry payment" button.
  • Applicable Scenarios: In-app e-commerce (merchant's own App), in-app service payment (video membership, in-game recharge, cloud service subscription), App-based O2O transactions (food delivery, takeaway, ride-hailing), paid content purchase (e-books, online courses).
  • Advantage: Seamless user experience (no need to exit the merchant App), high payment conversion rate, supports complex order scenarios (installments, coupons, points deduction), and complete transaction data synchronization.

2.2 Quick Pay (Offline Barcode/QR Code Payment)

  • Core Definition: The payer displays the barcode/QR code generated on Trusty's Quick Pay page (within Trusty Pay APP), and the merchant scans it via a cash register or dedicated scanning device to complete direct payment.
  • Technical Adaptation: No need to call additional APIs (merchant only needs to connect to Trusty's scanning device SDK or cash register integration interface).
  • Integration Process:
    1. Merchant activates Quick Pay service and completes device binding in Trusty Merchant Background;
    2. Payer opens Trusty Pay APP → enters Quick Pay page → displays barcode/QR code;
    3. Merchant scans the code with a bound device → Trusty system verifies the payment information and deducts the amount;
    4. Merchant receives payment success notification (via callback or device feedback).
  • Applicable Scenarios: Offline physical stores (convenience stores, restaurants, supermarkets), vending machines, offline service scenarios (parking fees, ticket sales, scenic spot tickets).
  • Advantage: Fast payment speed, no need for payer to actively operate (only display the code), suitable for high-flow offline scenarios.

2.3 QR Code Payment (Merchant-Generated QR Code)

  • Core Definition: Merchant generates a unique transaction QR code based on Trusty Payment Protocol (carrying order information), and the payer scans the code via Trusty Pay APP to complete payment.
  • Technical Adaptation: Relies on Trusty's "Transaction QR Code Generation API" (see Unified Order API Module for details) to generate valid QR codes with order parameters.
  • Integration Process:
    1. Merchant backend calls Trusty's Transaction QR Code Generation API (carrying order ID, amount, merchant ID, expiration time, etc.);
    2. Merchant displays the generated QR code on web pages, physical posters, media ads, or cash register screens;
    3. Payer opens Trusty Pay APP → uses "Scan" function → scans the QR code;
    4. Trusty system verifies the order information → payer confirms payment (or deducts automatically for signed-up users with agreed settings);
    5. Merchant receives payment success callback from Trusty.
  • Applicable Scenarios: Physical store static payment (poster QR codes), web promotion payment (ads, article embedded codes), offline event payment (exhibition ticket sales, community group purchases).
  • Advantage: Low merchant hardware cost (no need for scanning devices), flexible deployment (supports both online and offline display), suitable for low-frequency payment scenarios.

2.4 Web Payment (Web Page QR Code Payment)

  • Core Definition: Merchant embeds a dynamic payment QR code (carrying order information) on the web page. The payer uses Trusty Pay APP's "Scan" function to scan the code and completes payment after passing Trusty's security verification.
  • Technical Adaptation: Relies on Trusty's Unified Order API to generate web-specific payment QR codes; supports real-time order status synchronization and timeout automatic invalidation.
  • Integration Process:
    1. Payer selects products on the merchant's web page → submits order → enters the payment page;
    2. Merchant backend calls Trusty's Unified Order API → generates a unique web payment QR code and displays it on the payment page (with countdown to prompt validity period);
    3. Payer opens Trusty Pay APP → uses "Scan" to scan the web QR code;
    4. Trusty system performs security checks (e.g., device binding verification, transaction risk control) → payer confirms payment;
    5. Trusty sends payment success callback to the merchant backend → web page automatically refreshes to display the payment result (supports manual refresh for network exceptions).
  • Applicable Scenarios: PC/mobile web shopping (e-commerce websites), web-based service payment (online education, software subscription, cloud hosting), web advertising conversion (promotional activity payment, membership registration).
  • Advantage: No need for the payer to install additional web plugins, high security (multi-layer risk control), compatible with both PC and mobile web pages.

3. Suggestions

3.1 Quick Selection Table

Business Scenario Recommended Payment Method Usage Frequency Key Technical Dependencies
Merchant App e-commerce/payment In-App Payment Highest Unified Order API + appUrl redirection + deep linking
Convenience store/restaurant checkout Quick Pay High Scanning device SDK / cash register integration interface
PC/mobile web shopping payment Web Payment Medium Unified Order API + web QR code generation
Physical store poster/online promotion payment QR Code Payment Medium Transaction QR Code Generation API

3.2 Glossary

  • Unified Order API: Trusty's core order creation interface, used to initiate payment requests for in-app/web/QR code payments.
  • appUrl: A jump link returned by Trusty, used to open the Trusty Pay APP from the merchant App (supports deep linking).
  • Callback Address: The URL provided by the merchant to receive payment status notifications from Trusty (requires signature verification to prevent data tampering).
  • Deep Linking: A technical solution that realizes direct jump between Apps, ensuring that the payer can quickly enter the Trusty payment page from the merchant App.

3.3 Common Issues (In-App Payment Focus)

  • Q: How to handle the situation where the payer fails to jump to the Trusty Pay APP during in-app payment?
  • A: 1. Ensure the merchant App has configured deep linking permissions (refer to the system-specific configuration guide in the Appendix); 2. Provide a "H5 payment fallback" option (call Trusty's H5 payment interface when App jump fails); 3. Add a prompt for "install Trusty Pay APP" for users who have not installed Trusty.
  • Q: How to ensure the security of order information during the in-app payment process?
  • A: 1. All API requests must carry a signature (generated by merchant key + order parameters) to prevent request forgery; 2. Use HTTPS protocol for data transmission; 3. Verify the callback signature to avoid fake payment success notifications.