mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Handle missing shipping address for express block (virtual products)
This commit is contained in:
parent
2a0fa49800
commit
02bec2b611
1 changed files with 6 additions and 1 deletions
|
@ -71,7 +71,12 @@ export const paypalPayerToWc = (payer) => {
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
export const paypalOrderToWcShippingAddress = (order) => {
|
export const paypalOrderToWcShippingAddress = (order) => {
|
||||||
const res = paypalShippingToWc(order.purchase_units[0].shipping);
|
const shipping = order.purchase_units[0].shipping;
|
||||||
|
if (!shipping) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = paypalShippingToWc(shipping);
|
||||||
|
|
||||||
// use the name from billing if the same, to avoid possible mistakes when splitting full_name
|
// use the name from billing if the same, to avoid possible mistakes when splitting full_name
|
||||||
const billingAddress = paypalPayerToWc(order.payer);
|
const billingAddress = paypalPayerToWc(order.payer);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue