class OffsitePayments::Integrations::Paydollar::Notification
Public Instance Methods
acknowledge(authcode = nil)
click to toggle source
# File lib/offsite_payments/integrations/paydollar.rb, line 140 def acknowledge(authcode = nil) # paydollar supports multiple signature keys, therefore we need to check if any # of their signatures match ours hash = @params['secureHash'] if !hash return false end hash.split(',').include? generate_secure_hash end
complete?()
click to toggle source
# File lib/offsite_payments/integrations/paydollar.rb, line 113 def complete? status == 'Completed' end
currency()
click to toggle source
# File lib/offsite_payments/integrations/paydollar.rb, line 121 def currency CURRENCY_MAP.key(@params['Cur']) end
gross()
click to toggle source
# File lib/offsite_payments/integrations/paydollar.rb, line 125 def gross @params['Amt'] end
item_id()
click to toggle source
# File lib/offsite_payments/integrations/paydollar.rb, line 117 def item_id @params['Ref'] end
status()
click to toggle source
# File lib/offsite_payments/integrations/paydollar.rb, line 133 def status case @params['successcode'] when '0' then 'Completed' else 'Failed' end end
transaction_id()
click to toggle source
# File lib/offsite_payments/integrations/paydollar.rb, line 129 def transaction_id @params['PayRef'] end
Private Instance Methods
generate_secure_hash()
click to toggle source
# File lib/offsite_payments/integrations/paydollar.rb, line 152 def generate_secure_hash fields = [@params['src'], @params['prc'], @params['successcode'], @params['Ref'], @params['PayRef'], @params['Cur'], @params['Amt'], @params['payerAuth']] Paydollar.sign(fields, @options[:credential2]) end