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,732

Results 101 to 120 of 199
2 Dec 2021, 9:16 PM
#101
carlwhat avatar

carlwhat

zennedOut

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

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

apollowilcox:

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.

matt,
perhaps you can see the contradictions in the things that you say here. perhaps not....

there is a reason why everything is done the way it is done.

with regards to thoughts or advice, if you want to change the way the plugin operates, you are free to do so. if you would like me to do it, feel free to PM me.

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.

11 Feb 2022, 4:32 PM
#102
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.2 **now ready for downloading!

reminder that php 7.0 is required for this version.

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

more fixes with regards to mysql strict mode; running under php 8.1; new notifier; and further bug fixes. also removes all references to the deprecated (under php 8.1) strftime method.

enjoy!

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.

22 Jun 2022, 7:14 PM
#103
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...

In getTransactionDetails(), I'm seeing logs on includes/modules/payment/authorizenet_cim.php" line 1263

PHP Fatal error: Uncaught Error: Call to a member function getMessages() on null

Should the two lines

           $errorMessages = $response->getMessages()->getMessage();
           $logData .= "Response : " . $errorMessages[0]->getCode() . "  " . $errorMessages[0]->getText() . "\n";

be wrapped in a check for ($response != null)?

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 Jun 2022, 9:46 PM
#104
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 getTransactionDetails(), I'm seeing logs on includes/modules/payment/authorizenet_cim.php" line 1263

PHP Fatal error: Uncaught Error: Call to a member function getMessages() on null

Should the two lines

           $errorMessages = $response->getMessages()->getMessage();
           $logData .= "Response : " . $errorMessages[0]->getCode() . "  " . $errorMessages[0]->getText() . "\n";

be wrapped in a check for ($response != null)?

@swguy,
i do not think so. i would look into why the $response is null. that method seems real simple to me:

  • it creates a request.
  • it populates the request with the merchant credentials.
  • it populates the transaction id.
  • it then makes a request via the controller.

i have not been able to get a $response of null, despite trying. (and i do see this line, where that same conditional seems superfluous):

https://github.com/proseLA/authorizenet_cim/blob/7d84358c827c8e62126c592f75020c57993142dc/includes/modules/payment/authorizenet_cim.php#L1256

if i populate $transactionId with a random numeric, i still get a response. the message is:

The record cannot be found.

if i populate $transactionId with null or a character string, i get the following message:

The element 'getTransactionDetailsRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'refId, transId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

something seems much further off in the implementation to be getting a null value as the $response.

is this a new install? are you sure the merchant credentials are correct?

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 Nov 2022, 6:08 PM
#105
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

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

For the setting Validation Mode (liveMode validates cardInfo) what should it be set to? **None **or Livemode

I set it to **Livemode **initially but that generates two transitions per sale one the actual sale and another which is voided with he following statement:
"Test transaction for ValidateCustomerPaymentProfile."

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

2 Nov 2022, 12:31 AM
#106
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...

marcopolo:

For the setting Validation Mode (liveMode validates cardInfo) what should it be set to? **None **or Livemode

I set it to **Livemode **initially but that generates two transitions per sale one the actual sale and another which is voided with he following statement:
"Test transaction for ValidateCustomerPaymentProfile."

hi marco,
you can read about it here:

https://tinyurl.com/24lbescc

so what you are seeing is correct.

copied from that page:

Specifies how the payment gateway will validate the customer's card prior to creating the profile. Either liveMode or testMode. The field defaults to liveMode.

liveMode generates a transaction to the processor in the amount of 0.01 or 0.00. If successful, the transaction is immediately voided. Visa authorizations in liveMode use 0.00 for all processors. All other credit card types use 0.01.

Standard gateway and merchant account fees may apply to the authorization transactions. For Visa transactions using 0.00, the billTo address and billTo postal code fields are required.

testMode performs field validation only. All fields are validated. However, fields with unrestricted field definitions, such as telephone number, do not generate errors.

If you set this parameter to testMode, a 1.00 test transaction is submitted using the Luhn mod 10 algorithm to verify that the credit card number is in a valid format. This test transaction is not authorized at the processor, and does not appear on the customer's card statement, but it will generate and send a transaction receipt email to the merchant.

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.

5 Nov 2022, 5:44 PM
#107
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

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

Found a bug:

If a credit card that was previously used to make an order and customer choose NOT to save it then looking at the table customers_cc the enable field is N which hides the card from the customer update card screen and having it available as a saved card for future COF orders.

Now if the customer on a future order uses the same card but this time chooses to save it then the table customers_cc enabled field is not being updated to Y from N.

If you ADD the card from the update card page that does work.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

6 Nov 2022, 7:39 PM
#108
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

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

Another Bug:

If you try to update the billing address from the card_update page it does not change it on Authorize.net CIM online profile. You can update the credit card expiration date from card_update page just the address is not updating. Also when adding a new address from the card_update the company name is not being populated on Authorize.net CIM online profile.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

7 Nov 2022, 3:30 AM
#109
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...

i will look at it when i can...

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.

11 Nov 2022, 5:38 PM
#110
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

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

carlwhat:

i will look at it when i can...

best.

Great thank you. Below fixes the one issue where the company name is not being populated when adding a new address from the update_card page.

Around line 603 added the line that is in green below:
$return['company'] = $_POST['company'];

 if ($_POST['address_selection'] == 'new') {
                $this->addNewAddress();

                $return['firstname'] = $_POST['firstname'];
                $return['lastname'] = $_POST['lastname'];
                $return['company'] = $_POST['company'];
                $return['street_address'] = $_POST['street_address'];
                $return['city'] = $_POST['city'];
                if (empty($_POST['zone_id'])) {
                    $return['state'] = $_POST['state'];
                } else {
                    $return['state'] = zen_get_zone_name($_POST['zone_country_id'], $_POST['zone_id'],
                        ($_POST['state'] ?? ''));
                }
                $return['postcode'] = $_POST['postcode'];
                $return['country']['title'] = zen_get_country_name($_POST['zone_country_id']);

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

11 Nov 2022, 5:51 PM
#111
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

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

The following are just recommendations for a future update to this module:

1: The billing address address book id is not being saved so when you go to update a credit card you do not know which address is currently associated with that CC # on authorize.net

2: When capturing the credit card store what type of card it is like Visa, Master Card, Amex, Discover. That can then be used to show the credit card's logo associated with the credit card being updated on the card_update page.

3: Shipping address is not being populated on authorize.net Transaction Detail page at time of order, that is helpful to have as a backup way of confirming what shipping address was selected by a customer when the order was placed.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

11 Nov 2022, 9:16 PM
#112
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...

marco,
i would suggest using the public github repo as opposed to having these discussions here.

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.

11 Nov 2022, 10:11 PM
#113
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

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

carlwhat:

marco,
i would suggest using the public github repo as opposed to having these discussions here.

best.

Ok no problem I submitted the code changes on there and added the remaining billing address update issue there as well.

I did not see anyplace to add the three feature recommendations let me know if there is a place for that.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

12 Nov 2022, 3:28 PM
#114
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...

marcopolo:

Found a bug:

If a credit card that was previously used to make an order and customer choose NOT to save it then looking at the table customers_cc the enable field is N which hides the card from the customer update card screen and having it available as a saved card for future COF orders.

Now if the customer on a future order uses the same card but this time chooses to save it then the table customers_cc enabled field is not being updated to Y from N.

If you ADD the card from the update card page that does work.

this has been fixed on the repo.

marcopolo:

Great thank you. Below fixes the one issue where the company name is not being populated when adding a new address from the update_card page.

Around line 603 added the line that is in green below:
$return['company'] = $_POST['company'];

if ($_POST['address_selection'] == 'new') {
$this->addNewAddress();

            $return['firstname'] = $_POST['firstname'];
            $return['lastname'] = $_POST['lastname'];
            $return['company'] = $_POST['company'];
            $return['street_address'] = $_POST['street_address'];
            $return['city'] = $_POST['city'];
            if (empty($_POST['zone_id'])) {
                $return['state'] = $_POST['state'];
            } else {
                $return['state'] = zen_get_zone_name($_POST['zone_country_id'], $_POST['zone_id'],
                    ($_POST['state'] ?? ''));
            }
            $return['postcode'] = $_POST['postcode'];
            $return['country']['title'] = zen_get_country_name($_POST['zone_country_id']);

this has also been fixed on the repo.

> **marcopolo:**
>
> The following are just recommendations for a future update to this module:
> 
> 1: The billing address **address book id** is not being saved so when you go to update a credit card you do not know which address is currently associated with that CC # on authorize.net
> 
> 2: When capturing the credit card store what type of card it is like Visa, Master Card, Amex, Discover. That can then be used to show the credit card's logo associated with the credit card being updated on the card_update page.
> 
> 3: Shipping address is not being populated on authorize.net Transaction Detail page at time of order, that is helpful to have as a backup way of confirming what shipping address was selected by a customer when the order was placed.

i'm not sure about these recommendations.  i will give them some thought.

my opinion is that auth.net is for getting paid.  it is not for verifying order details.

1. i have never felt that the address is necessary to save and to verify it.  currently every zen-cart order has 3 address fields; so now you want to verify the credit card address with the zen-cart address?  i have never been a fan of ensuring that the billing address with the credit card is in the ZC db.  most times it already is...  but for me, have auth.net validate the card details, send me a token, and as long as that token works, use that for charging a customer.  feel free to convince me other wise (although lets move it over to an issue on the repo...).

2. a database change.  maybe.

3. codd-date normal form.  if auth.net does not match, which address are you going to use?

in the 10+ years this module has been in use at my clients, they have never made these requests.  but maybe...

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

12 Nov 2022, 3:54 PM
#115
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

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

1: Real world use in my companies case is sometimes customers will state that they selected a shipping address and that we sent it to the wrong address and this is just another way to confirm what was captured at the time of order. We could login to auth's website to confirm what was captured at the time of order. Not a big deal just that extra spot to check something.

3: If I was a customer and recently moved I would change my stored billing addresses with companies I have stored cc's with. The update card page edit cc section now does not show what address is stored for the credit card just gives a list of address(s) I have in my address book. So if I was the customer and was trying to update this I (me personally) would select the address or add a new one if not listed then submit. I would then go back in to verify it is now the billing address.

This is where I pointed out the recommendation for capturing the address id so it can be confirmed back to the customer that the billing address has been updated if they want to confirm it.

If you do update the logic on this page I would simply store the address id that the customer selected for the card and if still in the database have it be auto be selected with a message saying current billing next to the address. If the address has been deleted over time then keep current logic in which case the customer will update the address and if goes back into the screen to verify it will work as intended.

Note there is a bug now if you try updating the address it says you did but does not update on auth's website.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

23 Nov 2022, 4:43 PM
#116
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

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

Two more feature ideas I had for this module.

1: Allow customer to set a default card to be auto selected at checkout if they have multiple cards saved.

2: If an **ADMIN **is placing the order give an option to **Authorize **only or Authorize+Capture the sale at checkout.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

11 Feb 2023, 11:11 PM
#117
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...

@carlwhat would you please review and provide feedback for:

https://docs.zen-cart.com/user/payment/authorizenet_cim/

I just realized last week that there was no documentation for this plugin.

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.

12 Feb 2023, 4:11 PM
#118
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:

@carlwhat would you please review and provide feedback for:

https://docs.zen-cart.com/user/payment/authorizenet_cim/

I just realized last week that there was no documentation for this plugin.

done!

minor changes.

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

12 Feb 2023, 4:29 PM
#119
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...

great - merged.

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.

30 Aug 2023, 3:25 PM
#120
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...

I have a customer whose customers.customers_default_address_id values are getting scrambled - sometimes 0, sometimes another customer's address_book entry. Have you ever heard of this? Running authorizenet_cim version 2.3.2.

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.