2

我正在尝试使用 Bluesnap 构建一个简单的支付流程。目前,我已经能够使用 Hosted Fields 捕获用户的账单信息,然后将其保存到 bluesnap 中的“Shopper”。现在我正在尝试使用同一个 Shopper 创建订单(https://developers.bluesnap.com/v8976-Extended/docs/create-order),但我无法让它工作。

我发送这个:

<order>
  <ordering-shopper>
    <shopper-id> 
      --Shopper ID--
    </shopper-id>
    <web-info>
      <ip>127.0.0.1:61106</ip>
      <remote-host>www.merchant.com</remote-host>
      <user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
    </web-info>
    <fraud-info>
      <fraud-session-id>1234567890</fraud-session-id>
    </fraud-info>
    <authorized-by-shopper>true</authorized-by-shopper>
  </ordering-shopper>
  <cart>
    <cart-item>
      <sku>
        <sku-id>2425735</sku-id>
      </sku>
      <quantity>1</quantity>
    </cart-item>
  </cart>
  <expected-total-price>
    <amount>15.00</amount>
    <currency>USD</currency>
  </expected-total-price>
</order>

对 BLUESNAPDOMAINPATH/services/2/orders 使用 POST 请求

我得到的唯一响应是状态码 400,正文包含“服务器错误”

有谁知道如何解决这个问题?

4

1 回答 1

2

您的根 xml 元素缺少命名空间:

<order>

应该:

 <order xmlns="http://ws.plimus.com">
于 2018-11-06T17:09:28.007 回答