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

Results 141 to 160 of 199
28 May 2024, 11:10 PM
#141
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...

Does this module have some sort of BNPL (buy now pay later) functionality?

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.

29 May 2024, 4:01 AM
#142
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 the constructor, after setting sort_order and enabled, you should do a check:

        if (null === $this->sort_order) return;

....

i only write code that conforms to the PSR-12 standard...

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

29 May 2024, 4:06 AM
#143
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:

Does this module have some sort of BNPL (buy now pay later) functionality?

this module is based on the authorize.net sdk.

even though authorize.net is now owned by visa/mastercard, they have not updated the sdk in quite some time.

thankfully some other members of the opensource community have updated the sdk to be php 8.x compliant (which i am now using in this module). what happens to the sdk going forward is anyone's guess.

while the sdk "may" support BNPL, i have not looked into it. and given the sdk's uncertain future, i am hesitant (to say the least) of doing any unfunded development. if someone wants to fund development of BNPL functionality with this module, feel free to PM me.

else, this BNPL module has been out and functioning in the wild without problems for quite some time.

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.

30 May 2024, 1:42 PM
#144
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...

carlwhat:

this module is based on the authorize.net sdk.

even though authorize.net is now owned by visa/mastercard, they have not updated the sdk in quite some time.

thankfully some other members of the opensource community have updated the sdk to be php 8.x compliant (which i am now using in this module). what happens to the sdk going forward is anyone's guess.

while the sdk "may" support BNPL, i have not looked into it. and given the sdk's uncertain future, i am hesitant (to say the least) of doing any unfunded development. if someone wants to fund development of BNPL functionality with this module, feel free to PM me.

else, this BNPL module has been out and functioning in the wild without problems for quite some time.

best

so, right after i wrote the last post, it seems that the authorize.net people updated the sdk. you can read that here:

https://github.com/AuthorizeNet/sdk-php/issues/440#issuecomment-2137942712

so the sdk is still supported.

back to your original question, i do not see the sdk as providing a BNPL feature. not saying it is not there... i just do not see it.

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

30 May 2024, 2:55 PM
#145
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...

This could just be client confusion - thanks for checking into it.

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.

6 Jun 2024, 9:08 PM
#146
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...

CIM is showing refund/capture for one order id (paid by CIM) on the admin/orders screen for a second order id which was not paid by CIM. Has anyone else seen this?
CIM version 3.0.0/ Zen Cart 2.0.0.

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.

6 Jun 2024, 9:36 PM
#147
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...

It looks as though ./includes/classes/authnet_order.php start() function needs a way to indicate that the order was not paid with CIM, and ./includes/classes/observers/class.cim_admin_observer.php NOTIFY_ADMIN_ORDERS_PAYMENTDATA_COLUMN2 observer needs to check for this condition.

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.

6 Jun 2024, 9:37 PM
#148
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:

CIM is showing refund/capture for one order id on the admin/orders screen for a second order id. Has anyone else seen this?

if you are saying that the payment record is for a different order, then yes, i have seen it.

it is related to this bit of code, as well as a timing issue.

if 2 customers place orders at almost the same time, it is entirely possible that the order number for the payment records can get screwed up.

i have played around with different solutions over the years, but it really depends on how frequent the issue happens for any client.

i would find the records using mySql; correct them; make a note of it; and see if it happens again.

if it happens frequently, i can dig into the code and perhaps come up with a new solution.

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.

6 Jun 2024, 9:39 PM
#149
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:

It looks as though ./includes/classes/authnet_order.php start() function needs a way to indicate that the order was not paid with CIM, and ./includes/classes/observers/class.cim_admin_observer.php NOTIFY_ADMIN_ORDERS_PAYMENTDATA_COLUMN2 observer needs to check for this condition.

i'm not sure about this one.

again, i would check the payments table to see if the records are there and correct.

this idea seems to be compounding a problem as opposed to resolving it. unless i have the problem wrong.

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.

6 Jun 2024, 9:59 PM
#150
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...

When you add the code I have described, it correctly shows the table on the CIM order and correctly does not show the table on the non-CIM order.

Why would you ever want start() in ./includes/classes/authnet_order.php to look at non-CIM orders?

I don't think it's a race - here are the two timestamps from the orders table:

| 45291 | 2024-06-04 09:34:25 |
| 45293 | 2024-06-04 10:47:51 |

Also: why are you adding MODULE_PAYMENT_AUTHORIZENET_CIM_ALLOW_MORE to the check in admin/includes/classes/observers/class.cim_admin_observer.php line 70 -

I think you want the Get Money button to appear if there's a balance due, don't you?

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.

6 Jun 2024, 10:08 PM
#151
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...

... and I agree there are bad records in the payments table because the buttons for charging show up on orders that were not paid by authorize CIM.

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.

6 Jun 2024, 10:49 PM
#152
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...

Query I used for tracking down anomalies:

select c.orders_id, c.payment_name, o.customers_name, o.payment_module_code from authorize_cim_payments c, orders o where o.orders_id = c.orders_id;

be suspicious of entries where payment_module_code is not authorize_cim or the two name fields don't match - they could be problems.

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.

7 Jun 2024, 3:39 AM
#153
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:

Query I used for tracking down anomalies:

select c.orders_id, c.payment_name, o.customers_name, o.payment_module_code from authorize_cim_payments c, orders o where o.orders_id = c.orders_id;

be suspicious of entries where payment_module_code is not authorize_cim or the two name fields don't match - they could be problems.

@swguy, you have a lot of things going on here; most of which look to be of your own doing.

looking at your sql statement above, is rather curious. you are telling me that you have records in the authorize_cim_payments table where the order has a different payment module? how could that be?

those are both rhetorical questions, of which i am not looking for an answer.

years ago, i started a discussion about creating a payments table/abstract payment class that other payment modules could use to store payment records. but alas, that never resulted in any new code in the repo...

the fact that you are writing payment records to that table has nothing to do with this payment module.

with regards to the allow money and all of the observer information you are talking about, i would suggest you look for this notifier:

$zco_notifier->notify('NOTIFY_AUTHNET_PAYMENTS', '', $this);

which can be found here.

i believe you can do everything you want using that notifier.

that is what i do with my clients.

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.

7 Jun 2024, 9:50 AM
#154
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...

These issues occurred prior to making any changes.

looking at your sql statement above, is rather curious. you are telling me that you have records in the authorize_cim_payments table where the order has a different payment module? how could that be?

Easy. The original code shows those buttons on orders which were not paid by authorize. Someone accidentally clicks them, and you get bad records.
The ./includes/classes/authnet_order.php start() function should not return data if the original $oID is not an authorize_* order.

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.

7 Jun 2024, 10:27 AM
#155
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...

If the shop only accepts cim/cof, you wouldn't see this issue. But if it accepts other payment methods, and you look at an order paid by some other payment method in admin, you still see the CIM table.

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.

7 Jun 2024, 1:39 PM
#156
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...

carlwhat:

@swguy, you have a lot of things going on here; most of which look to be of your own doing.

with regards to the allow money and all of the observer information you are talking about, i would suggest you look for this notifier:

$zco_notifier->notify('NOTIFY_AUTHNET_PAYMENTS', '', $this);

> 
> which can be [found here](https://github.com/proseLA/authorizenet_cim/blob/f9ae406d72d151683c86abb6006804fef9eb75c3/admin/includes/classes/authnet_order.php#L126).
> 
> **i believe you can do everything you want using that notifier.**
> 
> that is what i do with my clients.
> 
> best.

my previous post, referenced here, has all of the information to solve your problem.

my client(s) have multiple payment modules enabled.

if you do not want the more money button to appear on non authorize orders i would suggest using that notifier and adding:

```php
$p2->amount_applied = $p2->order_total;

problem solved.

TIS.

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

25 Jun 2024, 9:49 PM
#157
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...

Thank you for this suggestion. The correct notifier name is NOTIFY_ADMIN_AUTHNET_PAYMENTS; once I changed this, your recommendation worked.

The next issue is stranger still. When you call nextOrderNumber, you pass in $order->info. But in the body of nextOrderNumber, you look for $order['orders_id'], which doesn't exist in the info array. Shouldn't this be $order['order_id'] (singular)?

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.

26 Jun 2024, 1:31 PM
#158
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:

Thank you for this suggestion. The correct notifier name is NOTIFY_ADMIN_AUTHNET_PAYMENTS; once I changed this, your recommendation worked.

The next issue is stranger still. When you call nextOrderNumber, you pass in $order->info. But in the body of nextOrderNumber, you look for $order['orders_id'], which doesn't exist in the info array. Shouldn't this be $order['order_id'] (singular)?

yes. that looks correct.

although in looking at the code, the method nextOrderNumber will never get called when there is an order_id.

change forthcoming.

thanks for pointing that out.

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

26 Jun 2024, 3:22 PM
#159
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...

The context here might be admin?

Next issue - really crazy-making, not sure how this can happen. COF transactions failing. Possibly related: The enabled field gets flipped to N when this happens.

[26-Jun-2024 09:36:49 America/New_York] PHP Fatal error: Uncaught Error: Typed property authorizenet_cim::$transID must not be accessed before initialization in /home/thatsoftwareguy4/client/includes/modules/payment/authorizenet_cim.php:382
Stack trace:
#0 /home/thatsoftwareguy4/client/includes/classes/payment.php(297): authorizenet_cim->after_process()
#1 /home/thatsoftwareguy4/client/includes/modules/pages/checkout_process/header_php.php(16): payment->after_process()
#2 /home/thatsoftwareguy4/client/index.php(82): require('/home/thatsoftw...')
#3 {main}
thrown in /home/thatsoftwareguy4/client/includes/modules/payment/authorizenet_cim.php on line 382

[26-Jun-2024 09:36:49 America/New_York] Request URI: /index.php?main_page=checkout_process, IP address: 68.73.117.78
--> PHP Fatal error: Uncaught Error: Typed property authorizenet_cim::$transID must not be accessed before initialization in /home/thatsoftwareguy4/client/includes/modules/payment/authorizenet_cim.php:382
Stack trace:
#0 /home/thatsoftwareguy4/client/includes/classes/payment.php(297): authorizenet_cim->after_process()
#1 /home/thatsoftwareguy4/client/includes/modules/pages/checkout_process/header_php.php(16): payment->after_process()
#2 /home/thatsoftwareguy4/client/index.php(82): require('/home/thatsoftw...')
#3 {main}
thrown in /home/thatsoftwareguy4/client/includes/modules/payment/authorizenet_cim.php on line 382.

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.

26 Jun 2024, 3:44 PM
#160
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:

The context here might be admin?

Next issue - really crazy-making, not sure how this can happen. COF transactions failing. Possibly related: The enabled field gets flipped to N when this happens.

[26-Jun-2024 09:36:49 America/New_York] PHP Fatal error: Uncaught Error: Typed property authorizenet_cim::$transID must not be accessed before initialization in /home/thatsoftwareguy4/client/includes/modules/payment/authorizenet_cim.php:382
Stack trace:
#0 /home/thatsoftwareguy4/client/includes/classes/payment.php(297): authorizenet_cim->after_process()
#1 /home/thatsoftwareguy4/client/includes/modules/pages/checkout_process/header_php.php(16): payment->after_process()
#2 /home/thatsoftwareguy4/client/index.php(82): require('/home/thatsoftw...')
#3 {main}
** thrown in /home/thatsoftwareguy4/client/includes/modules/payment/authorizenet_cim.php on line 382**

[26-Jun-2024 09:36:49 America/New_York] Request URI: /index.php?main_page=checkout_process, IP address: 68.73.117.78
--> PHP Fatal error: Uncaught Error: Typed property authorizenet_cim::$transID must not be accessed before initialization in /home/thatsoftwareguy4/client/includes/modules/payment/authorizenet_cim.php:382
Stack trace:
#0 /home/thatsoftwareguy4/client/includes/classes/payment.php(297): authorizenet_cim->after_process()
#1 /home/thatsoftwareguy4/client/includes/modules/pages/checkout_process/header_php.php(16): payment->after_process()
#2 /home/thatsoftwareguy4/client/index.php(82): require('/home/thatsoftw...')
#3 {main}
thrown in /home/thatsoftwareguy4/client/includes/modules/payment/authorizenet_cim.php on line 382.

i am not sure how this module is getting disabled in your setup.

line 382 does NOT correspond to the after_process method in my code.

in this situation, you have clearly modified my code.

i can debug problems that i can replicate from a vanilla install.

the information provided here seems to suggest putting me on some sort of wild goose chase:

  • not sure how this can happen.
  • maybe the admin?
  • maybe disabled?
  • incorrect line numbers from my own code?

my time for free support is limited; and the error that you are now presenting here is out of that limitation.

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