Prerequise

+ Partner code:  Code for partner, including four to six uppercase letters or numbers.(Please check the email when complianced by GlobePay; Or you can login the Manage System to check, “Configuration——Client Detail——Merchant Basic Info——Partner Code”)

+ Credential code: Partner credential code for development provided by GlobePay system. Keep it safe and never disclose it to the public. If compromised, contact us to change it.Partner credential code for development provided by GlobePay system. Keep it safe and never disclose it to the public. If compromised, contact us to change it.(Please check the email when complianced by Globepay to find it or log in to Management System click to Configuration——Client Detail——Payment Info——Gateway Credential)

Start

As the flow above, when user click PAY button, we will do follow steps:
+ Step 1: Create order: https://pay.globepay.co/docs/en/#api-QRCode-NewQRCode 

+ Step 2: Make the payment page: https://pay.globepay.co/docs/en/#api-QRCode-QRCodePay

Result

Common Issues

Invalid time format

If you get this error, please check parameter time in url. It should be integer number.

https://pay.globepay.co/api/v1.0/gateway/partners/17YHNG/orders/17YHNG20190810290620/pay?redirect=https%3A%2F%2Fbeautifulname.cn%2Fsuccess-page%2F%3Forder_id%3D17YHNG20190810101616&time=1565437922.34881&nonce_str=Sy1zxHXaxZkwztFnGkcRr3uZfuxsRA&sign=de3aa6e5fa5690c547bffb11beda6b913e35d78c3d331c93985cddc71542e496

Sign timeout

Your sign is timeout or your sign is not correct.

Please make sure you create correct sign string.

Sign Algorithm
Sign messages are required in each request for validation. Sign parameters are all attached to URL as query params, and the order is irrelevant.

Sign Program?

Connect 4 parameters with ‘&’ symbol into an original valid string. Escape value is not required.
valid_string=partner_code&time&nonce_str&credential_code

Parameters?

partner_code: Code for partner, including four to six uppercase letters or numbers.(Please check the email when complianced by GlobePay; Or you can login the Manage System to check, “Configuration——Client Detail——Merchant Basic Info——Partner Code”)
time: UTC timestamp in milliseconds. Take current timestamp of UTC. Data type is Long. The difference between time and GlobePay server time should be less than 5 minutes.
nonce_str: Random string. No limit for length. URL-Safe characters are required. The proposed length is 10-30 characters.
credential_code: Partner credential code for development provided by GlobePay system. Keep it safe and never disclose it to the public. If compromised, contact us to change it.Partner credential code for development provided by GlobePay system. Keep it safe and never disclose it to the public. If compromised, contact us to change it.(Please check the email when complianced by Globepay to find it or log in to Management System click to Configuration——Client Detail——Payment Info——Gateway Credential)
Sign the valid string with SHA256 and turn to lowercase Hex string
sign=hex(sha256(valid_string)).toLowerCase()

Include the time,nonce_str and sign into Query Param when calling api.
Example

valid_string=RPAY&1468691301081&aaf2a94c8c2d56d5b43a1a3d9d811102&pQ5Jc9eoTcsxqPY5uQ3p2WmvSy0zEYeP sign=64712672795f94fa3bfb2e88ac09cb75d09bcf8a3c3dcaa529d8290dd6587060

Test Page? https://pay.globepay.co/sign_test.html 

In my case, I used Second instead of Milisecond then the sign is timeout. I hope you will prevent this mistake.

Order not exists

You must create order then the customer can pay. The flow will be like this:

You can use the api in https://pay.globepay.co/docs/en/#api-QRCode-NewQRCode

Sign expired

This issue happen when you used same sign for 2 requests. In my case, i created 1 sign and use it to create order, after create order, i used the same site to create payment page.

Solution: Each request should use different sign string.

Invalid Channel:null

There are 2 types of channel: Alipay and Wechat. But in my case, i used wrong API, i used API https://pay.globepay.co/api/v1.0/retail_qrcode/ to create order. If you are paying via website, it should be api https://pay.globepay.co/api/v1.0/gateway/partners/

Success Project

+ https://choosemyenglishname.com