Authorize.net CIM

44 views
Skip to first unread message

mel ram

unread,
May 12, 2009, 8:36:10 PM5/12/09
to Active Merchant
Has anyone done a write-up with how to properly use AM w/ the
Authorize.net CIM gateway? Google didn't turn up anything.
RubyPlus.org has a video but it's just the guy walking through a bit
of the UI. I couldn't find any real code.

anywho

unread,
May 18, 2009, 1:36:01 PM5/18/09
to Active Merchant
I'd enjoy seeing some example code for this as well.

On May 12, 5:36 pm, mel ram <mel...@volcanicmarketing.com> wrote:
> Has anyone done a write-up with how to properly use AM w/ the
> Authorize.netCIMgateway? Google didn't turn up anything.

anywho

unread,
May 18, 2009, 2:58:17 PM5/18/09
to Active Merchant
In fact, I've read the api documentation, but if I didn't look at the
test harness for shopify here:
http://github.com/Shopify/active_merchant/blob/462e635eca4e63b7e4e91b3f6fbc65348ab9fbd0/test/unit/gateways/authorize_net_cim_test.rb

Are the parameters etc documented anywhere so far? For the API only
"options" are documented, but what those options actually are seems
unknown.

-d

anywho

unread,
May 19, 2009, 1:23:15 PM5/19/09
to Active Merchant
A specific question I have now is, how would I make a straight
purchase without using CIM and still using the CIM gateway? Would I
have to keep track of two gateways to handle one where customer info
is stored, and one where it isn't?



On May 18, 11:58 am, anywho <eydai...@gmail.com> wrote:
> In fact, I've read the api documentation, but if I didn't look at the
> test harness for shopify here:http://github.com/Shopify/active_merchant/blob/462e635eca4e63b7e4e91b...

Cody Fauser

unread,
May 19, 2009, 2:27:14 PM5/19/09
to activem...@googlegroups.com
If you don't want to store the customer data then using the normal
AuthorizeNetGateway is the probably the easiest option.
--
Cody Fauser
http://shopify.com - e-commerce done right
http://www.codyfauser.com - blog
http://peepcode.com/products/activemerchant-pdf - ActiveMerchant PeepCode
http://www.oreilly.com/catalog/rjsrails - RJS Templates for Rails

anywho

unread,
May 19, 2009, 3:20:51 PM5/19/09
to Active Merchant
seems like it would be a good idea to add purchase/capture, authorize
to the CIM one too. That way one wouldn't have to switch if one would
like to give the customer the option of making a one time purchase
(donation?) or remain a customer.

Benjamin Curtis

unread,
May 19, 2009, 3:32:29 PM5/19/09
to activem...@googlegroups.com
One-time purchases can be done via CIM, as long as you have previously stored the info (or store it right before doing the charge).  

I don't know that it is a good idea to add authorize and purchase to that gateway (which would presumably store info and then run the transaction for you in one call), as that might lead to developers accidentally storing info with CIM that they don't want to store.

--
Benjamin Curtis
http://railskits.com/ - Ready-made Rails code
http://catchthebest.com/ - Team-powered recruiting
http://www.bencurtis.com/ - Personal blog

melvin ram

unread,
May 19, 2009, 9:25:18 PM5/19/09
to Active Merchant
For those looking for how to use Authorize.net CIM, I looked at the
test file for that gateway and it's really good as documentation for
how to use it.

On May 19, 12:32 pm, Benjamin Curtis <benjamin.cur...@gmail.com>
wrote:
> One-time purchases can be done via CIM, as long as you have previously
> stored the info (or store it right before doing the charge).
> I don't know that it is a good idea to add authorize and purchase to that
> gateway (which would presumably store info and then run the transaction for
> you in one call), as that might lead to developers accidentally storing info
> with CIM that they don't want to store.
> --
> Benjamin Curtishttp://railskits.com/- Ready-made Rails codehttp://catchthebest.com/- Team-powered recruitinghttp://www.bencurtis.com/- Personal blog
> > > Cody Fauserhttp://shopify.com-e-commerce done

anywho

unread,
May 21, 2009, 11:50:32 AM5/21/09
to Active Merchant
Another specific question. I'm wondering about how one issues a refund
here. There doesn't seem to be a specific way to do a refund for a
customer either. So would I also be using the AuthorizeNetGateway for
that? Seems a bit odd to have to use two gateways to get the
functionality normally associated with one.

On May 12, 5:36 pm, mel ram <mel...@volcanicmarketing.com> wrote:

Cody Fauser

unread,
May 21, 2009, 5:17:58 PM5/21/09
to activem...@googlegroups.com
I'm thinking that there are more transactions types than are currently
supported in AM. I found this in the gateway:

CIM_TRANSACTION_TYPES = {
:auth_capture => 'profileTransAuthCapture',
:auth_only => 'profileTransAuthOnly',
:capture_only => 'profileTransCaptureOnly'
}

The CIM guide should shed more light on this.

anywho

unread,
May 22, 2009, 5:51:07 PM5/22/09
to Active Merchant
By CIM guide, which one are you referring to? I've found this one:

http://www.authorize.net/support/CIM_SOAP_guide.pdf


FYI, Looking at that document, I notice there is at least one function
that doesn't currently exit in AM: get_customer_profile_ids

On May 21, 2:17 pm, Cody Fauser <codyfau...@gmail.com> wrote:
> I'm thinking that there are more transactions types than are currently
> supported in AM. I found this in the gateway:
>
> CIM_TRANSACTION_TYPES = {
>         :auth_capture => 'profileTransAuthCapture',
>         :auth_only => 'profileTransAuthOnly',
>         :capture_only => 'profileTransCaptureOnly'
>       }
>
> The CIM guide should shed more light on this.
>
> On Thu, May 21, 2009 at 11:50 AM, anywho <eydai...@gmail.com> wrote:
>
> > Another specific question. I'm wondering about how one issues a refund
> > here. There doesn't seem to be a specific way to do a refund for a
> > customer either. So would I also be using the AuthorizeNetGateway for
> > that? Seems a bit odd to have to use two gateways to get the
> > functionality normally associated with one.
>
> > On May 12, 5:36 pm, mel ram <mel...@volcanicmarketing.com> wrote:
> >> Has anyone done a write-up with how to properly use AM w/ the
> >> Authorize.net CIM gateway? Google didn't turn up anything.
> >> RubyPlus.org has a video but it's just the guy walking through a bit
> >> of the UI. I couldn't find any real code.
>
> --
> Cody Fauserhttp://shopify.com- e-commerce done righthttp://www.codyfauser.com- bloghttp://peepcode.com/products/activemerchant-pdf- ActiveMerchant PeepCodehttp://www.oreilly.com/catalog/rjsrails- RJS Templates for Rails

anywho

unread,
May 26, 2009, 1:41:11 PM5/26/09
to Active Merchant
any thoughts on this?

Cody Fauser

unread,
May 26, 2009, 9:42:58 PM5/26/09
to activem...@googlegroups.com
Looks like it is possible:

Input Parameters for CreateCustomerProfileTransaction
This function is used to create a payment transaction from an existing
customer profile. You can
submit one of six transaction types: Authorization Only, Authorization
and Capture, Capture Only,
Prior Authorization and Capture, Refund and Void. For more information
on these transaction
types, please see the Merchant Integration Guide at ...

Brian Armstrong

unread,
May 27, 2009, 3:36:05 PM5/27/09
to Active Merchant
Has anyone looked at http://servicemerchant.org/ for simplifying
Authorize.net CIM? Just came across it but it may have potential.
> >> > >>Authorize.netCIM gateway? Google didn't turn up anything.
> >> > >> RubyPlus.org has a video but it's just the guy walking through a bit
> >> > >> of the UI. I couldn't find any real code.
>
> >> > --
> >> > Cody Fauserhttp://shopify.com-e-commercedone righthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerc...PeepCodehttp://www.oreilly.com/catalog/rjsrails-RJSTemplates for Rails

anywho

unread,
Jun 16, 2009, 1:53:46 PM6/16/09
to Active Merchant
I'm not sure what you mean by saying it looks possible. Is this a
function that you plan to integrate in active_merchant feature release
or are you saying this is a function I can call now, as it stands?

i.e. get_customer_profile_ids ?
> >> > Cody Fauserhttp://shopify.com-e-commercedone righthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerc...PeepCodehttp://www.oreilly.com/catalog/rjsrails-RJSTemplates for Rails
>

Cody Fauser

unread,
Jun 16, 2009, 2:22:29 PM6/16/09
to activem...@googlegroups.com
What I mean is I think it could be added quite easily, but would
require someone to create a patch. We don't use Authorize.net CIM, so
it won't come from me personally.

ben

unread,
Jun 23, 2009, 5:22:14 PM6/23/09
to Active Merchant
I need some of this functionality so I'll create a patch. Should be
ready today or tomorrow.

-ben
> >> >> > Cody Fauserhttp://shopify.com-e-commercedonerighthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerc...for Rails
>
> >> --
> >> Cody Fauserhttp://shopify.com-e-commerce done righthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerchant-pdf-ActiveMerchant PeepCodehttp://www.oreilly.com/catalog/rjsrails-RJS Templates for Rails

ben

unread,
Jun 23, 2009, 5:51:50 PM6/23/09
to Active Merchant
The XML guide seems to differ (and support more) than the SOAP
guide... http://www.authorize.net/support/CIM_XML_guide.pdf

On May 22, 2:51 pm, anywho <eydai...@gmail.com> wrote:

ben

unread,
Jun 25, 2009, 6:42:24 PM6/25/09
to Active Merchant
Cody,

I implemented :void, :refund and :auth_capture for Authorize.net's CIM
gateway. I ran into a few problems while testing though.

1) I couldn't figure out how to get any tests in AM to pass with
[require 'test_helper'] - I had to put in a path. Can someone explain
what I'm missing here? How do you guys run these?

2) I obviously had to put in real credentials for Auth.net login/
password - which I assume is expected.

3) In remote_authorize_new_cim_test.rb I wasn't able to get any tests
passing with the existing @profile and @options data - I used
something like this and things worked.

t = Time.now.to_i.to_s
@profile = {
:merchant_customer_id => t,
:description => "#{t} Merchant",
:email => "bob#{t}@email.com",
:payment_profiles => { # Optional
:customer_type => 'individual', # Optional
:bill_to => @address,
:payment => @payment
},
:ship_to_list => {
:first_name => "John#{t}",
:last_name => "Doe#{t}",
:company => "Widgets Inc #{t}",
:address1 => "1234 Fake Street",
:city => 'Anytown',
:state => 'MD',
:zip => '12345',
:country => 'USA',
:phone_number => '(123)123-1234', # Optional - Up to 25 digits
(no letters)
:fax_number => '(123)123-1234' # Optional - Up to 25 digits
(no letters)
}
}
@options = {
:ref_id => t, # Optional
:profile => @profile
}

4) The create_customer_profile_transaction method is kind of ugly
now. I thought about breaking these out into different methods but
didn't figuring one method might be easier for people to use.
Thoughts on this? It's completely backwards compitable. Here's the
new sig:

# Creates a new payment transaction from an existing customer
profile
#
# This is what is used to charge a customer whose information
you have stored in a Customer Profile.
#
# Returns a Response object that contains the result of the
transaction in <tt>params['direct_response']</tt>
#
# ==== Options
#
# * <tt>:transaction</tt> -- A hash containing information on
the transaction that is being requested. (REQUIRED)
#
# ==== Transaction
#
# * <tt>:type</tt> -- The type of transaction. Can be either
<tt>:auth_only</tt>, <tt>:capture_only</tt>, <tt>:auth_capture</tt>,
<tt>:prior_auth_capture</tt>, <tt>:refund</tt> or <tt>:void</tt>.
(REQUIRED)
# * <tt>:amount</tt> -- The amount for the tranaction. Formatted
with a decimal. For example "4.95" (CONDITIONAL)
# - :type == :void (NOT USED)
# - :type ==
(:refund, :auth_only, :capture_only, :auth_capture, :prior_auth_capture)
(REQUIRED)
#
# * <tt>:customer_profile_id</tt> -- The Customer Profile ID of
the customer to use in this transaction. (CONDITIONAL)
# - :type == (:void, :prior_auth_capture) (OPTIONAL)
# - :type == :refund (CONDITIONAL - required if masked
information is not being submitted [see below])
# - :type == (:auth_only, :capture_only, :auth_capture)
(REQUIRED)
#
# * <tt>:customer_payment_profile_id</tt> -- The Customer
Payment Profile ID of the Customer Payment Profile to use in this
transaction. (CONDITIONAL)
# - :type == (:void, :prior_auth_capture) (OPTIONAL)
# - :type == :refund (CONDITIONAL - required if masked
information is not being submitted [see below])
# - :type == (:auth_only, :capture_only, :auth_capture)
(REQUIRED)
#
# * <tt>:trans_id</tt> -- The payment gateway assigned
transaction ID of the original transaction (CONDITIONAL):
# - :type = (:void, :refund, :prior_auth_capture) (REQUIRED)
# - :type = (:auth_only, :capture_only, :auth_capture) (NOT
USED)
#
# * <tt>customer_shipping_address_id</tt> -- Payment gateway
assigned ID associated with the customer shipping address
(CONDITIONAL)
# - :type = (:void, :refund) (OPTIONAL)
# - :type = (:auth_only, :capture_only, :auth_capture) (NOT
USED)
# - :type = (:prior_auth_capture) (OPTIONAL)
#
#
# ==== For :type == :refund only
# * <tt>:credit_card_number_masked</tt> -- (CONDITIONAL -
requied for credit card refunds is :customer_profile_id
AND :customer_payment_profile_id are missing)
# * <tt>:bank_routing_number_masked
&& :bank_account_number_masked</tt> -- (CONDITIONAL - requied for
electronic check refunds is :customer_profile_id
AND :customer_payment_profile_id are missing) (NOT ABLE TO TEST - I
keep getting "ACH transactions are not accepted by this merchant."
when trying to make a payment and, until that's possible I can't
refund (wise...@gmail.com))
def create_customer_profile_transaction(options)

5) Refunds don't work in test mode. I haven't tested them live yet
but, in theory, they should work.

6) I couldn't make a payment in test mode using electronic checking -
I kept getting "ACH transactions are not accepted by this merchant".
Given that, I'm not sure if :refund works with bank_routing masks.

I created a ticket and assigned it you (was I supposed to do that?).
Link to ticket and patch: #94
https://jadedpixel.lighthouseapp.com/projects/11599-active-merchant/tickets/94-patch-to-add-void-refund-and-prior_auth_capture-to-authnets-cim-gateway


On Jun 16, 11:22 am, Cody Fauser <codyfau...@gmail.com> wrote:
> >> >> > Cody Fauserhttp://shopify.com-e-commercedonerighthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerc...for Rails
>
> >> --
> >> Cody Fauserhttp://shopify.com-e-commerce done righthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerchant-pdf-ActiveMerchant PeepCodehttp://www.oreilly.com/catalog/rjsrails-RJS Templates for Rails
Reply all
Reply to author
Forward
0 new messages