Class: Spree::PaymentMethod::SimpleBogusCreditCard
- Inherits:
-
PaymentMethod::BogusCreditCard
- Object
- PaymentMethod::BogusCreditCard
- Spree::PaymentMethod::SimpleBogusCreditCard
- Defined in:
- app/models/spree/payment_method/simple_bogus_credit_card.rb
Overview
Bogus Gateway that doesn't support payment profiles.
Instance Method Summary collapse
- #authorize(_money, credit_card, _options = {}) ⇒ Object
- #payment_profiles_supported? ⇒ Boolean
- #purchase(_money, credit_card, _options = {}) ⇒ Object
- #void(_response_code, options = {}) ⇒ Object
Instance Method Details
#authorize(_money, credit_card, _options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/models/spree/payment_method/simple_bogus_credit_card.rb', line 10 def (_money, credit_card, = {}) = " - #{__method__}" if VALID_CCS.include? credit_card.number ActiveMerchant::Billing::Response.new(true, SUCCESS_MESSAGE + , {}, test: true, authorization: AUTHORIZATION_CODE, avs_result: {code: "A"}) else ActiveMerchant::Billing::Response.new(false, FAILURE_MESSAGE + , {message: FAILURE_MESSAGE}, test: true) end end |
#payment_profiles_supported? ⇒ Boolean
6 7 8 |
# File 'app/models/spree/payment_method/simple_bogus_credit_card.rb', line 6 def payment_profiles_supported? false end |
#purchase(_money, credit_card, _options = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/models/spree/payment_method/simple_bogus_credit_card.rb', line 20 def purchase(_money, credit_card, = {}) = " - #{__method__}" if VALID_CCS.include? credit_card.number ActiveMerchant::Billing::Response.new(true, SUCCESS_MESSAGE + , {}, test: true, authorization: AUTHORIZATION_CODE, avs_result: {code: "A"}) else ActiveMerchant::Billing::Response.new(false, FAILURE_MESSAGE + , message: FAILURE_MESSAGE, test: true) end end |
#void(_response_code, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/models/spree/payment_method/simple_bogus_credit_card.rb', line 30 def void(_response_code, = {}) = " - #{__method__}" if [:originator].completed? ActiveMerchant::Billing::Response.new(false, FAILURE_MESSAGE + , {}, test: true, authorization: AUTHORIZATION_CODE) else ActiveMerchant::Billing::Response.new(true, SUCCESS_MESSAGE + , {}, test: true, authorization: AUTHORIZATION_CODE) end end |