#B33fb0n3
1 messages · Page 1 of 1 (latest)
- name and email should be handled in your integration (frontend form)
so I need to create my own form fields and then just for the payment itself the customer can use the express checkout element?
- You set
shippingAddressRequired: truewhen creating the elements ?
What is the undefinded. Can you share more details about the error ?
yeap
oh ok 😦
yeah
What is the undefinded
event.shippingAddressthis is undefined
Can you share more details about the error ?
there is no error. If I try to use it, it's just undefined
the variable does not contain anything
Can you share some of your integration please?
sure, what do you want to see? The onShippingAddressChange function?
your on click and on shippingaddresschange handlers.
Thats the function: https://paste.gg/p/B33fb0n3/e9de57c700eb4ce585296f484df1169c
Thats the click function:
https://paste.gg/p/B33fb0n3/6120a8d38d054b57b3e0f304f17e54f8
I know it's not right to generate the paymentintent on click, but I also validate the items in the process. Because of that you see some timeout functions because the click element need to be resolved in under one second and I dont know if the API respond in under one second
Yes this is not recommended to add timeouts... but I don't think that has a direct link to the address issue.
direct link to the address
why should it?
So the event shippingaddresschange is being called but the shippingAddress is undefined. Did you try to log the event object by chance ?
I said I don't think that has a direct link...
Yes, I logged it and it's undefined
what the event object is undefined too ?
oh, I overlooked that. Sorry.
the event itself not
the event looks like that: https://ibb.co/m5f0bjc
Could you please narrow the data object ?
sure:
"type": "inner",
"controllerId": "__privateStripeController9901",
"frameId": "__privateStripeFrame9906",
"message": {
"action": "stripe-frame-event",
"payload": {
"event": "shippingaddresschange",
"data": {
"nonce": "shippingaddresschange84314",
"paymentMethodType": "google_pay",
"address": {
"city": "The real City",
"state": "",
"postal_code": "the real postal code",
"country": "DE"
},
"name": ""
}
}
},
"__stripeJsV3": true
}```
I see there is address, I think you can use that. But I'm not sure why event.shippingAddress is undefined in your use case. Is it possible to share the complete integration (or a sample project that has only the minimum shippingAddress requirements and that re produces your issue)
I'm afraid that in your integration you are having something particular that is causing this...
hm let me check this
that may be. I don't even know, where the event is coming from? @wide wind
the event variable is nowhere defined in the stripe documentation 🤔
it is documented
https://stripe.com/docs/js/payment_request/events/on_shipping_address_change
When called it will be passed an event object with the following properties:
which is a function and a https://stripe.com/docs/js/appendix/shipping_address , so henceevent.shippingAddressexists and has that shape
but I see now you're not using the PaymentRequestButton, you're using the ExpressCheckoutElement
which is a new thing that is a beta and our team doesn't have training on
so I'd suggest reaching out to the team who helped you get access to it and they can provide beta support!
I never asked for any I think. I just logged out the whole event which is pharsed by the function and got this element:
{
"elementType": "expressCheckout",
"name": "",
"address": {
"city": "abc",
"state": "",
"postal_code": "12345",
"country": "DE"
}
}
and the reject and resolve funtion. So I won't get the full name and the full address, but the near address
the resolve function also have an e in it. Should I use that?
I have no idea, I don't know how this ExpressCheckoutElement integration works