Forums / Addon Payment Modules / Authorize.net API with Card on File transactions support thread...

Authorize.net API with Card on File transactions support thread...

Views: 56,729

Results 81 to 100 of 199
14 Apr 2021, 9:31 PM
#81
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Authorize.net API with Card on File transactions support thread...

In includes/modules/payment/authorizenet_cim.php, the function getCustomerCards() returns the query result. Did you intend the process the query result and return an array as was done in includes/modules/payment/authorizenet_cof.php ? Because the way it is now makes no sense - see the references to the results of getCustomerCards in admin/includes/classes/observers/class.cim_admin_observer.php line 65 and 72 for example

$key = array_search($cc_index, array_column($cards, 'id'));

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

16 Apr 2021, 5:09 AM
#82
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

swguy:

In includes/modules/payment/authorizenet_cim.php, the function getCustomerCards() returns the query result. Did you intend the process the query result and return an array as was done in includes/modules/payment/authorizenet_cof.php ? Because the way it is now makes no sense - see the references to the results of getCustomerCards in admin/includes/classes/observers/class.cim_admin_observer.php line 65 and 72 for example

$key = array_search($cc_index, array_column($cards, 'id'));

perhaps this level of code discussion is better suited over at the publicly available github repository. i continuously update and release when necessary and perhaps it will be easier to point out your code issues in the latest version of the master branch.

it does seem that a refactor is necessary as the one function does return a query result while the other function does return an array. i will have to take a closer look to see why this was done the way it was, and whether or not there is a bug there. it is entirely possible.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

16 Apr 2021, 11:41 AM
#83
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Authorize.net API with Card on File transactions support thread...

Good point - will do.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

22 Nov 2021, 9:57 PM
#84
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: Authorize.net API with Card on File transactions support thread...

I'm having just a couple of issues getting the plug-in to work w/ ZC 1.5.7c; PHP 7.4.25; MySQL 5.5.5-10.3.32-MariaDB

  1. When confirming final checkout, I get an error:
    "Transaction Failed
    Error code : 11
    Error message : A duplicate transaction has been submitted."

Even though its not a duplicate - first time, new dollar amount, etc.

  1. Also, an error log is being created with every attempt indicating a fatal PHP error due to an incorrect datetime value. I've attached the logfile on that one.

I've rechecked to ensure that everything was uploaded and the data table looks right.

This may be a conflict w/ our template or some other mod, but wanted to throw it out here first to see if anyone has any ideas.

Thank you!

Matt

22 Nov 2021, 11:26 PM
#85
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

apollowilcox:

I'm having just a couple of issues getting the plug-in to work w/ ZC 1.5.7c; PHP 7.4.25; MySQL 5.5.5-10.3.32-MariaDB

  1. When confirming final checkout, I get an error:
    "Transaction Failed
    Error code : 11
    Error message : A duplicate transaction has been submitted."

Even though its not a duplicate - first time, new dollar amount, etc.

  1. Also, an error log is being created with every attempt indicating a fatal PHP error due to an incorrect datetime value. I've attached the logfile on that one.

I've rechecked to ensure that everything was uploaded and the data table looks right.

This may be a conflict w/ our template or some other mod, but wanted to throw it out here first to see if anyone has any ideas.

Thank you!

Matt

hey matt,
lets address the error log and see if the duplicate transaction gets fixed; which i think it will.

it seems that you have stumbled upon a problem that i have already addressed, but unfortunately is not up on the zen-cart plugin page. bad carl, bad!

it is related to strict mode on newer versions of mysql.

try and replace:

includes/modules/payment/authorizenet_cim.php

with this file here:

https://raw.githubusercontent.com/proseLA/authorizenet_cim/master/includes/modules/payment/authorizenet_cim.php

you can just copy and paste the file from there. alternatively i have attached it here:

Attachment #19836

let me know if that works. if so, i will re-upload so that it is up on the plugins for all to enjoy.

best.
p.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

23 Nov 2021, 3:41 PM
#86
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: Authorize.net API with Card on File transactions support thread...

Lol! Thanks Carl.
I uploaded the new code and upon confirming the test order, got the error screen and when I refreshed, I was completely logged out.

The same log file/ error of 'incorrect datetime value.'

Confirmed that the new file did upload and did it again just to make sure. Retried... same.

Attachment #19837

23 Nov 2021, 4:26 PM
#87
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

apollowilcox:

Lol! Thanks Carl.
I uploaded the new code and upon confirming the test order, got the error screen and when I refreshed, I was completely logged out.

The same log file/ error of 'incorrect datetime value.'

Confirmed that the new file did upload and did it again just to make sure. Retried... same.

Attachment #19837

ok, great thanks for that.

lets try changing a couple of lines in the same file. pretty convinced this will now work. lines 1521 and 1522:

//from
    $mod_date = null;
    $bindType = 'date';
//to
    $mod_date = 'null';
    $bindType = 'noquotestring';

if i ever do a refactor, i will remove these date fields and store them as integer using a UTC timestamp. so much easier to maintain.

let me know if this works.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

23 Nov 2021, 8:30 PM
#88
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: Authorize.net API with Card on File transactions support thread...

Thank you Carl. That indeed fixed the date issue. It led to one other error which caused the same symptoms and was simple enough even I was able to diagnose it.

Line 1640 of that same file needs a comma between :adminName**,** now()

$sql = "insert into " . TABLE_ORDERS_STATUS_HISTORY . " (comments, orders_id, orders_status_id, updated_by, date_added) values (:orderComments, :orderID, :orderStatus, :adminName, now() )";

(Commas can kill... Let's eat Grandma!)

Now she works!! We'll watch it for a few days.

Thanks so much for the support.

23 Nov 2021, 8:44 PM
#89
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

thanks for pointing that out. although i believe the line is 1620:

https://github.com/proseLA/authorizenet_cim/blob/48165dce0bcef10e7bc797776e8b833c41db786a/includes/modules/payment/authorizenet_cim.php#L1620

good catch. i'll have a new version up soon.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

23 Nov 2021, 9:04 PM
#90
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: Authorize.net API with Card on File transactions support thread...

So, we've been testing this mod a bit. We didn't even realize that the plug-in included one feature that it going to be super helpful.

With this plug-in, we can capture a *partial *amount and it will create a new authorization for the balance. The balance is displayed on the order-admin and can be easily captured later after the backorder ships. Super cool. Thanks Carl! We would have asked for this long ago but never even thought it possible.:D

23 Nov 2021, 11:57 PM
#91
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

apollowilcox:

So, we've been testing this mod a bit. We didn't even realize that the plug-in included one feature that it going to be super helpful.

With this plug-in, we can capture a *partial *amount and it will create a new authorization for the balance. The balance is displayed on the order-admin and can be easily captured later after the backorder ships. Super cool. Thanks Carl! We would have asked for this long ago but never even thought it possible.:D

:thumbsup:

i put a lot of work into it. i think it's a great payment module; but then again i'm biased.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

24 Nov 2021, 4:01 PM
#92
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

**v2.3.1 **submitted for approval.

reminder that php 7.0 is required for this version.

if your server is running less than php7.0, time to upgrade!

addresses fixes documented in thread above including mysql strict mode fixes for date fields. also continues code cleanup...

nbl.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

27 Nov 2021, 3:01 PM
#93
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

v 2.3.1 now available.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

1 Dec 2021, 7:35 PM
#94
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: Authorize.net API with Card on File transactions support thread...

Again, thanks for this great plug-in. There are a few minor (really minor) items that i would like to tweak for our application and i offer these up in case others agree or if you care to make it part of the vanilla plug-in.

  1. The dialog box that pops up to "Get the money!" is just a bit small. On our layout, we have to enlarge it to get to the Submit/ Cancel buttons. I'm not sure how to do that, but it would be a convenience to not have to resize it each time.
  2. Might be nice if the customer's account page would have a button where they could delete their card information, if it had been previously stored. Not a big deal, as they can contact us and its easy for us to do. Just a thought.
  3. [Even more minor]: Until the money has been captured, it might be more intuitive to have the first button read "Void" and not "Refund." once Captured, then "Refund" would show. Slightly misleading to think i can refund when actually it has not yet been captured.

Again, minor points on a effective and complex plug-in. I bought you some cake and hope others do as well. Thank you. :D

1 Dec 2021, 8:25 PM
#95
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

all good points. allow me to respond:

  1. i agree. if you go this file and line:

https://github.com/proseLA/authorizenet_cim/blob/4f59762bec7a229d73f7fc0200f4a8a14baa56e9/admin/includes/classes/observers/class.cim_admin_observer.php#L180

and change the part that says height=280 to height=480, does that fix your issue?

  1. customer maintenance of credit cards... did you install the card_update page? it seems a customer can delete cards from here:

yoursite.com/index.php?main_page=card_update

those files are here:

https://github.com/proseLA/authorizenet_cim/tree/master/includes/modules/pages/card_update
https://github.com/proseLA/authorizenet_cim/tree/master/includes/templates/YOUR_TEMPLATE

as is stated here:
https://github.com/proseLA/authorizenet_cim#notes-on-new-changes--not-previously-documented

one needs to update tpl_account_default.php to add a link to the card update.

  1. this is trickier. if i were to make a determination as to what to say on that button, i think the implication is that info is correct. so void pre-capture; and refund post-capture. hmmmm.... if you were to capture a transaction, and right afterwards attempt to refund it, a void window comes up. why is that? because once you hit the refund button, i am then making a call to auth.net to see what status the transaction is in. i do not remember the exact terminology, but lets call it settled for arguments sake... so we have auth -> capture -> settlement. the settlement happens automatically, but there are captured transactions that can ONLY be voided as they have not settled. once settled, they can ONLY be refunded. so changing the terminology based on the conditional you describe does not give you exact results. if we wanted exact results we could contact auth.net each time we go onto an orders detail page, but that to me is a waste of bandwidth as well as the admin's time.

in addition, voiding an authorization is something i have implemented, but its not necessarily something that has happened. auths put holds on funds, voiding an auth makes a request to the issuing bank to release said auth. the issuing bank may or may not chose to do so.

so as you say, i think this is a very minor issue, and one that i plan to leave well enough alone.... for now...

glad you like it!

let me know about option 1. i'll have that queued up for next release if it works for you.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

1 Dec 2021, 9:05 PM
#96
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: Authorize.net API with Card on File transactions support thread...

Wow. That's great Carl.
#1. Found that 'height = 380' was perfect for our template. Thanks for showing me where to do that.
#2 Those two files were uploaded, but did not find the actual edit required to add the call: > one needs to update tpl_account_default.php to add a link to the card update. Sorry, but I'm not seeing the specific language needed (and I'm not smart enough to come up with it myself). Is it in the readme?
#3 Good points. I understand and agree its not worth the trouble.

Thank you!

1 Dec 2021, 10:19 PM
#97
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

:thumbsup:

if you go into includes/templates/YOUR_TEMPLATE/templates/tpl_account_default.php and look for something like below and make the change.

//from
<li><?php echo ' <a href="' . zen_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . MY_ACCOUNT_INFORMATION . '</a>'; ?></li>
<li><?php echo ' <a href="' . zen_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . MY_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></li>
<li><?php echo ' <a href="' . zen_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . MY_ACCOUNT_PASSWORD . '</a>'; ?></li>

//to:
<li><?php echo ' <a href="' . zen_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . MY_ACCOUNT_INFORMATION . '</a>'; ?></li>
<li><?php echo ' <a href="' . zen_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . MY_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></li>
<li><?php echo ' <a href="' . zen_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . MY_ACCOUNT_PASSWORD . '</a>'; ?></li>
<li><?php echo ' <a href="' . zen_href_link(FILENAME_CARD_UPDATE, '', 'SSL') . '">Update My Credit Card(s)</a>'; ?></li>

hope that helps!

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

2 Dec 2021, 5:49 PM
#98
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: Authorize.net API with Card on File transactions support thread...

Thank you Carlwhat.

Had something interesting happen today. Customer called asking us to place the online order for her, which I did. Upon her request to not store her card, i unchecked the 'save my card.'

Later, I happened to be in authorize.net CIM for another customer and noticed the call-in customer's name. Sure enough, it had saved her card even though I definitely had unchecked the box. I then logged into the customer's account on our website, to delete the card and it shows the customer 'you have no cards on file.'

I then repeated this using my own card with a new order on my online account. Again, the card was saved to CIM (despite my request) and showed 'no card' on my customer account card_update page.

I'm not sure where to look/ what to do to address this.

Matt

2 Dec 2021, 6:10 PM
#99
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Authorize.net API with Card on File transactions support thread...

matt,
to actually delete the customers card, you need to do it from the admin.

doing it on the customers side removes it from them seeing it.

from the admin, if there is a delete button for the customers card, that means there are still cards on file; although some may not be visible to the customer.

hope that helps.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

2 Dec 2021, 7:28 PM
#100
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: Authorize.net API with Card on File transactions support thread...

Okay... that's good for me to understand. It seems a bit misleading to the customer. If it were me, I would expect that I truly deleted the card from existence with this vendor/ website.

Any thoughts or advice on the other issue: where the card is being stored despite the customer unchecking the "save this card" checkbox?

This is a complex plug-in. Amazing how well it works with Authorize CIM.