use order_number instead of internal id and filter purchase unit

This commit is contained in:
websupporter 2021-05-18 10:20:10 +03:00
parent 437a6654c5
commit b50dfe9700

View file

@ -119,7 +119,7 @@ class PurchaseUnitFactory {
$reference_id = 'default'; $reference_id = 'default';
$description = ''; $description = '';
$payee = $this->payee_repository->payee(); $payee = $this->payee_repository->payee();
$wc_order_id = $order->get_id(); $wc_order_id = $order->get_order_number();
$custom_id = $this->prefix . $wc_order_id; $custom_id = $this->prefix . $wc_order_id;
$invoice_id = $this->prefix . $wc_order_id; $invoice_id = $this->prefix . $wc_order_id;
$soft_descriptor = ''; $soft_descriptor = '';
@ -134,7 +134,11 @@ class PurchaseUnitFactory {
$invoice_id, $invoice_id,
$soft_descriptor $soft_descriptor
); );
return $purchase_unit; return apply_filters(
'woocommerce-paypal-payments.purchase-unit.from-wc-order',
$purchase_unit,
$order
);
} }
/** /**