Payfort is calling the address in the wrong way when we try to place an order on the cart page. It displays the following error:
2024-01-24T13:45:32+00:00 CRITICAL Uncaught TypeError: Argument 1 passed to WC_Order::set_shipping_address() must be of the type array, string given, called in /home/homebtsi/public_html/wp-content/plugins/woocommerce/includes/legacy/abstract-wc-legacy-order.php on line 338 and defined in /home/homebtsi/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php:1152
Stack trace:
5 /home/homebtsi/public_html/wp-admin/admin-ajax.php(203): do_actio in /home/homebtsi/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php on line 1152
I have fixed the issue by updating the code in woocommerce but it should be fixed in woocommerce payfort plugin
/**
Set the customer address.
@param array $address Address data.
@param string $type Type of address; 'billing' or 'shipping'.
*/
public function set_address( $address, $type = 'billing' ) {
// foreach ( $address as $key => $value ) {
// update_post_meta( $this->get_id(), "{$type}" . $key, $value );
// if ( iscallable( array( $this, "set{$type}{$key}" ) ) ) {
// $this->{"set{$type}_{$key}"}( $value );
// }
// }
if ( iscallable( array( $this, "set{$type}" ) ) ) {
$this->{"set_{$type}"}( $address );
}
}
Path of file
public_html/wp-content/plugins/woocommerce/includes/legacy/abstract-wc-legacy-order.php
Payfort is calling the address in the wrong way when we try to place an order on the cart page. It displays the following error: 2024-01-24T13:45:32+00:00 CRITICAL Uncaught TypeError: Argument 1 passed to WC_Order::set_shipping_address() must be of the type array, string given, called in /home/homebtsi/public_html/wp-content/plugins/woocommerce/includes/legacy/abstract-wc-legacy-order.php on line 338 and defined in /home/homebtsi/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php:1152 Stack trace:
0 /home/homebtsi/public_html/wp-content/plugins/woocommerce/includes/legacy/abstract-wc-legacy-order.php(338): WC_Order->set_shipping_address('')
1 /home/homebtsi/public_html/wp-content/plugins/woocommerce-payfort-master/includes/class-aps-ajax.php(404): WC_Abstract_Legacy_Order->set_address(Array, 'shipping')
2 /home/homebtsi/public_html/wp-includes/class-wp-hook.php(324): APS_Ajax->create_cart_order('')
3 /home/homebtsi/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
4 /home/homebtsi/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
5 /home/homebtsi/public_html/wp-admin/admin-ajax.php(203): do_actio in /home/homebtsi/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php on line 1152
I have fixed the issue by updating the code in woocommerce but it should be fixed in woocommerce payfort plugin /**