Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced payment_routine method for better service_url handling #351

Conversation

AlexanderZaytsev
Copy link
Contributor

2checkout supports two service urls (see the source link at the end):

Multi-page Payment Routine: https://www.2checkout.com/checkout/purchase

Single Page Payment Routine: https://www.2checkout.com/checkout/spurchase

I added the payment_routine method to be able to switch between these service urls.

def test_single_page_payment_routine_service_url
  TwoCheckout.payment_routine = :single_page
  assert_equal 'https://www.2checkout.com/checkout/spurchase', TwoCheckout.service_url
end

def test_multi_page_payment_routine_service_url
  TwoCheckout.payment_routine = :multi_page
  assert_equal 'https://www.2checkout.com/checkout/purchase', TwoCheckout.service_url
end

I also modified service_url= for backward compatibility so that similar code would keep working (in case someone was doing this):

ActiveMerchant::Billing::Integrations::TwoCheckout.service_url = "https://www.2checkout.com/checkout/spurchase"

Source: https://www.2checkout.com/blog/knowledge-base/merchants/tech-support/3rd-party-carts/parameter-sets/pass-through-product-parameter-set/

ntalbott added a commit that referenced this pull request Apr 30, 2012
…_checkout

2checkout integration: Add support for single page payment routine [AlexanderZaytsev]
@ntalbott ntalbott merged commit dba6019 into activemerchant:master Apr 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants