跳到主要内容

概述

托管结账 (Hosted Checkout):用户会重定向到Oceanpayment安全、托管的支付页面完成交易。这是最快速、简单的集成方式。

托管结账(Hosted Checkout)

Oceanpayment托管结账解决方案让您无需处理复杂的支付集成和安全合规问题

无需PCI DSS合规认证,降低技术门槛
无缝支付快速集成,支持全球250+支付方式
专业支付页面,信用卡支持24+支付语言

集成方式

在托管结账(Hosted Checkout) 模式下,Oceanpayment提供两种不同的重定向处理方式,以满足商户在支付流程控制、用户体验和系统架构上的不同需求。两种方式仅在 支付完成后的跳转逻辑上存在差异,支付能力与安全机制保持一致。

工作原理

流程图

  1. 商户服务器调用Hosted Checkout提交必要参数创建交易:
cURL -X POST 'https://test-secure.oceanpayment.com/gateway/service/sendTrade' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'account=995149' \
-d 'terminal=99514901' \
-d 'signValue=6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b' \
-d 'backUrl=https://www.abc.com/back.php' \
-d 'noticeUrl=https://www.abc.com/notice.php' \
-d 'order_number=NO12345678' \
-d 'order_currency=USD' \
-d 'order_amount=0.01' \
-d 'methods=' \
-d 'order_notes=' \
-d 'billing_firstName=test' \
-d 'billing_lastName=test' \
-d 'billing_email=test@gmail.com' \
-d 'billing_phone=13800138000' \
-d 'billing_country=US' \
-d 'billing_state=AL' \
-d 'billing_city=Washington D.C.' \
-d 'billing_address=705A big Road' \
-d 'billing_zip=529012' \
-d 'billing_ip=127.0.0.1' \
-d 'productNum=1' \
-d 'productName=Red Dress' \
-d 'productSku=#001' \
-d 'productPrice=0.01' \
  1. 获取pay_url
<?xml version="1.0" encoding="UTF-8"?>
<respon>
<account>995149</account>
<terminal>99514901</terminal>
<signValue>20303645096FC2AEB64AE39B72A846F4B83BBC90B123C3FB27567F46CDD676E8</signValue>
<order_number>20230322B2COW03431</order_number>
<order_currency>HKD</order_currency>
<order_amount>0.1</order_amount>
<order_notes></order_notes>
<payment_id>231205114442682010542</payment_id>
<pay_url>https://test-secure.oceanpayment.com:443/gateway/service/redirect?pay_id=b6e6cf9d407ce1801f62c9d204c53e512c060ffdcbc56</pay_url>
<pay_results>1</pay_results>
<pay_details>0000:Success</pay_details>
</respon>
  1. 商户将用户重定向到该URL:
HTTP/1.2 301 Moved Permanently
Location: {pay_url}
  1. 用户在Oceanpayment页面上选择支付方式并付款;
  2. 支付完成后,用户被重定向回商户网站backUrl页面。

处理返回

在支付结果处理中,

  • 同步返回结果依赖于backUrl
//表单POST返回:
Array
(
[response_type] => 0
[account] => 995149
[terminal] => 99514901
[signValue] => F03C3D5154FC2672C5EC05BAD3DDDF0892617CC1517517DCD37E6499AA896D73
[methods] => Credit Card
[order_number] => NO12345678
[order_currency] => USD
[order_amount] => 0.01
[order_notes] =>
[card_number] =>
[card_type] => null
[payment_country] => US
[payment_id] => 221214134817000529042
[payment_Method] => Credit Card
[payment_authType] => 2
[payment_status] => 1
[payment_details] => 80000:Transaction Approved
[payment_solutions] => None required.
[payment_risk] =>
[payment_amount] => null
[payment_exchangeRate] => null
[pay_userId] => null
[pay_barCode] =>
[payment_bankInfo] =>
)

签名

在托管结账中,以上两种集成方式SignValue的签名格式是不相同的,查看详细的签名和验签功能。

API参考

👉即刻探索我们的