Active
Project:
Commerce Card on File
Version:
7.x-2.0-beta5
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2015 at 18:04 UTC
Updated:
24 Aug 2018 at 19:03 UTC
Jump to comment: Most recent
Comments
Comment #2
renee_nistler commentedI am using:
Commerce License 7.x-1.3
Commerce License Billing 7.x-1.0-beta4
Card on File 7.x-2.0-beta5
Commerce Stripe 7.x-1.0
in Drupal 7.39
Comment #3
ahillio commentedAre you sure the card token is getting stored, that the card is actually being kept "on file"?
Comment #4
Kiendeleo commentedI am having this same issue with commerce_braintree
Comment #5
ahillio commentedRecurring orders will fail with "Hard Decline" when there is no card on file for the order's owner. Are you sure the card tokens are being saved successfully?
Comment #6
Kiendeleo commentedI can confirm that the cards are saving correctly in the Braintree Vault, I can charge them from the Braintree control panel.
Comment #7
ahillio commentedThat is different. The payment gateway (Braintree, Stripe, etc) can save the person's card, but that is different than commerce_cardonfile saving the card.
In Stripe, for example, the commerce_stripe payment method needs to be configured by admin to allow for commerce_cardonfile integration. Then, by default configuration, the customer has to check the box in order for commerce_cardonfile to save it.
You can see if the card is kept on file by going to the customer's user profile and clicking on the 'Stored cards' tab.
Comment #8
Kiendeleo commentedWell in my case, the braintree module is configured for card on file support, supposedly, and the card last 4 is being stored and visible from the saved card area. However when the recurring charges try to charge I get a fail hard decline.
Comment #9
ahillio commentedShucks. Well that part's working. Wish I knew what to look at next. I'm nearly certain this doesn't have anything to do with the rules config mentioned in the original post.
Comment #10
ahillio commentedComment #11
Kiendeleo commentedI think this issue has to do with this issue: https://www.drupal.org/node/2322681
Comment #12
Kiendeleo commentedSomething that also should be taken into consideration is that when the Authorize.net module is set to log API responses there are no log messages for Authorize.net when the re-bill takes place. This mean that the payment module isn't even requesting the transaction. This means that the Hard decline is actually happening in the card on file module.
Comment #13
Lord Pachelbel commentedrenee_nistler, the documentation you're referring to in your original post pertains to Commerce Recurring Framework, but you're using Commerce License and Commerce License Billing, so that documentation does not apply to your situation. Commerce Recurring Framework and Commerce License Billing are two different modules that ultimately do the same thing — recurring billing — but the latter one is the one that's meant to be used with Commerce License.
Anyway, I am also experiencing your problem, except I'm using Commerce Authorize.Net as the payment gateway module. I too am seeing that the users' cards are stored correctly in Drupal and in Authorize.net when the first purchase is made, so any hard declines after that are happening for some other reason, and I suspect they're either the fault of Commerce License Billing or Commerce Card on File. I also noticed what Kiendeleo pointed out, that Commerce Authorize.Net saved no log entries for my site's recurring transactions, and that could mean that Commerce Authorize.Net was never even invoked.
Comment #14
Lord Pachelbel commentedtl,dr; — To fix this, patch Commerce Card on File with #16 from #2000420: Checkout "Set as your default card" does not set default for NEW cards, and also patch the patch as per my comment in #21 (https://www.drupal.org/node/2000420#comment-11593817).
Explanation:
The problem is if a card is added to an account during checkout (the usual workflow), Commerce Card on File does not mark it as the default card no matter what the checkbox option says. That means that every time Commerce License Billing tries to do a recurring charge, Commerce Card on File has no default card data to pass along, and this causes a hard decline.
Commerce Card on File will only mark a card as the default card during checkout if the card is already on file. So without the patch, two possible workarounds are the following:
Neither of these workarounds are ideal, obviously, so please test the patch and report your results in that other issue. It worked for me but it's good to have additional confirmation.
Comment #15
Lord Pachelbel commentedComment #16
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... and I got the hard declined error.
Now I run latest dev, charges work fine again, no more hard decline... but:
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).
Comment #17
ibuildit commentedMy error I got above was related to this patch in commerce_braintree, the patch is no longer working.
https://www.drupal.org/project/commerce_braintree/issues/2718923