Hi there. I've spent some time trying to create subscription using commerce_recurring + commerce_cardonfile + commerce_braintree modules and I've found that commerce_braintree does not provide "charge callback" required for the "charge an order with a card on file" action of the commerce_cardonfile module.
I think that such kind of subscription is more flexible than Braintree Plans, which can't be controlled programmatically. I've created a patch (just for demonstration of my idea) for the "charge callback", but I'm not too familiar with braintree or cardonfile so I may miss something.
What do You think?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | commerce_braintree-provide_charge_callback-2162917-2.patch | 4.23 KB | andyg5000 |
| #1 | commerce_braintree-charge_callback-2162917-1.patch | 4.12 KB | artem_sylchuk |
| commerce_braintree-charge_callback.patch | 4.15 KB | artem_sylchuk |
Comments
Comment #1
artem_sylchukFixed missing newline.
Comment #2
varshith commentedWill there be any development reg. this issue?
I am using commerce_license_billing with commerce_braintree
It took me a while to find out that "charge callback" is required for the recurring payment.
Thanks @james_kerrigan for providing a base to start with
Comment #3
andyg5000This is an old one. Not sure how I missed this all along. Things have changed a bit, so here's a rewrite.
Comment #4
andyg5000Comment #7
ibuildit commentedI'm reopening this because I think my error is related to this.
The combination Recurring - Braintree - Card on file worked great until a couple of days ago for me. I used to run stable, but Braintree stopped recieveing transactions... now I run latest dev.
I'm now getting this error below - but ONLY when I tick the checkbox in Braintree Hosted Fields configuration (checkout rule) to use Card on File / vault functionality. The charge happen just fine, but Drupal crashes and does not create the user account. I have no idea what to do about this unfortunately.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'name': INSERT INTO {users} (uid, name, pass, mail, theme, signature, signature_format, created, access, login, status, timezone, language, picture, init, data, uuid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16); Array ( [:db_insert_placeholder_0] => 376 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => 0 [:db_insert_placeholder_9] => 0 [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => [:db_insert_placeholder_12] => [:db_insert_placeholder_13] => 0 [:db_insert_placeholder_14] => [:db_insert_placeholder_15] => a:1:{s:15:"braintree_vault";a:8:{s:2:"id";s:9:"506664114";s:9:"firstName";N;s:8:"lastName";N;s:7:"company";N;s:5:"email";s:22:"sdfdfhdfgh@ibuildit.se";s:7:"website";N;s:5:"phone";N;s:3:"fax";N;}} [:db_insert_placeholder_16] => e67d0e05-e216-4e34-be90-c1180a436e21 ) in drupal_write_record() (line 7404 of /srv/bindings/df4c642081724bf2b488ea8bfb98bbe3/code/includes/common.inc).