lib/active_merchant/billing/gateways/bluepay.rb
# Performs a credit.
#
# This transaction indicates that money should flow from the merchant to the customer.
#
# ==== Parameters
#
# * <tt>money</tt> -- The amount to be credited to the customer as an Integer value in cents.
# * <tt>payment_object</tt> -- This can either be one of three things:
# * A CreditCard object,
# * A Check object,
# * or a token. The token is called the Master ID. This is a unique transaction ID returned from a previous transaction. This token associates all the stored information for a previous transaction.
# * If the payment_object is a token, then the transaction type will reverse a previous capture or purchase transaction, returning the funds to the customer. If the amount is nil, a full credit will be processed. This is referred to a REFUND transaction in BluePay.
# * If the payment_object is either a CreditCard or Check object, then the transaction type will be an unmatched credit placing funds in the specified account. This is referred to a CREDIT transaction in BluePay.
# * <tt>options</tt> -- A hash of parameters.
Performs a credit.
This transaction indicates that money should flow from the merchant to the customer.

Parameters

money -- The amount to be credited to the customer as an Integer value in cents.
payment_object -- This can either be one of three things:
A CreditCard object,
A Check object,
or a token. The token is called the Master ID. This is a unique transaction ID returned from a previous transaction. This token associates all the stored information for a previous transaction.
If the payment_object is a token, then the transaction type will reverse a previous capture or purchase transaction, returning the funds to the customer. If the amount is nil, a full credit will be processed. This is referred to a REFUND transaction in BluePay.
If the payment_object is either a CreditCard or Check object, then the transaction type will be an unmatched credit placing funds in the specified account. This is referred to a CREDIT transaction in BluePay.
options -- A hash of parameters.
Performs a credit . This transaction indicates that money should flow from the merchant to the customer . Parameters money -- The amount to be credited to the customer as an Integer value in cents . payment_object -- This can either be one of three things : A CreditCard object A Check object or a token . The token is called the Master ID . This is a unique transaction ID returned from a previous transaction . This token associates all the stored information for a previous transaction . If the payment_object is a token then the transaction type will reverse a previous capture or purchase transaction returning the funds to the customer . If the amount is nil a full credit will be processed . This is referred to a REFUND transaction in BluePay . If the payment_object is either a CreditCard or Check object then the transaction type will be an unmatched credit placing funds in the specified account . This is referred to a CREDIT transaction in BluePay . options -- A hash of parameters .
def credit(money, payment_object, options = {})
	post = {}
        if payment_object != nil && payment_object.class() != String
           payment_object.class() == ActiveMerchant::Billing::Check ?
           add_check(post, payment_object) :
           add_creditcard(post, payment_object)
	   post[:TRANSACTION_TYPE] = 'CREDIT'
        else
           post[:RRNO]             = payment_object
	   post[:TRANSACTION_TYPE] = 'REFUND'
        end
	post[:MODE]		   = $options[:transaction_mode]
	post[:TAMPER_PROOF_SEAL]   = calc_tps(amount(money), post)
        add_invoice(post, options)
        add_address(post, options)
        add_customer_data(post, options)
        commit(money, post)
      end
def credit ( money , payment_object , options = { } ) post = { } if payment_object != nil && payment_object . class ( ) != String payment_object . class ( ) == ActiveMerchant :: Billing :: Check ? add_check ( post , payment_object ) : add_creditcard ( post , payment_object ) post [ :TRANSACTION_TYPE ] = 'CREDIT' else post [ :RRNO ] = payment_object post [ :TRANSACTION_TYPE ] = 'REFUND' end post [ :MODE ] = $options [ :transaction_mode ] post [ :TAMPER_PROOF_SEAL ] = calc_tps ( amount ( money ) , post ) add_invoice ( post , options ) add_address ( post , options ) add_customer_data ( post , options ) commit ( money , post ) end
Performs a credit.
Performs a credit .
money
<not_specific>
payment_object
<not_specific>
options
<not_specific>