Issue #13481 created a payment notification webhook in order to comply with new regulations in Spain, which was closed as part of pull request #13777
The current output of the webhook complies with the regulation as required, however adding spree_orders.id to the output body will open up uses to instance managers and users, particularly for internal integrations. This will allow us to, for example, trigger an instant notification for producers who sell through a hub when they receive an order, rather than only receiving the Order Cycle Summary at order cycle close. Currently I have built an integration that looks at orders on a schedule (every hour), meaning greater integrations server load that we could minimise easily by adding spree_orders.id to the output body.
is there any reason that Order ID/number couldn't be included in the webhook?
It wasn't part of the requirements, but I don't think there is any reason not to include it. It would a quick fix, can you create an issue ? FYI @RachL
Originally posted by @rioug in https://github.com/openfoodfoundation/openfoodnetwork/issues/13777#issuecomment-3740706154
The order number should be added to the Payments::WebhookPayload : https://github.com/openfoodfoundation/openfoodnetwork/blob/master/spec/services/payments/webhook_payload_spec.rb
See the orignal PR on how ways to test the webhook : https://github.com/openfoodfoundation/openfoodnetwork/pull/13777#issue-3683952700