From 1699ee52f6da2f72ffcb146f7bc5c0a3b098efda Mon Sep 17 00:00:00 2001 From: Ross Chapman Date: Fri, 27 Oct 2023 19:27:24 -0700 Subject: [PATCH] Updates initialization --- app/furniture/marketplace/square_order.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/furniture/marketplace/square_order.rb b/app/furniture/marketplace/square_order.rb index 511b55da0..cf10d24b9 100644 --- a/app/furniture/marketplace/square_order.rb +++ b/app/furniture/marketplace/square_order.rb @@ -4,7 +4,8 @@ def initialize(order) @order = order @marketplace = order.marketplace @shopper = order.shopper - @space_id = order.marketplace.space.id + @space = order.marketplace.space + @ordered_products = @order.ordered_products @square_location_id = @marketplace.settings["square_location_id"] end @@ -41,7 +42,7 @@ def send_to_square_seller_dashboard square_create_payment_body = build_square_create_order_payment_body( square_order_id, @square_location_id, - @space_id + @space.id ) marketplace.square_client.payments.create_payment(body: square_create_payment_body) @@ -54,7 +55,7 @@ def send_to_square_seller_dashboard location_id = @marketplace.settings["square_location_id"] customer_id = @shopper.id - line_items = @order.ordered_products.map { |ordered_product| + line_items = @ordered_products.map { |ordered_product| { name: ordered_product.name, quantity: ordered_product.quantity.to_s,