spree-contrib / better_spree_paypal_express

A better Spree PayPal Express Extension.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
110 stars 269 forks source link

Don't instantiate provider in provider_class #26

Closed jhawthorn closed 10 years ago

jhawthorn commented 10 years ago

It was possible for payment_class to be called, which instantiated a newPayPal::SDK::Merchant::API object before paypal was configured by the code in .provider. This caused the error as seen in #15:

No such file or directory - config/paypal.yml

This changes provider_class to just return the class itself. It also overrides .provides? to be more explicit about the behaviour.

radar commented 10 years ago

Thank you @jhawthorn. I have added this one to master, 2-1-stable and 2-0-stable.