Skip to content

Commit

Permalink
Make force_buyer_country preference available on production, but useless
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanofWoods committed Nov 30, 2021
1 parent 66e869c commit 5d2595b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/models/solidus_paypal_commerce_platform/payment_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PaymentMethod < SolidusSupport.payment_method_parent_class
preference :display_on_product_page, :boolean, default: true
preference :display_credit_messaging, :boolean, default: true
preference :enable_venmo, :boolean, default: false
preference :force_buyer_country, :string unless Rails.env.production?
preference :force_buyer_country, :string

def partial_name
"paypal_commerce_platform"
Expand Down Expand Up @@ -76,7 +76,9 @@ def javascript_sdk_url(order: nil, currency: nil)

parameters[:shipping_preference] = 'NO_SHIPPING' if step_names.exclude? 'delivery'
parameters['enable-funding'] = 'venmo' if options[:enable_venmo]
parameters['buyer-country'] = options[:force_buyer_country] if options[:force_buyer_country].present?
if !Rails.env.production? && options[:force_buyer_country].present?
parameters['buyer-country'] = options[:force_buyer_country]
end

"https://www.paypal.com/sdk/js?#{parameters.to_query}"
end
Expand Down

0 comments on commit 5d2595b

Please sign in to comment.