Sha256: 008b456fb4ad13d4f17dbe80c51dd5ddae002cee1901624bca64a04910e59262
Contents?: true
Size: 1.15 KB
Versions: 15
Compression:
Stored size: 1.15 KB
Contents
class Kaui::Transaction < KillBillClient::Model::Transaction def create(account_id = nil, payment_method_id = nil, user = nil, reason = nil, comment = nil, options = {}) if transaction_type == 'AUTHORIZE' auth(account_id, payment_method_id, user, reason, comment, options) elsif transaction_type == 'CAPTURE' capture(user, reason, comment, options) elsif transaction_type == 'CHARGEBACK' chargeback(user, reason, comment, options) elsif transaction_type == 'CREDIT' credit(account_id, payment_method_id, user, reason, comment, options) elsif transaction_type == 'PURCHASE' purchase(account_id, payment_method_id, user, reason, comment, options) elsif transaction_type == 'REFUND' refund(user, reason, comment, options) elsif transaction_type == 'VOID' void(user, reason, comment, options) else raise ArgumentError.new("Unknown transaction type #{transaction_type}") end end def amount_to_money Kaui::Base.to_money(amount, currency) end def self.amount_to_money(transaction) self.new(:amount => transaction.amount, :currency => transaction.currency).amount_to_money end end
Version data entries
15 entries across 15 versions & 1 rubygems