Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Implement the Be2Bill payment method to integrate with Commerce Card on File module.
Comment | File | Size | Author |
---|---|---|---|
#8 | commerce_be2bill-card_on_file_integration-1882136-8.patch | 19.82 KB | Haza |
#7 | commerce_be2bill-card_on_file_integration-1882136-7.patch | 19.78 KB | Haza |
#6 | commerce_be2bill-cof_integration-1882136.patch | 18.59 KB | Haza |
#1 | commerce_be2bill-card_on_file_integration-1882136-1.patch | 15.96 KB | JulienD |
Comments
Comment #1
JulienD CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: perusio commented