0
votes

I am sending a POST to capture multiple payment gateways:

A Gift Card(Custom Payment Gateway) and a Credit Card (Stripe). My Stripe capture happens no problem. Regardless of the order that I try to capture the transactions, the Gift Card always marks the payment gateway as Stripe on the capture.

This is my transaction POST

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

which is successful in updating the status to captured on shopify.

My transaction looks like this:

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

My Response looks like this:

'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',
  )

Am I missing something?

1

1 Answers

0
votes

Turns out that if you use a custom gateway you should send that as the first transaction. I simply array_reverse the transaction array and it solved the issue. Not sure why, but it did.