Skip to content

Commit

Permalink
Add 2Checkout language support
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Christenson authored and Bart de Water committed Apr 6, 2017
1 parent 72f07e1 commit ae89e98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/offsite_payments/integrations/two_checkout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae89e98

Please sign in to comment.