Keys and Parameters

scenarioCode

When using the Unified Payment API, merchants need to pass in a scenarioCode to specify the payment scenario as needed.

Online Payments

Parameter Description

Create a QR Code order ONLINE_QRCODE

QR Code orders are suitable for payment via PC and mobile browsers. Customer pay by scanning QR code with WeChat or Alipay.

Payment Methods
  1. Pay by scanning the QR code generated from merchant payment page. Using:
    • paymentQRImage: Base64-encoded QR code image, this can be directly used as the "src" attribute of the "img" tag;
    • paymentUrl: Payment URL that can be used to generate the QR code.
  2. Using payUrl for redirecting to AlphaPay payment page.

Create a UnionPay/Alipay online web order ONLINE_WEB

Used for Alipay and UnionPay payments on the PC end, after creating an order, redirect to the returned payUrl (need to add redirect query parameter) to complete the payment. Currently supports Alipay and UnionPay.

Payment Method

Using payUrl for redirecting to UnionPay/Alipay payment page.

Create a JSAPI order JSAPI

JSAPI is suitable for making payments through web pages opened within the WeChat or Alipay app. After placing an order, the user is redirected to the AlphaPay payment page and to complete payment.

Payment Method

Using payUrl for redirecting to AlphaPay payment page.

Create a Native JSAPI order NATIVE_JSAPI

To use the Native JSAPI, the WeChat Official Account needs to be verified, and the binding of the appid is required. Creating an order through AlphaPay using Native JSAPI will return the parameters that can be passed to WeChat/Alipay official JSAPI to initiate payment.

Payment Method

After obtaining the sdkParams, pass the parameters to built-in JSBridge in WeChat and Alipay browsers to initiate payment. For more details, please refer to: WeChat Integration Documentation, Alipay Integration Documentation.

Create a H5 order ONLINE_WAP

Note: Additional application is required for WeChat H5 payment
H5 payment is suitable for mobile App or mobile browser payment scenarios. After placing an order, the user's browser will be redirected to the payment page of WeChat, UnionPay, or Alipay and automatically launch the corresponding client to complete the payment.

Payment Method

Using payUrl for redirecting to AlphaPay payment page.

Create a SDK order APP

This approach is designed for mobile APP to initiate payment requests using WeChat/Alipay/UnionPay SDK. After creating an order through the API, the WeChat/Alipay/UnionPay SDK parameters will be returned, which are then passed to the corresponding SDK to initiate payment requests. The payment result is returned directly by the WeChat/Alipay/UnionPay client.

It is highly recommended to call the AlphaPay order query API to confirm the completion of payment after obtaining the payment result, then continue to proceed with the subsequent process. So that to avoid any funding loss caused by automatic cancellation due to timeouts.

Payment Method

After obtaining the sdkParams, pass the parameters to the SDK to initiate WeChat/Alipay payment, and the payment result will be directly returned by the WeChat/Alipay client.

Click to download UnionPay SDK, demo and user guidance: Android, IOS. Pass the acquired sdkParams as the tn parameter into UPPayAssistEx.startPay(activity, null, null, tn, serverMode) to initiate the payment.

Create a mini-programs order MINI_APP

To integrate with WeChat mini-program, the overseas entity authentication process must be completed, and the authenticated entity must be consistent with the merchant entity registered on AlphaPay. This approach is used to initiate payment in mini-programs by passing the parameters returned by the API after creating an order. This interface supports WeChat and Alipay mini-programs.

Payment Method

After obtaining the sdkParams, use them to integrate with WeChat mini-program payment. For more details, please refer to WeChat mini-program Integration Documents, Alipay mini-program Integration Documents.

The credit card order CREDIT_CARDMerchants can integrate credit card payment method on their website, where users can input card number, expiration date, CVV, and other information to complete the payment.

In-store Payments

Parameter Description

Create an offline QR code payment - Show QR code OFFLINE_QRCODE

Offline QR Code payment is used to integrate with cashier terminals without a scaner. After placing an order, the QR code URL and image scr is obtained. The QR code image will be displayed on the cashier terminals l screen. The customer uses the corresponding payment client to scan the QR code and complete the payment.

Payment Method

The customers scan the generated QR code by using the WeChat or Alipay mobile app to access the AlphaPay payment page.

Create a offline payment - Scan payment code OFFLINE

The offline payment order interface is used for docking with cashier terminals equipped with scanners. After the merchant enters the amount, the customer is required to present the payment code, and a scanner is used to scan the code, then the scanned content and amount are submitted together to complete the payment operation. The offline payment order interface is now compatible with WeChat, Alipay, and UnionPay QuickPass.

Payment Method

Merchants use a barcode scanner to scan the customer's payment code to complete the payment.

paymentStatus

The payment status returned by querying a payment order.

Parameter Description
PAYMENT_IN_PROCESSWaiting for payment to be completed
CLOSEDPayment order is closed
FAILEDOrder creation is failed or payment is failed
SUCCESSPayment succeeded
PARTIAL_REFUNDPartially refunded
FULL_REFUNDFully refunded

refundStatus

The refund status of an order returned by querying a refund order.

Parameter Description
REFUND_IN_PROCESSThe refund is being processed
SUCCESSRefund submission succeeded AND refund processing succeeded
FAILEDRefund submission failed OR refund processing failed

resultCode

Description code of business processing result

Parameter Description
PAYMENT_IN_PROCESSPayment is processing
ORDER_MISMATCHOrder ID does not match the merchant
ORDER_PAIDOrder has been paid
SYSTEMERRORThe system encounters an internal exception/error.
INVALID_MERCHANT_CODEInvalid merchant code or no corresponding merchant found
SIGN_TIMEOUTSignature timeout, the 'time' field differs from the server time by more than 5 minutes
INVALID_SIGNInvalid signature
PARAM_INVALIDThe parameters do not meet the requirements, and specific details can be referred to in the resultMessage field
INVALID_METHOD_TYPEInvalid payment channel name. Please check the case sensitivity
EXIST_PROCESSING_REFUNDThis order has a refund request being processed, please try again later
REFUND_VALID_DATE_EXCEEDThe refund request is invalid as it has exceeded the valid date, which allows refunds up to one year from the date of the order.
REFUND_NEED_REVIEWYour refund request has been submitted. Please wait for the system to review it. Contact customer service at 1-855-937-7888
INVALID_REFUND_AMOUNTRefund amount is incorrect. Please modify and try again.
REFUND_NOT_ENOUGH_BALANCEYou do not have enough unsettled balance to complete the refund. If you have any questions, please contact AlphaPay at 1-855-937-7888
FULL_REFUND_COMPLETEDThis order has been fully refunded.
INVALID_PAYMENT_CODEPayment code is invalid

resultStatus

The status of an API call, currently having: S F U

  • S: API call succeeded.
  • F: API call failed, the resultMessage field will provide a detailed description of the error, which could be caused by either the merchant or the platform, when an error occurs during API invocation.
  • U: In cases where the handling result is unknown or in an intermediate state. Such as receiving a PAYMENT_IN_PROCESS status after submitting a payment order, the query interface can be used to confirm the status of the payment result.