Pockyt Checkout Integration Guide

Online Payments API Reference Overview

Sandbox Gateway Domain URL: https://mapi.yuansferdev.com
Production Gateway Domain URL: https://mapi.yuansfer.com

📘

Additional Resources

This guide provides detailed, step-by-step instructions for developers aiming to create a seamless payment experience for end users. Developers will understand how to facilitate a straightforward transaction process, from initiating payments to handling callbacks.

Solution Workflow and API Sequences

SecurePay API for Digital Wallet Payments: User Checkout Process

The SecurePay API by Pockyt facilitates payments through digital wallets, providing a smooth checkout experience for users. Here's a step-by-step breakdown of the process:

  1. Product Selection:

    • The user selects products for purchase on your platform and reviews the total amount due.
  2. Payment Method Selection:

    • The user opts for a digital wallet by selecting the corresponding icon of their preferred payment method on your site.
  3. API Request Initiation:

    • Upon choosing the digital wallet option, your web application triggers an API request to Pockyt's SecurePay API endpoint.
       curl \
      X POST 'https://mapi.yuansferdev.com/online/v4/secure pay' \ H 'Content Type: application/json' \
      data binary '{
      "merchantNo": "203797",
      "storeNo": "303714",
      "verifySign": "9ef8e509e0a6e1a4c5322891575a69dd",
      "currency": "USD",
      "settleCurrency": "USD",
      "amount": "0.5",
      "vendor": "wechatpay",
      "reference": "1698153188772",
      "terminal": "ONLINE",
      "ipnUrl": "https://t.seapig.co/webhooks",
      "callbackUrl": "https://t.seapig.co/completed",
      "note": "note",
      "timeout": "120",
      "goodsInfo": "[{\"goods_name\": \"test\",\"quantity\": \"1\",\"category\":
      \"DIGITAL_GOODS\",\"description\": \"testing\",\"amount\": \"0.5\",\"tax\": \"0\"}]", "clientIp": "127.0.0.1"
      }'
      
       {
      "result": {
      "amount": "0.50",
      "cashierUrl": "https://mapi.yuansferdev.com/app-redirect-record/yuansfer redirect-record/342127388232290055", User Completes Payment Here
      "currency": "USD",
      "reference": "1698153188772", "settleCurrency": "USD", "transactionNo": "342127388232290055"
      },
      "re_code": "000100", "ret_msg": "prepay success"
      }
      
  4. Redirection for Payment:

    • The user is then redirected to the payment page hosted by the digital wallet service they selected.

      //line 4 from the response sample above shows the "cashierUrl" 
      
      ...
      "cashierUrl": "https://mapi.yuansferdev.com/app-redirect-record/yuansfer redirect-record/342127388232290055", User Completes Payment Here
      
      
  5. Finalizing Payment:

    • On the digital wallet’s payment page, the user enters their credentials and confirms the payment.
  6. Post-Payment Process:

    • Following successful payment, the user is redirected back to a URL specified by you (the callback URL). Concurrently, payment notifications are dispatched to your specified Instant Payment Notification (IPN) URL for backend processing and confirmation.

This sequence outlines the user's journey from product selection through to payment confirmation, highlighting the key stages where Pockyt’s SecurePay API interacts with both the user and the merchant's application.

Important API Endpoints:

Description: SecurePay API serves as the cornerstone endpoint within Pockyt's Online Payment Processing product, catering to all scenarios, encompassing Pockyt Checkout and Server-to-Server Integrated Payments (YIP). Request and response structures can vary according to distinct use cases and implementations, necessitating reference to dedicated tutorials tailored to your desired checkout and payment flows

Description: The Register Customer API enables the generation of new customer profiles and provides a unique Customer Number, which is essential for future interactions with the SecurePay API, particularly in recurring payment workflows.

Description: The Register Customer API enables the generation of new customer profiles and provides a unique Customer Number, which is essential for future interactions with the SecurePay API, particularly in recurring payment workflows.

Description: Update Customer Info API is exclusively designed for modifying customer contact information. It serves as a dedicated endpoint for updating customer details such as their contact information. It's important to note that this API is not intended for altering payment credentials, as this functionality should be handled separately through the Update Token API.