Hi,
I have installed the Antom Payment Plugin and registered for Antom Account. I have put in test credentials and I am testing with AlipayHK payment method however I cannot make it past the checkout. I have opened developer tools and I can see the request /?wc-ajax=checkout return a error 500.
When I turn on WP_DEBUG, I can see the following error:
[17-Oct-2024 05:27:34 UTC] PHP Fatal error: Uncaught TypeError: strlen(): Argument #1 ($string) must be of type string, array given in /nas/content/live/newmeowilld/wp-content/plugins/antom-payments/includes/model/order/antom-order-payment-method-model.php:295
Stack trace: 0 /nas/content/live/newmeowilld/wp-content/plugins/antom-payments/includes/gateways/class-wc-gateway-antom-common.php(448): Antom_Order_Payment_Method_Model->set_extend_info(Array) 1 /nas/content/live/newmeowilld/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1062): WC_Gateway_Antom_Common->process_payment(19966) 2 /nas/content/live/newmeowilld/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1293): WC_Checkout->process_order_payment(19966, 'antom_alipay_hk') 3 /nas/content/live/newmeowilld/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(520): WC_Checkout->process_checkout() 4 /nas/content/live/newmeowilld/wp-includes/class-wp-hook.php(324): WC_AJAX::checkout('') 5 /nas/content/live/newmeowilld/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) 6 /nas/content/live/newmeowilld/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 7 /nas/content/live/newmeowilld/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(96): do_action('wc_ajax_checkou…') 8 /nas/content/live/newmeowilld/wp-includes/class-wp-hook.php(324): WC_AJAX::do_wc_ajax('') 9 /nas/content/live/newmeowilld/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(false, Array) 10 /nas/content/live/newmeowilld/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 11 /nas/content/live/newmeowilld/wp-includes/template-loader.php(13): do_action('template_redire…') 12 /nas/content/live/newmeowilld/wp-blog-header.php(19): require_once('/nas/content/li…') 13 /nas/content/live/newmeowilld/index.php(17): require('/nas/content/li…') 14 {main}
thrown in /nas/content/live/newmeowilld/wp-content/plugins/antom-payments/includes/model/order/antom-order-payment-method-model.php on line 295
I have followed the stack trace and I believe the issue comes from the file:
File: antom-payments/includes/gateways/class-wc-gateway-common.php
Line 332 - extend_info is a associative array and not a normal array
$extend_info = array(
'PaymentSource' => 'WooC',
);
Line 448 - when we try to call the method set_extend_info from the function below, it generates the error above due to data type mismatch
File: antom-payments/includes/model/order/antom-order-payment-model.php
Line 294 - The function strlen expects a string or a array of string, not an associative array.
public function set_extend_info( $extendInfo ) {
if ( strlen( $extendInfo ) > 2048 ) {
throw new InvalidArgumentException( 'extendInfo must be less than 2049 characters' );
}
$this->offsetSet( 'extendInfo', $extendInfo );
}
Unfortunately I am unsure what is the intended data type in this situation, so I don’t know how to fix. Is it possible to get any assistance with this? I would really love to deploy this plugin and move to Antom. I am currently using stripe for alipay payments
]]>