#rafal_api

1 messages ยท Page 1 of 1 (latest)

solid steepleBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1271052305159950409

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

icy violetBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

stable river
#

๐Ÿ‘‹ happy to help

bitter lantern
#

sory

#

how to get email

#

address I know but how to get email from that popup

stable river
bitter lantern
#

I was that but where exactly it is?

#

I saw*

#

expressCheckoutElement.on('click', (event) => {
const options = {
emailRequired: true,
phoneNumberRequired: true
};
event.resolve(options);
}); somehwere here?

#

where exactly, what property

bitter lantern
#

but can i get this somewhere here: expressCheckoutElement.on('shippingaddresschange', async function(event) {
try {
var resolve = event.resolve;
var address = event.address;
const response = await fetch(checkoutDataUrl, {
method: "POST",
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
country: address.country,
provider: providerName
})
});
const data = await response.json();
if (data.valid) {
resolve(data);
} else {
event.reject();
}
} catch (error) {
}
});

#

I have here url ajax for my endpoint and I need to save it during address changing

#

whenever client fill correctly address I am saving all and I want to save also email and his name

#

but then, not when he clicks confirm

stable river
#

please give me a second I'm just testing something

bitter lantern
#

okay

stable river
#

so basically when you do the onclick handler you need to pass the emailRequired: true option to the resolve

bitter lantern
#

I did: expressCheckoutElement.on('click', (event) => {
const options = {
emailRequired: true,
shippingAddressRequired: true,
shippingRates: [
{
id: 'free-shipping',
displayName: 'Free shipping',
amount: 0,
deliveryEstimate: {
maximum: {unit: 'day', value: 7},
minimum: {unit: 'day', value: 5}
}
},
]
};
event.resolve(options);
});

#

but here on the shippingaddresschange

#

I need to have somewhere that email to send it to my endpoint

#

how to do that?

stable river
#

and after you need to listen to the onconfirm handler and you will get the email in the billing details

bitter lantern
#

where, here: expressCheckoutElement.on('confirm', async (event) => {
const { error } = await stripe.confirmPayment({
elements,
clientSecret,
confirmParams: {
return_url: returnUrl,
},
});

        if (error) {
            console.error(error);
            
        } else {
            console.log('Payment successful');
        }
    }); ?
#

ok looks like i cant do it in same endpoint

stable river
#

in the event you have access to billingDetails

solid steepleBOT