Class: Flow::Reference::PaymentMethods
- Inherits:
-
Object
- Object
- Flow::Reference::PaymentMethods
- Defined in:
- lib/flow-reference.rb,
lib/generated/payment_methods.rb
Defined Under Namespace
Classes: Data
Constant Summary collapse
- SUPPORTED_CREDIT_CARDS =
[:american_express, :cartes_bancaires, :china_union_pay, :dankort, :diners_club, :discover, :jcb, :maestro, :mastercard, :paypal, :visa]
Class Method Summary collapse
Class Method Details
.find(payment_code) ⇒ Object
72 73 74 75 76 |
# File 'lib/flow-reference.rb', line 72 def find(payment_code) code = payment_code.gsub(/[^\w]/,'').capitalize.gsub(/_(\w)/){ $1.upcase } return nil unless Data.respond_to?(code) Data.send(code) end |
.find!(payment_code) ⇒ Object
78 79 80 |
# File 'lib/flow-reference.rb', line 78 def find!(payment_code) find(payment_code) || raise(ArgumentError, 'Payment method "%s" is not found' % payment_code) end |