Class: Vpago::AcledaMobile::PaymentRetriever
- Inherits:
-
Object
- Object
- Vpago::AcledaMobile::PaymentRetriever
- Defined in:
- lib/vpago/acleda_mobile/payment_retriever.rb
Instance Attribute Summary collapse
-
#payment ⇒ Object
Returns the value of attribute payment.
Instance Method Summary collapse
- #call ⇒ Object
- #data_valid? ⇒ Boolean
- #find_payment ⇒ Object
-
#initialize(options) ⇒ PaymentRetriever
constructor
A new instance of PaymentRetriever.
Constructor Details
#initialize(options) ⇒ PaymentRetriever
Returns a new instance of PaymentRetriever.
6 7 8 |
# File 'lib/vpago/acleda_mobile/payment_retriever.rb', line 6 def initialize() @options = end |
Instance Attribute Details
#payment ⇒ Object
Returns the value of attribute payment.
4 5 6 |
# File 'lib/vpago/acleda_mobile/payment_retriever.rb', line 4 def payment @payment end |
Instance Method Details
#call ⇒ Object
10 11 12 |
# File 'lib/vpago/acleda_mobile/payment_retriever.rb', line 10 def call find_payment if data_valid? end |
#data_valid? ⇒ Boolean
14 15 16 17 |
# File 'lib/vpago/acleda_mobile/payment_retriever.rb', line 14 def data_valid? service = Vpago::AcledaMobile::CallbackValidator.new(@options) service.valid? end |
#find_payment ⇒ Object
19 20 21 |
# File 'lib/vpago/acleda_mobile/payment_retriever.rb', line 19 def find_payment @payment = Spree::Payment.find_by(number: @options[:PaymentTokenId]) end |