Closed (fixed)
Project:
Commerce Be2Bill
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Jan 2013 at 14:25 UTC
Updated:
20 Feb 2014 at 10:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
JulienD commentedHere is a patch to add the card on file feature. I based my developments onto the fork of commerce_cardonfile.
This patch is adding the cardonfile functionality in the current payment method. To enable it, edit the payment method settings.
Implementing this feature wasn't as simple as I thought. The biggest reason was because we tried to combine two different payment method because be2bill is implemented as an off-site payment but their API can only be used in a REST mode and more like an on-site payment method. To implement it, I created a custom form and stored some information in the user session. I had a look on commerce_braintree which do something similar.
Commerce_cardonfile is not designed to be used for off-site payment methode and the module require a credit card field in the form or it couldn't works. So I added a field named as commerce_cardonfile wished in the form. I'm not happy with that but that issue should be asked to the maintener of commerce_cardonfile.
Also, Commerce_cardonfile need a credit card date to works but be2bill doesn't give us this information, so I created a fake credit card date with a validity of a year and a half.
Because Be2bill's card on file API is really simple I couldn't have the possibility to implement the create/update functionnalities. The customer has just the possibility to store a credit card during the checkout process or to delete a stored card, not much more
How to test :
- Installation and configuration:
- Doing an off-site payment and storing a card:
- Complete an order with a stored credit card
- Deleting a stored credit card
Comment #2
guguss commentedHi,
I tested your patch and it works fine with the fork of commerce_cardonfile !
Anyway, I think that patch should add a submodule which implements another payment method with CoF integration (See other payment modules like Payleap, Paypal...).
FYI: I also tested it with the non-forked module and I've the checkbox to enable Card on File, but the card is not stored on the user profile nor in the database. I know that's on purpose still !
Comment #3
guguss commented@Julien: It seems that the Card on File option is still available even if the merchant unchecked the Enable Card on File functionality.
The option shouldn't be displayed in that case.
Comment #4
JulienD commentedAre you talking about the option in the payments method list ? If yes, this form is provided by the Cardonfile module. I'll have a look on this !
Comment #5
guguss commentedYes that one ! When the box is unchecked, then the Card on File option shouldn't be displayed during checkout.
That's one reason to have 2 separate payment methods ^^
Comment #6
hazaNew patch with the current CoF -dev version.
Still only one payment method (that how it should be done, not 2 different payment method)
Comment #7
hazaNew patch, added an option to optin the card on file during checkout.
Change the "month/year" date of the CoF to "0/0" because we don't have the informations.
Comment #8
hazaBring back the "fake" end date. With more heavy (and deeeeeeeeep) testing, I just realized that wasn't working.
Comment #9
perusio commented@Haza thanks for the patch. It required some code modification to make it work with the current commerce_cardonfile. Commited with quite a few changes. Commit here: http://drupalcode.org/project/commerce_be2bill.git/commit/7dfa0d6.
Comment #10
perusio commented