Class: RealEx::Recurring::Refund

Inherits:
Transaction show all
Defined in:
lib/real_ex/recurring.rb

Constant Summary

Constants inherited from Transaction

Transaction::REQUEST_TYPES

Instance Attribute Summary

Attributes inherited from Transaction

#authcode, #comments, #pasref

Instance Method Summary collapse

Methods inherited from Transaction

#authorize!

Methods inherited from Transaction

#authorize!, #autosettle?, #initialize

Methods included from Initializer

included, #initialize

Constructor Details

This class inherits a constructor from RealEx::Transaction

Instance Method Details

#hashObject



183
184
185
# File 'lib/real_ex/recurring.rb', line 183

def hash
  RealEx::Client.build_hash([RealEx::Client.timestamp, RealEx::Config.merchant_id, order_id, amount, currency, payer.reference])
end

#refund_hashObject



187
188
189
# File 'lib/real_ex/recurring.rb', line 187

def refund_hash
  Digest::SHA1.hexdigest(RealEx::Config.refund_password)
end

#request_typeObject



170
171
172
# File 'lib/real_ex/recurring.rb', line 170

def request_type
  'payment-out'
end

#to_xmlObject



174
175
176
177
178
179
180
181
# File 'lib/real_ex/recurring.rb', line 174

def to_xml
  super do |per|
    per.amount(amount, :currency => currency)
    per.payerref payer.reference
    per.paymentmethod reference
    per.refundhash refund_hash
  end
end