diff --git a/lib/offsite_payments/integrations/two_checkout.rb b/lib/offsite_payments/integrations/two_checkout.rb index 9fdba9822..46c088e6e 100644 --- a/lib/offsite_payments/integrations/two_checkout.rb +++ b/lib/offsite_payments/integrations/two_checkout.rb @@ -89,6 +89,9 @@ def initialize(order, account, options = {}) # Allow referral partners to indicate their shopping cart mapping :cart_type, '2co_cart_type' + # Allow sellers to pass in the hosted checkout language + mapping :lang, 'lang' + def customer(params = {}) add_field(mappings[:customer][:email], params[:email]) add_field(mappings[:customer][:phone], params[:phone]) diff --git a/test/unit/integrations/two_checkout/two_checkout_helper_test.rb b/test/unit/integrations/two_checkout/two_checkout_helper_test.rb index ac4c49ecc..f2ccb310e 100644 --- a/test/unit/integrations/two_checkout/two_checkout_helper_test.rb +++ b/test/unit/integrations/two_checkout/two_checkout_helper_test.rb @@ -23,12 +23,14 @@ def test_extra_helper_fields @helper.return_url 'https://return.url/' @helper.cart_type 'shopify' @helper.purchase_step 'payment-method' + @helper.lang 'en' assert_field 'currency_code', 'ZAR' assert_field 'cart_order_id', '123' assert_field 'x_receipt_link_url', 'https://return.url/' assert_field '2co_cart_type', 'shopify' assert_field 'purchase_step', 'payment-method' + assert_field 'lang', 'en' end def test_customer_fields