Shopify Transactions API - 更新事务时显示错误的网关名称

时间:2017-01-12 03:39:03

标签: php api transactions shopify

我发送一个POST来捕获多个支付网关:

礼品卡(自定义付款网关)和信用卡(条带)。 我的Stripe捕获没有问题。无论我尝试捕获交易的顺序如何,礼品卡始终将支付网关标记为捕获时的条带。

这是我的交易POST

$this->client->post("admin/orders/{$shopifyTransaction->getOrderId()}/transactions.json", [], $serializedModel);

成功更新了shopify上捕获的状态。

我的交易如下:

'transaction' => 
  array (
    'id' => 123456789,
    'order_id' => 123456789,
    'amount' => 4.23,
    'kind' => 'capture',
    'gateway' => 'Gift Card',
  ),
)  

我的回复如下:

'transaction' => 
  array (
    'id' => 567890989,
    'order_id' => 567890989,
    'amount' => '4.23',
    'kind' => 'capture',
    'gateway' => 'Stripe',
    'status' => 'success',
    'message' => 'Marked the Stripe payment as received',
    'created_at' => '2017-01-11T21:59:22-05:00',
    'test' => false,
    'authorization' => NULL,
    'currency' => 'CAD',
    'location_id' => NULL,
    'user_id' => NULL,
    'parent_id' => 3124665367,
    'device_id' => NULL,
    'receipt' => 
    array (
    ),
    'error_code' => NULL,
    'source_name' => '1313490',
  )

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

事实证明,如果您使用自定义网关,则应将其作为第一个事务发送。我只是array_reverse事务数组,它解决了问题。不知道为什么,但确实如此。