David Lazar
David Lazar

Reputation: 11425

Webhook data for Orders Paid

A client recently requested some fancy processing based off of the Gateway attribute registered with a Paid order. When I receive, validate and inspect the JSON of the order, I am logging the gateway attribute and finding it is nil at times.

When I check the order using the API after the Webhook, the gateway attribute is present and matches the one rendered in the Shop admin.

Is there an explanation for why the gateway can at times be nil? This prevents me from taking care of the client's requested processing.

Just as a sample.. I am filtering incoming Gateway receipts...

2012-11-02T03:02:56+00:00 app[web.1]: Gateway: eway
2012-11-02T03:59:08+00:00 app[web.1]: Gateway:

As can be seen... sometimes it's there.. and sometimes it's not.. which makes for awkward logic... any help here?

Upvotes: 0

Views: 252

Answers (1)

bgetting
bgetting

Reputation: 268

Could it be that the gateway is doing some processing in the background? It would explain why the value is not available in the web hook (it is not part of the response) but is available seconds later in the admin and via the API.

If it's not that, then it may be something wrong with the web hook itself.

Upvotes: 1

Related Questions