You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
5.2 KiB

  1. # 获取authorization
  2. ---
  3. * {domain}/online/v3/secure-pay
  4. ### Request
  5. |参数名|M/C/O|描述|
  6. |---|---|---|
  7. |callbackUrl|O|客户端网页同步回调地址,支付完成后同步跳转,显示支付结果|
  8. |ipnUrl|M|交易结果异步通知地址|
  9. |amount|M|金额,字符串|
  10. |currency|M|标价币种|
  11. |settleCurrency|M|结算币种|
  12. |description|O|订单描述|
  13. |note|O|附言|
  14. |reference|M|商户系统交易请求流水号|
  15. |terminal|M|交易类型|
  16. |vendor|M|支付/收款方式|
  17. |verifySign|M|API请求签名|
  18. ```json
  19. {
  20. "amount": "100",
  21. "callbackUrl": "https://example.com/webhook?transactionNo={transactionNo}&status={status}&amount={amount}&time={time}&reference={reference}&note={note}",
  22. "currency": "USD",
  23. "description": "029e9b9b0b4e5cae68bf559b6333f466",
  24. "ipnUrl": "https://example.com/webhook",
  25. "merchantNo": "202333",
  26. "note": "029e9b9b0b4e5cae68bf559b6333f466",
  27. "reference": "029e9b9b0b4e5cae68bf559b6333f466",
  28. "settleCurrency": "USD",
  29. "storeNo": "301854",
  30. "terminal": "YIP",
  31. "vendor": "creditcard",
  32. "verifySign": "ece4311b16c46435af3fb974ddbc2d43"
  33. }
  34. ```
  35. ### Response
  36. * authorization是用来在付款页面调用braintree js sdk,用户填信用卡信息
  37. * [HTML付款页面示例](./static/braintree-sample.html)
  38. |参数名|M/C/O|描述|
  39. |---|---|---|
  40. |authorization|M|令牌,用于调用braintree JS SDK|
  41. |transactionNo|M|订单号|
  42. ```json
  43. {
  44. "result":
  45. {
  46. "amount": "100.00",
  47. "authorization": "eyJraWQiOiJ6dSIsImFsZyI6IlJTMjU2In0.eyJmbHgiOnsicGF0aCI6Ii9mbGV4L3YyL3Rva2VucyIsImRhdGEiOiJkVnc4amZSc2ZFQVI2VWlyVFBWcVhCQUFFR09OZkVZZmNxVjZyeUttOHU4Lzh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M6Ly90ZXN0ZmxleC5jeWJlcnNvdXJjZS5jb20ifSwidHlwZSI6Im1mLTEuMC4wIn1dLCJpc3MiOiJGbGV4IEFQSSIsImV4cCI6MTY2NjIzODk3NiwiaWF0IjoxNjY2MjM4MDc2LCJqdGkiOiJYZDRERkpjbWhhTlFDelZ5In0.NdmRXIJEFqOFbYudB3Cm7xky5bqu5TiXnliGizaMbe3MvrnuHmEjmWo_eS4tjeUbDvx6iw8T2hDnnJEZXf6B6UKhTM5n40tl8mh4k0Rp-JXsvKeG-rvfzuN6IpPAdFwfKxGvAFahT5_hv38l0TjKlr_4eJs-LR-F3WY_-FmnUmbZMVzGvNPE01g_JB77j1l48hSbjv7uV3PR5_3j40cqRsQe2OTgutJxen7p2JrVcURHYKs1vZNG5o8nyXo06rIQKCZU4FR0lF2RymO336IjcjLMQebvVGFndSB7KnODQru9f4qAwzSkYCxLSUa0p7U7DdRIldOsw4-svP70-NKLBQ",
  48. "currency": "USD",
  49. "reference": "029e9b9b0b4e5cae68bf559b6333f466",
  50. "timestamp": "2022-10-20T03:54:36Z",
  51. "transactionNo": "302605577756087512"
  52. },
  53. "ret_code": "000100",
  54. "ret_msg": "success"
  55. }
  56. ```
  57. # 确认付款
  58. ---
  59. * {domain}/creditpay/v3/process
  60. ### Request
  61. |name|value|
  62. |---|---|
  63. |Credit Card|credit_card|
  64. |PayPal|paypal_account|
  65. |Venmo|venmo_account|
  66. |Google Pay|android_pay_card|
  67. |Apple Pay|apple_pay_card|
  68. |SAMSUNG Pay|samsung_pay_card|
  69. |参数名|M/C/O|描述|
  70. |---|---|---|
  71. |deviceData|M|braintree sdk获取到的客户端设备信息,参见html示例代码|
  72. |paymentMethod|M|支付方式|
  73. |paymentMethodNonce|M|支付令牌,从braintree sdk获取得到|
  74. |transactionNo|M|订单号,从secure-pay返回得到|
  75. |addressLine1|O|address line 1|
  76. |addressLine2|O|address line 2|
  77. |city|O|city|
  78. |state|O|state|
  79. |postalCode|O|邮编|
  80. |country|O|country|
  81. |countryCode|O|countryCode, e.g. CN|
  82. |email|O|email|
  83. |firstName|O|firstName|
  84. |lastName|O|lastName|
  85. ```json
  86. {
  87. "addressLine1": "123 main st",
  88. "addressLine2": "",
  89. "city": "Hometown",
  90. "country": "United States of America",
  91. "countryCode": "US",
  92. "deviceData": "{\"correlation_id\":\"536e2d7c63f918ae8b2eb0cb5ee1eee3\"}",
  93. "email": "[email protected]",
  94. "firstName": "John",
  95. "lastName": "Doe",
  96. "merchantNo": "202333",
  97. "paymentMethod": "credit_card",
  98. "paymentMethodNonce": "tokencc_bf_ks72qn_fwtdcm_56ynkm_ckx8n2_2z2",
  99. "postalCode": "90012",
  100. "state": "CA",
  101. "storeNo": "301854",
  102. "transactionNo": "302607078131745403",
  103. "verifySign": "91a7786e708668ca35a5197bbea237cc"
  104. }
  105. ```
  106. ### Response
  107. ```json
  108. {
  109. "result":
  110. {
  111. "reference": "31d59e06821dbf31e14569f44bac976a",
  112. "amount": "100.00",
  113. "supUserid": "1111",
  114. "transactionNo": "302607078131745403",
  115. "vendorId": "b2sewrxq",
  116. "currency": "USD",
  117. "paymentTime": "2022-10-20T04:19:56Z",
  118. "status": "success"
  119. },
  120. "ret_msg": "success",
  121. "ret_code": "000100"
  122. }
  123. ```