zen4ever / django-authorizenet

Django and Authorize.NET payment gateway integration
MIT License
87 stars 36 forks source link

Extra CIM features - order info and hosted CIM. #9

Closed chrislawlor closed 13 years ago

chrislawlor commented 13 years ago

Andrii,

First, thanks for the great app! I've been using django-authorizenet almost exclusively for CIM, and have added a couple of features:

  1. The ability to add extra merchant-specific information to CIM transactions (The 'order' node, which can contain invoice number, description, and / or purchase order number nodes)
  2. Support for getHostedProfilePageRequest, which is needed for using the Hosted CIM option.

I've also added a page to the sample application which illustrates the Hosted CIM option. To keep it simple, I've used a very slightly edited version of the sample files provided by Authorize.NET. This unfortunately necessitated adding some static media to the repo.

Please consider these enhancements for inclusion in the the primary django-authorizenet repo. Let me know if you'd like me to change anything up.

Thanks,

Chris

zen4ever commented 13 years ago

Thanks Chris. That's an excellent contribution. Credit for CIM supports belongs to @treyhunner I will try to review and merge your patch in the next couple days.

treyhunner commented 13 years ago

Passing the order_info keyword argument with invoice_number to cim.process_transaction works as expected for me.

I did not test the hosted CIM support.

chrislawlor commented 13 years ago

The above commits are minor formatting / commenting changes. I've also added new support for adding customer email and / or description when creating new customer profiles (committed below). This info appears in the CIM section (Tools --> Customer Information Manager), of the Authorize.NET console, and is useful for site managers when manually managing CIM data, since the User ID is not easy for them to find (doesn't appear by default in Django admin).

Also adds DeleteProfileRequest, with obvious functionality.

Not meaning to overload this pull request; it's a pretty small, backwards-compatible change though, and honestly I'm not sure how I can commit to my repo without adding to the pull request.

treyhunner commented 13 years ago

@chrislawlor, your most recent two commits broke the cim.add_user method (1f8ca8016e13062caf12bf07cb07717dc1b84237 broke add_user due to self.customer_id being replaced by self.customer_info).

I've added a modification that fixes this, adds more customer information to the signals, and uses a SortedDict for customer_info instead of a list of tuples (as seen here fefe0dc5fb2f0fbe5fbc5e21014ab0cb9138a0bc).

The topic/cim-add-user-fix branch in my repo contains these fixes. You should probably merge these changes or remove your last two commits from this pull request so the code is stable once again.

Thanks for your contributions.

treyhunner commented 13 years ago

No need to add the fix to this request. I've merged in the changes and the needed modifications.