spree/spree — Issue #710: Arbitrary determination if confirmation step is needed in checkout-process
Author: fschwahn
Created: 2011-10-20 18:51:12+00:00
State: open

Hi,
the logic to determine if the confirmation step of the checkout-process is needed is the following:

```ruby
Gateway.current and Gateway.current.payment_profiles_supported?
```

If I run `Gateway.current` in the console, it simply returns the first `PaymentMethod`-object it can find. The SQL-query is as follows:

```
SELECT `payment_methods`.* FROM `payment_methods` WHERE `payment_methods`.`deleted_at` IS NULL AND `payment_methods`.`active` = 1 AND `payment_methods`.`environment` = 'development' LIMIT 1
```

If the first payment-method it finds happens to evaluate `payment_profiles_supported?` to true, the confirmation step is added. If not, the confirmation step is not added. However, it does not check if the _current_ payment method evaluates `payment_profiles_supported?` to true. So even if I choose `Gateway::AuthorizeNet` a confirmation step is added.

I hope it is understandable what I mean. I've only been using Spree for a few days and I don't fully understand the internals. It would also be nice if it was possible to optionally enable the confirmation step if it is does not impose a security risk (e.g. for PaymentMethod::Check).

Thanks.