Skip to content

Commit

Permalink
Updates initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rosschapman committed Oct 28, 2023
1 parent 81567e9 commit 1699ee5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/furniture/marketplace/square_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 1699ee5

Please sign in to comment.