Class: Gateway::PinGateway
- Inherits:
-
Gateway
- Object
- Gateway
- Gateway::PinGateway
- Defined in:
- app/models/spree/gateway/pin_gateway.rb
Instance Method Summary collapse
-
#auto_capture? ⇒ Boolean
Pin does not appear to support authorizing transactions yet.
- #create_profile(payment) ⇒ Object
- #payment_profiles_supported? ⇒ Boolean
- #provider_class ⇒ Object
- #purchase(money, creditcard, options = {}) ⇒ Object
Instance Method Details
#auto_capture? ⇒ Boolean
Pin does not appear to support authorizing transactions yet
30 31 32 |
# File 'app/models/spree/gateway/pin_gateway.rb', line 30 def auto_capture? true end |
#create_profile(payment) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/spree/gateway/pin_gateway.rb', line 14 def create_profile(payment) if payment.source.gateway_customer_profile_id.nil? response = provider.store(payment.source, (payment)) if response.success? payment.source.update!(:gateway_customer_profile_id => response.) cc = response.params['response']['card'] payment.source.update!(:gateway_payment_profile_id => cc['token']) if cc else payment.send(:gateway_error, response.) end end end |
#payment_profiles_supported? ⇒ Boolean
34 35 36 |
# File 'app/models/spree/gateway/pin_gateway.rb', line 34 def payment_profiles_supported? true end |
#provider_class ⇒ Object
6 7 8 |
# File 'app/models/spree/gateway/pin_gateway.rb', line 6 def provider_class ActiveMerchant::Billing::PinGateway end |
#purchase(money, creditcard, options = {}) ⇒ Object
10 11 12 |
# File 'app/models/spree/gateway/pin_gateway.rb', line 10 def purchase(money, creditcard, = {}) super(money, creditcard.try(:gateway_customer_profile_id) || creditcard.try(:gateway_payment_profile_id) || creditcard, ) end |