Class: Tappay::PaymentBase
Direct Known Subclasses
CreditCard::Instalment, CreditCard::InstalmentByPrime, CreditCard::InstalmentByToken, CreditCard::Pay, CreditCard::PayByPrime, CreditCard::PayByToken, PrimePayment
Constant Summary collapse
- VALID_INSTALMENT_VALUES =
[0, 3, 6, 12, 18, 24, 30].freeze
Instance Attribute Summary
Attributes inherited from Client
Class Method Summary collapse
-
.merchant_id_key ⇒ Object
Walks the ancestry, because a class-level ivar is not inherited and the get_merchant_id overrides this replaced were.
-
.uses_merchant_id(key) ⇒ Object
Some payment methods get their own merchant ID from TapPay.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ PaymentBase
constructor
A new instance of PaymentBase.
Methods inherited from Client
Constructor Details
#initialize(options = {}) ⇒ PaymentBase
Returns a new instance of PaymentBase.
23 24 25 26 |
# File 'lib/tappay/payment_base.rb', line 23 def initialize( = {}) super end |
Class Method Details
.merchant_id_key ⇒ Object
Walks the ancestry, because a class-level ivar is not inherited and the get_merchant_id overrides this replaced were. Without this, a subclass of a payment class silently charges the default merchant.
17 18 19 20 |
# File 'lib/tappay/payment_base.rb', line 17 def merchant_id_key @merchant_id_key || (superclass.merchant_id_key if superclass.respond_to?(:merchant_id_key)) end |
.uses_merchant_id(key) ⇒ Object
Some payment methods get their own merchant ID from TapPay. Declaring the config key here replaces a get_merchant_id override per class.
10 11 12 |
# File 'lib/tappay/payment_base.rb', line 10 def uses_merchant_id(key) @merchant_id_key = key end |
Instance Method Details
#execute ⇒ Object
28 29 30 |
# File 'lib/tappay/payment_base.rb', line 28 def execute post(endpoint_url, payment_data) end |