CUP P2P
Overview
CUP P2P is payment method that supports payments by using online banking and branded China UnionPay (CUP) payment cards issued by Chinese and foreign banks within the international payment system CUP. You can perform purchases through this method by using Payment Page and Gate, payouts by using Gate.
General information
Payment method type | bank payments |
---|---|
Payment instruments | payments cards |
Countries and regions | China |
Payment currencies | CNY |
Currency conversion | – |
Purchases | + |
Payouts | + |
Stored credentials payments | – |
Full refunds | – |
Partial refunds | – |
Chargebacks | – |
Notes | Cascade payment processing is supported for working with this method by using Payment Page. For more information, see Cascade payment processing or contact your ecommpay key account manager |
Onboarding and access fee | Refer to your ecommpay key account manager |
Interaction diagram
Payment processing by using the CUP P2P payment method requires merchant's web service, one of ecommpay interfaces, and the ecommpay payment platform, as well as the CUP P2P service.
Operations support
Interfaces | Amounts, CNY* | Times** | ||||||
---|---|---|---|---|---|---|---|---|
Payment Page | CMS Plug-ins | Gate | Dashboard | minimum | maximum | basic | threshold | |
Purchases | + | – | + | – | 600.00 | 49,000.00 | * | * |
Payouts | – | – | + | – | 10.00 | 44,999.00 | * | * |
* For more information ecommpay refer to your key account manager.
- The basic time is the average estimated time between the moment a payment is initiated in the payment platform to the moment the payment result is sent to the initiator. The basic time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour (if any input from customer is required). Use the basic time to estimate when to react to the absence of payment result notifications or when to check payment status.
- The threshold time is the maximum possible time between the moment a payment is initiated in the payment platform to the moment the initiator receives the callback with the payment result. A payment is automatically declined, if its waiting time exceeds the threshold time. For individual setting of the threshold time limit, contact ecommpay technical support.
Processing scenarios
In the CUP P2P method, purchases and payouts follow different processing procedures. To perform a purchase operation, you need to redirect customer to the CUP P2P service, while to initiate a payout, you need to notify customer via merchant's web service.
Figure: Payment by using Payment Page
Figure: Payment by using Gate
Figure: Payout by using Gate
Supported banks
The section provides information about the banks the CUP P2P method supports to process payouts. Banks have their own IDs, which are used to initiate payouts by using Gate.
The following table contains information about banks and their IDs. The information is presented for informational purposes only, therefore for detailed information about banks and their IDs, contact your ecommpay Key Account Manager or send a request to Gate API
/v2/info/banks/{payment_method}/{operationType}/list by using POST method: /v2/info/banks/chinaunionpay/payout/list
to receive the list of banks that support payout performing.
The request must contain the project and payment IDs, signature, currency, and payment amount, as shown in the example. It is important to specify real payment data, but if the payment has not yet been generated, you can specify a random value for the payment ID in the request.
Figure: Example of requesting a list of banks
{ "general": { "project_id": 200, "payment_id": "ORDER_155860015", "signature": "K6jllym+PtObocZtr345st...==" }, "payment": { "amount": 1000, "currency": "CNY" } }
Bank | ID |
---|---|
Agricultural Bank Of China | 1 |
Agricultural Development Bank of China | 1921 |
Anhui Rural Credit Cooperatives Association | 278 |
Anshan City Commercial Bank | 276 |
Asiana Bank | 277 |
Bank of Beijing Co., Ltd | 5 |
Bank Of Chengdu | 7 |
Bank Of China | 6 |
Bank Of Chongqing | 55 |
Bank of Communications | 2 |
Bank of Dalian | 574 |
Bank of Dongguan | 40 |
Bank Of East Asia | 3 |
Bank of Fushun | 1971 |
Bank of Hangzhou | 311 |
Bank Of Jiangsu | 24 |
Bank of Nanjing | 26 |
Bank of Ningbo | 25 |
Bank Of Qingdao | 349 |
Bank Of Qinghai | 55501 |
Bank of Tianjin | 363 |
Baoshang Bank | 279 |
Beibu Gulf Of Guangxi | 37 |
Beijing Rural Commercial Bank | 4 |
Beijing Shunyi Ginza Village Bank | 281 |
Changan Bank | 286 |
Changsha Bank | 283 |
Changshu Rural Commercial Bank | 288 |
Chengde Bank | 284 |
Chengdu Rural Commercial Bank | 38 |
China Citic Bank | 12 |
China Construction Bank | 9 |
China Everbright Bank | 10 |
China Guangfa Bank | 178 |
China Merchants Bank | 13 |
China ZheShang Bank | 15 |
Chongqing Qianjiang Yinzuo Village Bank | 285 |
Chongqing Rural Commercial Bank | 39 |
Chongqing Yinbei Ginza Village Bank | 290 |
Citibank China | 1961 |
Corporate Banking (China) | 287 |
Deyang Bank | 294 |
Dongguan Rural Commercial Bank | 293 |
Dongying Bank | 291 |
Dongying Lai Shangcun Town Bank Co., Ltd. | 292 |
Foshan Shunde Rural Commercial Bank | 841 |
Fudian Bank | 42 |
Fujian Rural Credit Cooperative Union | 297 |
Fujian Straits Bank | 298 |
Fuxin Bank | 295 |
Guangdong Development Bank | 17 |
Guangdong Huaxing Bank | 303 |
Guangdong Nanyue Bank | 301 |
Guangdong Nongxin | 55451 |
Guangdong Rural Commercial Bank | 55461 |
Guangdong Rural Credit Cooperative | 861 |
Guangzhou Bank | 576 |
Guangzhou Rural Commercial Bank | 305 |
Guilin Bank Co., Ltd. | 300 |
Guiyang Bank | 304 |
Haikou United Rural Commercial Bank Co., Ltd. | 315 |
Hainan Rural Credit Cooperative | 314 |
Handan Commercial Bank | 309 |
Hangzhou United Rural Commercial Bank | 1951 |
Hankou Bank | 19 |
Harbin Bank | 308 |
Hebei Bank | 43 |
Henan Agricultural Credit Union | 55471 |
Hengshui Bank | 312 |
HSBC China | 1911 |
Hua Xia Bank Co., Ltd | 21 |
Hubei Bank | 306 |
Hubei Rural Credit | 313 |
HuiShang bank | 20 |
Huludao Bank | 310 |
Huzhou Bank | 921 |
HZB | 22 |
Industrial and Commercial Bank of China | 23 |
Industrial Bank | 11 |
Inner Mongolia Bank | 316 |
Ji Bank | 336 |
Jiangsu Changjiang Bank | 55481 |
Jiangsu Rural Credit Cooperatives Association | 326 |
Jiangxi Ganzhou Yinza Village Bank | 328 |
Jiangxi Rural Credit Cooperatives | 961 |
Jiangxi Sheng | 18 |
Jiangyin Rural Commercial Bank | 320 |
Jilin Bank | 323 |
Jilin Sheng | 16 |
Jincheng Bank | 319 |
Jining Bank | 324 |
Jinshang Bank | 1001 |
Jinzhou Bank | 329 |
Jiujiang Bank | 45 |
KEB Bank(China) | 1941 |
Kunlun Bank | 331 |
Kunshan Rural Commercial Bank | 332 |
Lai Shang Bank | 337 |
Langfang Bank | 334 |
Liuzhou Bank | 341 |
Longjiang Bank | 335 |
Luohe Commercial Bank | 55491 |
Luoyang Bank | 339 |
Luzhou Bank | 340 |
Luzhou Bank | 391 |
Mianyang City Commercial Bank | 342 |
Minsheng Bank | 14 |
Mizuho Industrial Bank | 1931 |
Nanchang Bank | 343 |
Nanchong City Commercial Bank | 344 |
Ningbo Tongshang Bank Co. Ltd | 345 |
Ningxia Bank | 47 |
Ordos Bank | 346 |
Panzhihua City Commercial Bank | 347 |
Ping An Bank | 27 |
Pingdingshan Bank | 348 |
Postal Savings Bank of China | 28 |
Qishang Bank | 49 |
Rizhao Bank | 50 |
Shandong Agricultural Union | 354 |
Shang Rao Bank | 357 |
Shanghai Bank | 31 |
Shanghai Pudong Development Bank | 32 |
Shanghai Rural Commercial Bank | 33 |
Shaoxing Bank | 359 |
Shengjing Bank | 52 |
Shenzhen Futian Ginza Village Bank | 356 |
Shenzhen Qianhai Weizhong Bank | 361 |
Shenzhen Rural Commercial Bank | 392 |
Shinhan Bank China | 355 |
Sichuan Provincial Associated Press | 360 |
Suzhou Bank | 362 |
Tai’An City Commercial Bank | 1181 |
Taicang Agricultural Firm | 365 |
Taiwan Sheng | 30 |
Taizhou Bank | 367 |
Texas Bank | 366 |
The Bank of Bohai | 8 |
The Central Bank | 387 |
Tianjin Rural Commercial Bank | 364 |
Tianjin Shi | 29 |
Urumqi Commercial Bank | 368 |
Weifang Bank | 370 |
Weihai City Commercial Bank | 369 |
Wenzhou Bank | 34 |
Woori Bank | 372 |
Wuhan Rural Commercial Bank | 371 |
Wujiang Rural Commercial Bank | 373 |
Xiamen Bank | 54 |
Xi'an Bank | 375 |
XTB | 188 |
Yantai Bank | 379 |
Yellow River Rural Commercial Bank | 378 |
Yingkou Bank | 376 |
Yingkou Rongsheng Rural Commercial Bank | 55511 |
Yinzhou Bank | 338 |
Yunnan Rural Credit Cooperatives | 377 |
Zaozhuang Bank | 390 |
Zhangjiagang Rural Commercial Bank | 383 |
Zhangjiakou Commercial Bank | 189 |
Zhejiang Chouzhou Commercial Bank | 380 |
Zhejiang Internet Commercial Bank | 1281 |
Zhejiang Jingning Ginza Village Bank | 385 |
Zhejiang Mintai Commercial Bank | 386 |
Zhejiang Rural Credit Cooperative | 388 |
Zhejiang Sanmen Ginza Village Bank | 389 |
Zhejiang Tailong Commercial Bank | 46 |
Zhuhai China Resources Bank | 1331 |
Zigong City Commercial Bank | 1341 |
Payout regions
The region_id parameter is mandatory in the payout request through CUP P2P. Payout processing is supported in the regions provided in the table below.
Region name | Region ID |
---|---|
Anhui Sheng | 1 |
Beijing Shi | 2 |
Chongqing Shi | 3 |
Fujian Sheng | 4 |
Guangdong Sheng | 5 |
Gansu Sheng | 6 |
Guangxi Zhuangzu Zizhiqu | 7 |
Guizhou Sheng | 8 |
Henan Sheng | 9 |
Hubei Sheng | 10 |
Hebei Sheng | 11 |
Hainan Sheng | 12 |
Hong Kong SAR | 13 |
Heilongjiang Sheng | 14 |
Hunan Sheng | 15 |
Jilin Sheng | 16 |
Jiangsu Sheng | 17 |
Jiangxi Sheng | 18 |
Liaoning Sheng | 19 |
Macau SAR | 20 |
Nei Mongol Zizhiqu | 21 |
Ningxia Huizi Zizhiqu | 22 |
Qinghai Sheng | 23 |
Sichuan Sheng | 24 |
Shandong Sheng | 25 |
Shanghai Shi | 26 |
Shaanxi Sheng | 27 |
Shanxi Sheng | 28 |
Tianjin Shi | 29 |
Taiwan Sheng | 30 |
Xinjiang Uygur Zizhiqu | 31 |
Xizang Zizhiqu | 32 |
Yunnan Sheng | 33 |
Zhejiang Sheng | 34 |
The sections that follow provide detailed information about what you need to perform payments and how you can analyse the information on payments and operations.
Purchase by using Payment Page
General information
In the CUP P2P method, when processing a purchase by using Payment Page, the merchant web service is required to send a request with all the required parameters and signature to the ecommpay URL and get the callback with the result information from the payment platform. When opening Payment Page, you can either allow your customer to select the CUP P2P method from the list of other payment methods on Payment Page or have Payment Page opened with CUP P2P method selected. For more information about preselecting payment methods, see Preselecting payment methods.
The full sequence and particularities of the purchase process are provided below.
Figure: Purchase sequence when using Payment Page
- Customer initiates purchase by using the web service.
- The merchant web service sends to the specified ecommpay URL the purchase request for processing the purchase by using Payment Page.
- The payment platform receives the request for processing the purchase by using Payment Page.
- The payment platform performs the initial request processing that involves validation of the required parameters and signature.
- Requested Payment Page is generated into the ecommpay payment platform as specified in the project settings and the request parameters.
- Payment Page is displayed to the customer.
- The customer selects the CUP Card payment method and agrees to use the method (or accepts the method already selected on Payment Page and agrees).
- The bank card number entry form is displayed to the customer.
- The customer enters bank card number.
- The payment platform receives the purchase request for payment processing in the CUP P2P service.
- The payment platform performs the internal purchase request processing and sends it to the CUP P2P service.
- The purchase request is processed on the CUP P2P side.
- The CUP P2P service generates the data for redirecting the customer to the CUP P2P form and sends it to the payment platform.
- The payment platform sends to Payment Page the data for redirecting the customer to the CUP P2P service.
- The customer is redirected to the CUP P2P service.
- The payment instruction is displayed to the customer.
- The customer opens site of the online banking and acts in accordance with the instructions. Payment will be declined if customer uses another bank card for payment.
- The payment is processed on the CUP P2P side.
- CUP P2P service sends the payment result notification to the payment platform.
- The payment platform sends the callback to the web service.
- The payment platform sends payment results to Payment Page.
- A page with the payment result information is displayed to the customer.
The sections that follow discuss in more details the request format and the Payment Page parameters to use in the CUP P2P payment method and provide the information on the format of callbacks with payment results. For the general information on how to use the API, see Payment Page API Description.
Request format
There are several things you need to consider when using the CUP P2P method:
- You must provide values for the basic minimum of parameters. Listed below are the parameters that are mandatory for any payment method:
- customer_id—the unique ID of the customer within your project
- project_id—the project ID obtained from ecommpay
- payment_id—payment ID unique within the project
- payment_currency—payment currency in ISO-4217 alpha-3 format
- payment_amount—payment amount in minor units
- The currency of payment can only be CNY.
- There are two more mandatory parameters:
- language_code. In the language_code parameter, you must use
zh
code. - payment_description.
- language_code. In the language_code parameter, you must use
- If you need to have payment form displayed with the CUP P2P method selected, set the force_payment_method parameter to
cup-card
. - If required, you can also add any other additional parameters Payment Page supports.
- After you specify all the parameters you need, you must create the signature for the request. For instructions on how to sign a payment request, see Signature generation and verification.
Thus, a correct payment request in the CUP P2P method must include project, customer and payment IDs, language code, the currency, amount, and description of a payment, as shown in the following example:
EPayWidget.run( { payment_id: 'TEST_154', payment_amount: 50000, payment_currency: 'CNY', payment_description: 'test payment', customer_id: '123', project_id: 581, language_code: 'zh', signature: "xq9k0XaXE0Ig0s%2B4%2BM2gtmkytwe3%2BP1pzXw%2BNPTTGrS%...==" } )
For information about all parameters available in the CUP P2P method, see Parameters for opening payment form.
Callback format
The CUP P2P method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.
The following is the example of a callback with an information about successful 500.00 CNY
purchase in the 200
project.
Figure: Example of a successful purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_15528942632552", "type": "purchase", "status": "success", "date": "2019-03-19T14:52:34+0000", "method": "cup-card", "sum": { "amount": 50000, "currency": "CNY" }, "description": "ECT_TEST_1582894260335" }, "account": { "number": "621661******6893" }, "customer": { "id": "1" }, "operation": { "id": 32895000000568, "type": "sale", "status": "success", "date": "2019-03-19T14:52:34+0000", "created_date": "2019-03-19T14:48:42+0000", "request_id": "f493ae438cf9e5851ba2ba4e884e698e99d2f17a", "sum_initial": { "amount": 50000, "currency": "CNY" }, "sum_converted": { "amount": 50000, "currency": "CNY" }, "provider": { "id": 1191, "payment_id": "xseHD8v0EsRw3vBuxXeVeDuPBvO7rdKT", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "Ai8OCc69Ik0J9S5HdzndRj6JqS4Z277vSF9V4aJIqfGKc19M ii2ELEp9EdcjpSfr7QvuHGqrxY4MS9B1gIrVCw==" }
The following is the example of a callback for a purchase declined due to insufficient funds on customer account.
Figure: Example of a declined purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_1553500003191", "type": "purchase", "status": "decline", "date": "2019-03-25T11:36:41+0000", "method": "cup-card", "sum": { "amount": 120000, "currency": "CNY" }, "description": "ECT_TEST_1553500003190" }, "account": { "number": "622200******7804" }, "customer": { "id": "1" }, "operation": { "id": 30988000000770, "type": "sale", "status": "decline", "date": "2019-03-25T11:36:41+0000", "created_date": "2019-03-25T11:34:38+0000", "request_id": "145339509e08a645f9af43ab22652af21d7d", "sum_initial": { "amount": 120000, "currency": "CNY" }, "sum_converted": { "amount": 120000, "currency": "CNY" }, "provider": { "id": 1191, "payment_id": "kz4YwSN8TdYrB8CSJVFIeFPdeHTvjcd7", "auth_code": "" }, "code": "20105", "message": "Insufficient funds on customer account" }, "signature": "vLYJr+04aF4Y0/Vc1CFMsTlb8hzSjZYCYicc76YmlDz f13OADccpMOAT+J1MIpmj0mE7RTmGU5FPSJYcqkpvbA==" }
Related topics
The following topics might be useful when implementing payments through Payment Page:
Purchase by using Gate
General information
In the CUP P2P method, when processing a purchase by using Gate, the merchant web service is required to do the following:
- Send a request with all the required parameters and signature to the ecommpay URL.
- Perform redirecting customer to the CUP P2P form.
- Get the callback with the payment result from the payment platform.
The following diagram provides the detailed picture of the payment processing procedure.
Figure: Purchase sequence when using Payment Page
- Customer initiates purchase on the merchant web service by using CUP P2P method.
- The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
- The payment platform receives the request for processing the purchase by using Gate.
- The payment platform performs the initial request processing that includes validation of the required parameters and signature.
- The payment platform sends to the web service response with request receipt confirmation and correctness check result.
- The payment platform performs the internal payment request processing and sends it to the CUP P2P service.
- The purchase request is processed on the CUP P2P side.
- The CUP P2P service generates the data for redirecting the customer to the CUP P2P form and sends it to the payment platform.
- The payment platform sends to the web service the callback that delivers the data for redirecting customer to the CUP P2P service.
- The customer is redirected to the CUP P2P service.
- The payment instruction is displayed to the customer.
- The customer opens site of the online banking and acts in accordance with the instructions. Payment will be declined if customer uses another bank card for payment.
- The payment is processed on the CUP P2P side.
- The CUP P2P service sends the payment result notification to the payment platform.
- The payment platform sends the callback to the web service.
- The customer receives the payment result from the web service.
The sections that follow discuss in more details the request format and the Gate parameters to use in the CUP P2P payment method and provide the information on the format of callbacks with purchase results.
Request format
There are several things you must consider when using purchase requests in the CUP P2P method:- You send purchase requests to /v2/payment/cup/cup-card/sale by using HTTP method POST.
- The following objects and parameters must be specified in any request:
- general—object that contains general request identification information:
- project_id—the project ID obtained from ecommpay
- payment_id—payment ID unique within the project
- signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
- customer—object that contains customer information:
- id—the unique ID of the customer within your project
- ip_address—IP address
- first_name—first name in Chinese
- last_name—last name in Chinese
- phone—phone number without +
- email—email
- country—country of residence (pass
CN
) - state—province of residence in Chinese
- city—city of residence in Chinese
- address—address of residence
- zip—postal code
- payment—object that contains purchase information:
- amount—purchase amount in minor units
- currency—purchase currency in ISO-4217 alpha-3 format
- description—description
- card—object that contains customer payment card information:
- pan—card number
- return_url—URL for redirection:
- success—in case of success
- general—object that contains general request identification information:
- The currency of purchase can only be CNY.
- If required, you can also add any other additional parameters Gate supports.
- After you specify all the parameters you need, you must create the signature for the request. For instructions on how to sign a payment request, see Signature generation and verification.
Thus, a correct payment request in the CUP P2P method must include general information about request, payment, and customer, card number, and URL for redirection, as shown in the following example:
{ "general": { "project_id": 200, "payment_id": "TEST_1559134591371-pz-2", "signature": "keNRGu/zTi7tB7T1HPmvelS7k6xZnJP6A8CpU74zrBdFd0...==" }, "customer": { "id": "123", "ip_address": "185.123.193.224", "email": "qwe@qw.qw", "state": "state", "city": "city", "address":"address", "country": "CN", "phone": "phone", "zip": "zip" "first_name": "伍", "last_name": "倩文", } }, "payment": { "amount": 1000, "currency": "CNY", "description": "test payment" }, "card": { "pan": "621661******6983" }, "return_url":{ "success" : "http://success.com" } }
Formats of the customer redirection data
To redirect a customer from the web service to the bank site, you must receive a callback from the payment platform containing the URL for redirection in the redirect_data.url parameter and data to be sent in the request body in the redirect_data.body parameter, and use these parameters when opening the bank’s HTML page using method specified in the redirect_data.method parameter. The data in redirect_data.body may be differ depending on the payment processing provider.
The following is the callback fragment containing the URL for purchase.
redirect_data: { body: { }, method: "GET", url: "https://api.plusdebit.com/pd/tld/pay/G4aQEmzRbtpUxFOMuJVSZCQM6Exq6LCs", encrypted: { key: 3, message: "28d5ea9205996902a0d314608de875f4aa8c00e8519916dc1bac7de61cbe2b6c" } }
Callback format
The CUP P2P method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.
The following is the example of a callback with an information about successful 600.00 CNY
purchase in the 200
project.
Figure: Example of a successful purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_15528942632552", "type": "purchase", "status": "success", "date": "2019-03-19T14:52:34+0000", "method": "cup-card", "sum": { "amount": 60000, "currency": "CNY" }, "description": "ECT_TEST_1582894260335" }, "account": { "number": "621661******6893" }, "customer": { "id": "1" }, "operation": { "id": 32895000000568, "type": "sale", "status": "success", "date": "2019-03-19T14:52:34+0000", "created_date": "2019-03-19T14:48:42+0000", "request_id": "f493ae438cf9e5851ba2ba4e884e698e99d2f17a", "sum_initial": { "amount": 60000, "currency": "CNY" }, "sum_converted": { "amount": 60000, "currency": "CNY" }, "provider": { "id": 1191, "payment_id": "xseHD8v0EsRw3vBuxXeVeDuPBvO7rdKT", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "Ai8OCc69Ik0J9S5HdzndRj6JqS4Z277vSF9V4aJIqfGKc19M ii2ELEp9EdcjpSfr7QvuHGqrxY4MS9B1gIrVCw==" }
The following is the example of a callback for a purchase declined due to insufficient funds on customer account.
Figure: Example of a declined purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_1553500003191", "type": "purchase", "status": "decline", "date": "2019-03-25T11:36:41+0000", "method": "cup-card", "sum": { "amount": 12000, "currency": "CNY" }, "description": "ECT_TEST_1553500003190" }, "account": { "number": "622200******7804" }, "customer": { "id": "1" }, "operation": { "id": 30988000000770, "type": "sale", "status": "decline", "date": "2019-03-25T11:36:41+0000", "created_date": "2019-03-25T11:34:38+0000", "request_id": "145339509e08a645f9af43ab22652af21d7d", "sum_initial": { "amount": 12000, "currency": "CNY" }, "sum_converted": { "amount": 12000, "currency": "CNY" }, "provider": { "id": 1191, "payment_id": "kz4YwSN8TdYrB8CSJVFIeFPdeHTvjcd7", "auth_code": "" }, "code": "20105", "message": "Insufficient funds on customer account" }, "signature": "vLYJr+04aF4Y0/Vc1CFMsTlb8hzSjZYCYicc76YmlDz f13OADccpMOAT+J1MIpmj0mE7RTmGU5FPSJYcqkpvbA==" }
Related topics
The following topics might be useful when implementing payments by using Gate:
Testing
General information
For the CUP P2P method the testing of purchases by using Payment Page and Gate is available.
Testing can be performed within a test project, to enable and disable the testing availability, contact ecommpay technical support via support@ecommpay.com.
When performing a test payment, take into account that you must specify the identifier of the test project in the requests, the currency can be only CNY, and the interfaces of the payment forms emulator of Payment Page and CUP P2P differ from the production environment.
Test payments statuses
When testing purchases, the final payment status is determined by the amount specified in the request:
decline
status with40000
or40400
amountsuccess
status with any other amount
Purchases by using Payment Page
To perform a test purchase by using Payment Page, do the following:
- Send a correct test request for Payment Page opening to the payment platform.
- If the
cup-card
method was not specified in the request—select the method on the emulator page. - Specify the required data in the entry fields. To specify the payment card number either a valid card number or a test number (
4111 1111 1111 1111
) can be used. - Click the Success or Decline button (depending on the amount specified in the request).
- Accept a callback with information about the payment result (such callback is sent 60 seconds after the page with the Success or Decline button is generated).
The full information about purchase process by using CUP P2P through Payment Page is provided in the section Purchase by using Payment Page.
Purchases by using Gate
To perform a test purchase by using Gate, do the following:
- Send a correct test request for purchase to the payment platform. To specify the payment card number either a valid card number or a test number (
4111 1111 1111 1111
) can be used. - Accept a callback with redirection data.
- Go to the received URL and click the Success or Decline button (depending on the amount specified in the request).
- Accept a callback with information about the payment result (such callback is sent 60 seconds after the callback with redirection data is generated).
The full information about purchase process by using CUP P2P through Gate is provided in the section Purchase by using Gate.
Payout by using Gate
General information
To perform a payout through the CUP P2P method, merchant's web service sends a request with all the required parameters and signature to ecommpay URL, and receives a callback with the payment result. The full sequence of the payout process is provided below.
Figure: Payout sequence by using Gate
- A customer orders a payout through the CUP P2P service.
- Merchant's web service sends the payout request for processing the payout by using Gate to the appropriate ecommpay URL.
- Gate redirects the request to the ecommpay payment platform.
- The payment platform performs all the necessary check and processes the request.
- The reply with the request processing results is sent to the merchant's web service. For more information, see Response format.
- The payment platform redirects the payout request to the CUP P2P service.
- The payout is processed on the CUP P2P side.
- CUP P2P sends the result notification to the payment platform.
- The payment platform sends a callback with the payment result to the web service.
- The customer receives the payout result from the web service.
The sections that follow discuss in more details the request format and the Gate parameters to use in the CUP P2P payment method and provide the information on the format of callbacks with payout results.
Request format
There are several things you must consider when using payout requests in the CUP P2P method:
- You perform payouts by sending the request to /v2/payment/chinaunionpay/payout by using HTTP method POST.
- The following objects and parameters must be specified in any request:
- general—object that contains general request identification information:
- project_id—the project ID obtained from ecommpay
- payment_id—payment ID unique within the project
- signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
- payment—object that contains purchase information:
- amount—purchase amount in minor units of the currency
- currency—purchase currency in ISO-4217 alpha-3 format
- description—payment description
- customer—object that contains customer information:
- id—identifier
- ip_address—IP address
- email—email
- state—province in Chinese
- city—city in Chinese
- country—country (pass
CN
) - phone—phone number without +
- zip—postal code
- street—address in Chinese
- first_name—first name in Chinese
- last_name—last name in Chinese
- card—object that contains card or account information:
- pan—card number (for some providers it is necessary to specify the bank account number of the customer, for more information refer to your ecommpay key account manager)
- account—object that contains customer bank account information:
- city—bank address city
- bank_id—bank identifier (for more detailed information about banks and their IDs, see Supported banks)
- region_id—bank region identifier (for more detailed information about banks and their IDs, see Payout regions)
- branch—bank branch (abbreviation)
- general—object that contains general request identification information:
- Additionally, to increase conversion, specify the customer.identify.doc_number parameter—the number of the identity document.
- The currency of payout can only be CNY.
- If required, you can also add any other additional parameters Gate supports.
Thus, a correct payout request in the CUP P2P method must include project and payment IDs, signature, currency and amount of the payout, customer and bank account details, and customer card number:
Figure: Example of a payout request
{ "general": { "project_id": 255, "payment_id": "TEST_15392667771145", "signature": "Uhka8CiYAlDlc2wRq60vlSmTTCb0Zp0KYV4NF0...==" }, "customer": { "id": "127", "ip_address": "185.123.193.224", "email": "qwe@qw.qw", "state": "state", "city": "city", "country": "CN", "phone": "phone", "zip": "zip", "street": "street", "first_name": "伍", "last_name": "倩文", "identify": { "doc_number": "23512361283" }, "payment": { "amount": 501, "currency": "CNY" }, "card": { "pan": "621661******6793" }, "account": { "bank_id": "123", "branch": "qwert", "city": "City", "region_id": "region_id" } }
Callback format
The CUP P2P method uses the standard format for callbacks to deliver payout results. For more information, see Callbacks.
Here is an example of callback with an information about successful 485.60 CNY
payout made for the 1
customer in the 200
project.
Figure: Example of a successful payout callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_1563863519243_test2-gate-4", "type": "payout", "status": "success", "date": "2019-08-28T08:44:51+0000", "method": "ChinaUnionPay", "sum": { "amount": 48560, "currency": "CNY" }, "description": "ECT_TEST_1563863519243" }, "account": { "number": "621799******3840" }, "customer": { "id": "1", "phone": "89102345678" }, "operation": { "id": 45343000001495, "type": "payout", "status": "success", "date": "2019-08-28T08:44:51+0000", "created_date": "2019-08-28T08:42:08+0000", "request_id": "c21daec7a134", "sum_initial": { "amount": 48560, "currency": "CNY" }, "sum_converted": { "amount": 48560, "currency": "CNY" }, "provider": { "id": 1321, "payment_id": "10019082821621938", "date": "2019-08-28T16:42:12+0000", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "aW/oS/l7RTlKabsqCZXs1zile11EIX8mkM3+gJfwddjvtszeiMXcU7...==" }
The following example of callback is for a payment rejected due to customer account being no longer available.
Figure: Example of a declined payout callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_122127637126536125", "type": "payout", "status": "decline", "date": "2019-03-22T14:02:44+0000", "method": "ChinaUnionPay", "sum": { "amount": 48560, "currency": "CNY" }, "description": "" }, "account": { "number": "621661******6993" }, "customer": { "id": "1" }, "operation": { "id": 32988000000665, "type": "payout", "status": "decline", "date": "2019-03-22T14:02:44+0000", "created_date": "2019-03-22T14:02:12+0000", "request_id": "b78ffab13002d994a6a572410b943ed110", "sum_initial": { "amount": 48560, "currency": "CNY" }, "sum_converted": { "amount": 48560, "currency": "CNY" }, "provider": { "id": 1191, "payment_id": "6UBPgonfNE4kjjPB6HoV5pjTdBo34Lni", "date": "2019-03-22T14:02:43+0000", "auth_code": "" }, "code": "20106", "message": "Customer account is no longer available" }, "signature": "rP/FoxRIdBJtMLKP5KAndJwmJHWQ3HXsDCpcbmaaqq...==" }
Related topics
The following topics might be useful when implementing payments through Gate:
Analysis of payments results
As with other payment methods ecommpay offers, when using the CUP P2P method, you have several options to analyse the information about payments and operations performed by using the method—alone or in conjunction with other methods.
You can load and analyse all the necessary information in Dashboard, for instance you can use the analytic panels on the Analytics tab to this end.
Also, you can export the information for further analysis by using third party analytical tools. The following options are available:
- Dashboard allows you to download reports in CSV and XLS formats—by using the tools on the Payments tab. You can perform export as a one-time download to your local computer or have payment data regularly exported and delivered to email addresses you specify.
- Data API allows you to have payment information exported in JSON format and delivered to a URL you specify. The payment information is exported by using the /operations/get queries.
If you have any further questions regarding payment data analysis, contact ecommpay technical support.