class OffsitePayments::Integrations::MollieIdeal::Notification
Public Class Methods
new(post_arguments, options = {})
click to toggle source
Calls superclass method
OffsitePayments::Notification::new
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 132 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_ideal.rb, line 180 def acknowledge(authcode = nil) @params = check_payment_status(transaction_id) true end
api_key()
click to toggle source
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 151 def api_key @options[:credential1] end
check_payment_status(transaction_id)
click to toggle source
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 185 def check_payment_status(transaction_id) MollieIdeal.check_payment_status(@options[:credential1], transaction_id) end
complete?()
click to toggle source
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 139 def complete? true end
currency()
click to toggle source
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 155 def currency "EUR" end
gross()
click to toggle source
the money amount we received in X.2 decimal.
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 160 def gross @params['amount'] end
gross_cents()
click to toggle source
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 164 def gross_cents (BigDecimal.new(@params['amount'], 2) * 100).to_i end
item_id()
click to toggle source
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 143 def item_id params['metadata']['order'] end
status()
click to toggle source
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 168 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_ideal.rb, line 176 def test? @params['mode'] == 'test' end
transaction_id()
click to toggle source
# File lib/offsite_payments/integrations/mollie_ideal.rb, line 147 def transaction_id params['id'] end