Closed Sidsector9 closed 1 year ago
First of all onPaymentProcessing
is deprecated, you should use onPaymentSetup
instead.
Using billingData and shippingData is also depricated, and you should use billingAddress
and shippingAddress
.
As for your problem, validation seems to fail silently for you, but your shipping address is failing at isShippingAddress
because it's missing the phone attribute.
You should pass it even if it's empty
'first_name',
'last_name',
'company',
'address_1',
'address_2',
'city',
'state',
'postcode',
'country',
'phone',
We can probably make this check more vocal.
Thanks @senadir that worked.
I referred to these documentation pages:
Please correct me if I am referring to an outdated documentation. If not, I wish to contribute to the Wiki pages.
Those tutorials are outdated indeed, sorry for that! I will rename this issue to address that.
Added this to https://github.com/woocommerce/woocommerce/issues/42264; cc @opr
Describe the bug
I am implementing an express payment method (digital wallet) where the shipping address needs to be set from the info returned by the wallet.
Setting
billingData
works butshippingAddress
does not work. This causes thewoocommerce_rest_invalid_address
error and the only way to resolve this is to set the shipping address fields in the Block Checkout form.May be related to issue woocommerce/woocommerce-blocks#8785
To reproduce
Steps to reproduce the behavior:
Return shipping address in the observer for
onPaymentProcessing()
in the following format:So far, I have also tried the older response shapes for shipping data:
and
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
WordPress (please complete the following information):
Additional context
Add any other context about the problem here.