mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Fix empty purchase units error on shipping
This commit is contained in:
parent
d5190d2e74
commit
d4c5d31b77
1 changed files with 3 additions and 2 deletions
|
@ -89,8 +89,9 @@ class WooCommerceOrderCreator {
|
|||
}
|
||||
|
||||
try {
|
||||
$payer = $order->payer();
|
||||
$shipping = $order->purchase_units()[0]->shipping();
|
||||
$payer = $order->payer();
|
||||
$purchase_units = $order->purchase_units();
|
||||
$shipping = ! empty( $purchase_units ) ? $purchase_units[0]->shipping() : null;
|
||||
|
||||
$this->configure_payment_source( $wc_order );
|
||||
$this->configure_customer( $wc_order );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue