Shopify/active_merchant — pull request #351 by AlexanderZaytsev (2012-04-26 18:49:57+00:00)
Title: Introduced payment_routine method for better service_url handling

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/