CUP Banks
Overview
CUP Banks 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 | Not supported on mobile devices |
Onboarding and access fee | Refer to your ecommpay key account manager |
Interaction diagram
Payment processing by using the CUP Banks payment method requires merchant's web service, one of ecommpay interfaces, and the ecommpay payment platform, as well as the CUP Banks service.
Operations support
Interfaces | Amounts, CNY* | Times** | ||||||
---|---|---|---|---|---|---|---|---|
Payment Page | CMS Plug-ins | Gate | Dashboard | minimum | maximum | basic | threshold | |
Purchases | + | – | + | – | 100,00 | 100 000,00 | 5 minutes | * |
Payouts | – | – | + | – | 100,00 | 49 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 Banks method, purchases and payouts follow different processing procedures. To perform a purchase operation, you need to redirect customer to the CUP Banks 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 Banks method supports to process payouts. Banks have their own IDs, which are used to initiate payouts by using Gate. The IDs are not used to initiate purchases by using Gate because the customer selects the bank on the CUP Banks service side.
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 Banks. 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 Banks 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 Banks method from the list of other payment methods on Payment Page or have Payment Page opened with CUP Banks 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 CUP Banks payment method and agrees to use the method (or accepts the method already selected on Payment Page and agrees).
- The payment platform receives the purchase request for payment processing in the CUP Banks service.
- The payment platform performs the internal purchase request processing and sends it to the CUP Banks service.
- The purchase request is processed on the CUP Banks side.
- The CUP Banks service generates the data for redirecting the customer to the CUP Banks form and sends it to the payment platform.
- The payment platform sends to Payment Page the data for redirecting the customer to the CUP Banks service.
- The customer is redirected to the CUP Banks service.
- The customer selects online banking.
- The customer is redirected to the online banking page.
- The customer completes required steps to perform purchase.
- The payment is processed on the CUP Banks side.
- CUP Banks 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 Banks payment method and provide the information on the format of callbacks with payment results. For the general information on how to use the API, seePayment Page API Description.
Request format
There are several things you must consider when using the CUP Banks 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_amount—payment amount in minor units
- payment_currency—payment currency in ISO-4217 alpha-3 format
- 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 Banks method selected, set the force_payment_method parameter to
cup-bank
. - The currency of payment can only be CNY.
- 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 Banks 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 Banks method, see Parameters for opening payment form.
Callback format
In the CUP Banks method, the callbacks that deliver purchase results use the standard format described in Callbacks.
Here is an example of callback with an information about successful 100.00 CNY
purchase made by the 1
customer in the 200
project.
Figure: Example of a successful purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_15528942647389318", "type": "purchase", "status": "success", "date": "2019-03-19T15:22:05+0000", "method": "cup-bank", "sum": { "amount": 10000, "currency": "CNY" }, "description": "ECT_TEST_1552894260335" }, "customer": { "id": "1" }, "operation": { "id": 24276000000595, "type": "sale", "status": "success", "date": "2019-03-19T15:22:05+0000", "created_date": "2019-03-19T15:18:11+0000", "request_id": "6cb000fda4402cabff6b7a4c7f9f301eec3d8d52", "sum_initial": { "amount": 10000, "currency": "CNY" }, "sum_converted": { "amount": 10000, "currency": "CNY" }, "provider": { "id": 1129, "payment_id": "4RrI6DNXLhRWZuMKnOd4MqFd9yPDw4Yk", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "H9j5S+t+jKeVs717ET765vHJKIISkNb4YdkIemQDjTMKlH eskFU6OjIlIzvgnJCFhJxiKNLstiVoAUrWbDAHSQ==" }
The following example of callback is for a payment rejected due to insufficient funds on customer account.
Figure: Example of a declined purchase callback
{ "project_id": 580, "payment": { "id": "ECT_TEST_155323309979211", "type": "purchase", "status": "decline", "date": "2019-03-22T09:31:57+0000", "method": "cup-bank", "sum": { "amount": 10000, "currency": "CNY" }, "description": "ECT_TEST_155323309979211" }, "operation": { "id": 26532000000672, "type": "sale", "status": "decline", "date": "2019-03-22T09:31:57+0000", "created_date": "2019-03-22T07:31:24+0000", "request_id": "6d9a19b81c63625ea59aa40eb19ac3700516133aabcea87485c3", "sum_initial": { "amount": 10000, "currency": "CNY" }, "sum_converted": { "amount": 10000, "currency": "CNY" }, "provider": { "id": 1180, "payment_id": "190322153143831000", "date": "2019-03-22T16:32:11+0000", "auth_code": "" }, "code": "20105", "message": "Insufficient funds on customer account" }, "signature": "y0tUj/I/c85dV/9ff47U1KDci68aGhP8Pt+YhWRXYKSFLDl mwMIT5kv/TzmCgQEWwUv1qyo1cdW+xeAoQMZqQbHA==" }
Related topics
The following topics might be useful when implementing payments through Payment Page:
Purchase by using Gate
General information
In the CUP Banks 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 Banks 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 when using Gate
- Customer initiates purchase on the merchant web service by using CUP Banks 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 Banks service.
- The purchase request is processed on the CUP Banks side.
- The CUP Banks service generates the data for redirecting the customer to the CUP Banks 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 Banks service.
- The customer is redirected to the CUP Banks service.
- The customer selects online banking.
- The customer is redirected to the online banking page.
- The customer completes required steps to perform purchase.
- The payment is processed on the CUP Banks side.
- The CUP Banks 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 Banks payment method and provide the information about formats of the data for redirecting customers and the information about the format of callbacks with payment results.
Request format
There are several things you must consider when using purchase requests in the CUP Banks method:- You send purchase request to /v2/payment/cup/bank/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—customer IP address
- first_name—first name in Chinese
- last_name—last name in Chinese
- phone—phone number without +,
- email—email address
- country—country of residence in the ISO 3166-1 alpha-2 format
- street—street of residence
- city—city 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
- 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.
Thus, a correct payment request in the CUP Banks method must include general information about request, payment, customer and URL for redirection, as shown in the following example:
Figure: Example of a purchase request
{ "general": { "project_id": 200, "payment_id": "ECT_TEST_1559106834731-9", "signature": "yzWwFC70Exu6K5UhylPzyh8/QORz6HjULx87emy3AybWK4...==" }, "customer": { "id": "123", "ip_address": "111.254.255.479", "first_name": "结算", "last_name": "结算", "street":"street", "city": "city", "zip": "123045607", "country": "CH", "phone": "120450780", "email": "test@email.com" } }, "payment": { "amount": 1000, "currency": "CNY", "description": "test payment" }, "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": { "method": "GET", "body": { merchantId: "0004", version: "v1", inputCharset: "UTF-8", merchantTradeId: "dslkjfhslkhfssdusk.jnk.s", currency: "CNY", payType: "EC", issuingBank: "UNIONPAY", amountFee: "502", deviceType: "WEB", goodsTitle: "结算款项", returnUrl: "https://www.funtopay.com/hefu/return/", notifyUrl: "https://www.funtopay.com/hefu/notify/", signType: "RSA", sign: "TZUmn8bhp7BO93V06JxJCaf5xi+Sne0eVfVOCt1mi6+YAdnY/IfbEBHC2yPXTRRGmquaKSE3uuiL6AfnOm dTtjJznRCw3Wo5jjfSwE0GkG+D25XlC712Et33l0TH+Gcf4QRiba6xOVlvPKpK0OK/svObtPpPr0o/q+8zTX+El6w=" }, "encrypted": [], "url": "http://payment.qixiqiang.com/payment/v3/unionpayIntGate.html" }
Callback format
The CUP Banks method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.
Here is an example of callback with an information about successful 100.00 CNY
purchase made by the 1
customer in the 200
project.
Figure: Example of a successful purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_15528942647389318", "type": "purchase", "status": "success", "date": "2019-03-19T15:22:05+0000", "method": "cup-bank", "sum": { "amount": 10000, "currency": "CNY" }, "description": "ECT_TEST_1552894260335" }, "customer": { "id": "1" }, "operation": { "id": 24276000000595, "type": "sale", "status": "success", "date": "2019-03-19T15:22:05+0000", "created_date": "2019-03-19T15:18:11+0000", "request_id": "6cb000fda4402cabff6b7a4c7f9f301eec3d8d52", "sum_initial": { "amount": 10000, "currency": "CNY" }, "sum_converted": { "amount": 10000, "currency": "CNY" }, "provider": { "id": 1129, "payment_id": "4RrI6DNXLhRWZuMKnOd4MqFd9yPDw4Yk", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "H9j5S+t+jKeVs717ET765vHJKIISkNb4YdkIemQDjTMKlH eskFU6OjIlIzvgnJCFhJxiKNLstiVoAUrWbDAHSQ==" }
The following example of callback is for a payment rejected due to insufficient funds on customer account.
Figure: Example of a declined purchase callback
{ "project_id": 580, "payment": { "id": "ECT_TEST_155323309979211", "type": "purchase", "status": "decline", "date": "2019-03-22T09:31:57+0000", "method": "cup-bank", "sum": { "amount": 10000, "currency": "CNY" }, "description": "ECT_TEST_155323309979211" }, "operation": { "id": 26532000000672, "type": "sale", "status": "decline", "date": "2019-03-22T09:31:57+0000", "created_date": "2019-03-22T07:31:24+0000", "request_id": "6d9a19b81c63625ea59aa40eb1954af0516133aabcea87485c3", "sum_initial": { "amount": 10000, "currency": "CNY" }, "sum_converted": { "amount": 10000, "currency": "CNY" }, "provider": { "id": 1180, "payment_id": "190322153143831000", "date": "2019-03-22T16:32:11+0000", "auth_code": "" }, "code": "20105", "message": "Insufficient funds on customer account" }, "signature": "y0tUj/I/c85dV/9ff47U1KDci68aGhP8Pt+YhWRXYKSFLDlwM IT5kv/TzmCgQEWwUv1qyo1cdW+xeAoQMZqQbHA==" }
Related topics
The following topics might be useful when implementing payments through Gate:
Payout by using Gate
General information
To perform a payout through the CUP Banks 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 Banks 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 Banks service.
- The payout is processed on the CUP Banks side.
- CUP Banks 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 Banks 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 Banks 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 Banks 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 Banks 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 215.00 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": 21500, "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": 21500, "currency": "CNY" }, "sum_converted": { "amount": 21500, "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_12897456238746287", "type": "payout", "status": "decline", "date": "2019-03-25T12:46:51+0000", "method": "ChinaUnionPay", "sum": { "amount": 10000, "currency": "CNY" }, "description": "" }, "account": { "number": "621661******6993" }, "customer": { "id": "1" }, "operation": { "id": 35102000000612, "type": "payout", "status": "decline", "date": "2019-03-25T12:46:51+0000", "created_date": "2019-03-20T11:45:09+0000", "request_id": "c44aae5ae361b649a6225994e626d6cd", "sum_initial": { "amount": 10000, "currency": "CNY" }, "sum_converted": { "amount": 10000, "currency": "CNY" }, "provider": { "id": 1129, "payment_id": "NqIy87k9SLcDRmkPa1JfM6cQZ53M", "date": "2019-03-25T12:46:49+0000", "auth_code": "" }, "code": "20106", "message": "Customer account is no longer available" }, "signature": "bSqa2y0QnfV6xc1WdSNiNPKZkj100QeSVqtVDRmJaPP...==" }
Related topics
The following topics might be useful when implementing payments through Gate:
Testing
General information
For the CUP Banks method the testing of purchases by using Payment Page and Gate as well as payouts by using Gate.
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 interfaces of the payment forms emulator of Payment Page and CUP Banks 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
When testing payouts, 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-bank
method was not specified in the request—select the method on the emulator page. - Specify the required data in the data entry fields.
- Click the Success or Decline button (depending on the amount specified in the request).
- Accept a callback with information about the payment result.
The full information about purchase process by using CUP Banks 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.
- 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.
The full information about purchase process by using CUP Banks through Gate is provided in the section Purchase by using Gate.
Payouts by using Gate
To perform a test payout by using Gate, send a correct test request to the payment platform and accept a callback with information about the payment result. The full information about payout process by using CUP Banks through Gate is provided in the section Payout by using Gate.
Analysis of payments results
As with other payment methods ecommpay offers, when using the CUP Banks 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.