class OffsitePayments::Integrations::MollieMistercash::Notification
Public Class Methods
new(post_arguments, options = {})
click to toggle source
Calls superclass method
OffsitePayments::Notification::new
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 70 def initialize(post_arguments, options = {}) super raise ArgumentError, "The transaction_id needs to be included in the query string." if transaction_id.nil? raise ArgumentError, "The credential1 option needs to be set to the Mollie API key." if api_key.blank? end
Public Instance Methods
acknowledge(authcode = nil)
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 118 def acknowledge(authcode = nil) @params = check_payment_status(transaction_id) true end
api_key()
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 89 def api_key @options[:credential1] end
check_payment_status(transaction_id)
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 123 def check_payment_status(transaction_id) MollieMistercash.check_payment_status(@options[:credential1], transaction_id) end
complete?()
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 77 def complete? true end
currency()
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 93 def currency "EUR" end
gross()
click to toggle source
the money amount we received in X.2 decimal.
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 98 def gross @params['amount'] end
gross_cents()
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 102 def gross_cents (BigDecimal(@params['amount'], 2) * 100).to_i end
item_id()
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 81 def item_id params['metadata']['order'] end
status()
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 106 def status case @params['status'] when 'open'; 'Pending' when 'paidout', 'paid'; 'Completed' else 'Failed' end end
test?()
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 114 def test? @params['mode'] == 'test' end
transaction_id()
click to toggle source
# File lib/offsite_payments/integrations/mollie_mistercash.rb, line 85 def transaction_id params['id'] end