app/models/spree/gateway/authorize_net_cim.rb
# Create a transaction on a creditcard
# Set up a CIM profile for the card if one doesn't exist
# Valid transaction_types are :auth_only, :capture_only and :auth_capture
Create a transaction on a creditcard
Set up a CIM profile for the card if one doesn't exist
Valid transaction_types are :auth_only, :capture_only and :auth_capture
Create a transaction on a creditcard Set up a CIM profile for the card if one doesn ' t exist Valid transaction_types are : auth_only : capture_only and : auth_capture
def create_transaction(amount, creditcard, transaction_type, options = {})
        creditcard.save if creditcard
        transaction_options = {
          type: transaction_type
        }.update(options)
        if amount
          amount = "%.2f" % (amount / 100.0) 
          transaction_options.update({
            amount: amount
          })
        end
        if creditcard
          transaction_options.update({
            customer_profile_id: creditcard.gateway_customer_profile_id,
            customer_payment_profile_id: creditcard.gateway_payment_profile_id
          })
        end
        logger.debug("\nAuthorize Net CIM Request")
        logger.debug("  transaction_options: #{transaction_options.inspect}")
        t = cim_gateway.create_customer_profile_transaction(transaction: transaction_options)
        logger.debug("\nAuthorize Net CIM Response")
        logger.debug("  response: #{t.inspect}\n")
        t
      end
def create_transaction ( amount , creditcard , transaction_type , options = { } ) creditcard . save if creditcard transaction_options = { type : transaction_type } . update ( options ) if amount amount = "%.2f" % ( amount / 100.0 ) transaction_options . update ( { amount : amount } ) end if creditcard transaction_options . update ( { customer_profile_id : creditcard . gateway_customer_profile_id , customer_payment_profile_id : creditcard . gateway_payment_profile_id } ) end logger . debug ( "\nAuthorize Net CIM Request" ) logger . debug ( "  transaction_options: #{transaction_options.inspect}" ) t = cim_gateway . create_customer_profile_transaction ( transaction : transaction_options ) logger . debug ( "\nAuthorize Net CIM Response" ) logger . debug ( "  response: #{t.inspect}\n" ) t end
Create a transaction on a creditcard
Set up a CIM profile for the card if one doesn't exist
Valid transaction_types are :auth_only, :capture_only and :auth_capture
Create a transaction on a creditcard Set up a CIM profile for the card if one doesn ' t exist Valid transaction_types are : auth_only : capture_only and : auth_capture
# This gateway requires formated decimal, not cents
amount
creditcard
transaction_type
options