Review add_payment_params function – breaking
-
Hi,
in class-paypal-express-request-builder.php (add_payment_params) you add shipping data to the request data by checking for empty fields and skip any shipping field if ONE field is empty from checkout.
- You include “SHIPTOPHONENUM” (which is billing_phone in woo). If a shop doesn’t collect or require customers phone numbers, this will always trigger and will remove all shipment data from the request.
- You are missing SHIPTOSTREET2 in the second check (within the foreach).
- Both #1+#2 combined result into a bug if a shop uses the shipping_address_2 field:
a) phone is empty, so all shipping fields are skipped
b) SHIPTOSTREET2 is not removed, because it’s not part of the loop
c) this leads to validation error, plugin / paypal expecting now a full address / country code etc.
Latest plugin, woo and wordpress version btw.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Review add_payment_params function – breaking’ is closed to new replies.