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



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

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

#refund_hashObject



191
192
193
# File 'lib/real_ex/recurring.rb', line 191

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

#request_typeObject



174
175
176
# File 'lib/real_ex/recurring.rb', line 174

def request_type
  'payment-out'
end

#to_xmlObject



178
179
180
181
182
183
184
185
# File 'lib/real_ex/recurring.rb', line 178

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