From 927278c16e83bb8cf4e6cb5108a446346abe346a Mon Sep 17 00:00:00 2001 From: Abel Pacheco Date: Fri, 30 Sep 2022 22:12:40 -0500 Subject: [PATCH] Add Square details --- lib/active_merchant/billing/gateways/square.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/active_merchant/billing/gateways/square.rb b/lib/active_merchant/billing/gateways/square.rb index 64727c1f489..a82e247650c 100644 --- a/lib/active_merchant/billing/gateways/square.rb +++ b/lib/active_merchant/billing/gateways/square.rb @@ -162,6 +162,12 @@ def add_application_fee(post, money, options) end end + def add_details(post, options) + post[:note] = options[:note] if options[:note].present? + post[:reference_id] = options[:reference_id] if options[:reference_id].present? + post[:location_id] = options[:location_id] if options[:location_id].present? + end + def create_post_for_auth_or_purchase(money, payment, options) post = {} @@ -171,6 +177,7 @@ def create_post_for_auth_or_purchase(money, payment, options) add_idempotency_key(post, options) add_amount(post, money, options) add_application_fee(post, options[:application_fee], options) + add_details(post, options) post end