mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-27 06:05:19 +00:00
feat(payments): add order number to webhook payload
Include the order number in the webhook payload so consumers can identify which order a payment notification belongs to. Fixes #13858
This commit is contained in:
@@ -13,7 +13,7 @@ module Payments
|
||||
payment: @payment.slice(:updated_at, :amount, :state),
|
||||
enterprise: @enterprise.slice(:abn, :acn, :name)
|
||||
.merge(address: @enterprise.address.slice(:address1, :address2, :city, :zipcode)),
|
||||
order: @order.slice(:total, :currency).merge(line_items: line_items)
|
||||
order: @order.slice(:number, :total, :currency).merge(line_items: line_items)
|
||||
}.with_indifferent_access
|
||||
end
|
||||
|
||||
@@ -31,6 +31,7 @@ module Payments
|
||||
|
||||
def self.test_order
|
||||
order = Spree::Order.new(
|
||||
number: "R555555555",
|
||||
total: 0.00,
|
||||
currency: "AUD",
|
||||
)
|
||||
|
||||
@@ -42,6 +42,7 @@ RSpec.describe Payments::WebhookPayload do
|
||||
}
|
||||
},
|
||||
order: {
|
||||
number: order.number,
|
||||
total: order.total,
|
||||
currency: order.currency,
|
||||
line_items: line_items
|
||||
@@ -72,6 +73,7 @@ RSpec.describe Payments::WebhookPayload do
|
||||
}
|
||||
},
|
||||
order: {
|
||||
number: "R555555555",
|
||||
total: 0.00,
|
||||
currency: "AUD",
|
||||
line_items: [
|
||||
|
||||
Reference in New Issue
Block a user