omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

Bug fixed on guest user checkout #374

Closed ajzkk closed 1 year ago

ajzkk commented 1 year ago

1. Objective

Bug fixed on guest user checkout

2. Description of change

When $user = $order->get_user(); is empty, $user->test_omise_customer_id or $user->live_omise_customer_id will throw attempt to read property test_omise_customer_id from null.

So we need to check user is not empty before we get value from user.

3. Quality assurance

Create manual order with guest user from admin panel and use customer payment page link to make payment where user is not logged in (eg. try with different browser).

4. Impact of the change

N/A

5. Priority of change

Normal