#wagamumma_webhooks

1 messages ยท Page 1 of 1 (latest)

mossy ledgeBOT
#

๐Ÿ‘‹ 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/1374716319261524048

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

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.

wind sierra
#

$paymentIntent = $event->data->object;

$paymentMethod = $stripe->paymentMethods->retrieve(
$paymentIntent->payment_method,
[]
);

$name = $paymentMethod->billing_details->name;

#

this doesn't seem to return the billing name at all can you see what could be wrong here?

inner spade
#

hi there!

wind sierra
#

$saddress = $paymentIntent->shipping->address;
$shippingname = $paymentIntent->shipping->name;

These return the shipping address and name perfectly but I need the billing name as well

#

hi ๐Ÿ™‚

inner spade
#

it should be on the PaymentMethod object

wind sierra
#

So what I did should work?

#

The other issue we have is getting a phone number in google/apple pay, every time it just returns "null" even though phone numbers are set up on the google and apple accounts?

#

thats the output log of the shipping details, everything else is there fine

mossy ledgeBOT
flat tartan
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

#

you can either see the billingDetails on the latest_charge of the PI or by looking at the PM used to collect the payment as my colleague described

wind sierra
#

yeh I do have that, it's really strange! I will keep testing and see what I can do, do you know if it's possible that Apple pay somehow isn't sending names/phone numbers with the same details as Google pay does, as it's working in google pay but not apple?

flat tartan
#

hmmmm maybe

#

if you have an accessible website where I could test this I could get a better understanding

wind sierra
#

sadly it's all "live" at the moment so you'd have to spend real money to test it

#

it just seems weird if apple pay sends back different info to what Stripe is expecting? I thought the payment method would be a catch all whatever the payment method?

flat tartan
#

could you make a version in test mode/sandbox where the issue could be replicated so I could test it out

wind sierra
#

it'd take a while to do that but we're just testing apple pay 1 last time now, if it doesn't work I'll set up another test area and start a new thread here?

flat tartan
#

you don't have to start a new thread if this one is not closed yet

modest quest
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away soon. Can you also confirm which of our Elements you're using here?

I ask, because the Payment Method from the Event you shared looks like it was created from our Payment Element, rather than the Express Checkout Element.

wind sierra
#

Hi I'm not 100% sure on that, this is in a webhook and we just do this:

$stripe = new \Stripe\StripeClient($stripeSecretKey);

$payload = @file_get_contents("php://input");
$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];
$endpoint_secret = '****';

try {
$event = \Stripe\Webhook::constructEvent(
$payload, $sig_header, $endpoint_secret
);
switch ($event->type) {
case 'payment_intent.succeeded':
$paymentIntent = $event->data->object; // contains a \Stripe\PaymentIntent

#

everything seems to work fine it's just getting the name/phone from apple pay doesn't seem to work, though the last test the phone number was there but still no billing name , the billing name works fine in google pay just not apple pay

modest quest
#

If you're using the Payment Element, you can't force it to collect billing details from wallets payment methods. That functionality is only available via the Express Checkout Element.

wind sierra
#

is there a doc showing what you mean sorry I don't really understand it all fully

modest quest
wind sierra
#

It's both I guess, we have the express elements (just google and apple pay) for customers not registered/signed in to speed up checkout, otherwise they can enter their details and use the full payment element form instead. it does all work so I think it's OK just for some reason not getting a name with apple pay for billing, only for shipping details. Everything works fine otherwise its getting all the customer address, order details etc fine

modest quest
#

Gotcha, well it's expected for the Payment Element to not collecting full billing details. Neither from wallets nor most other payment method types. The Payment Element is designed to collect only information that has a substantial impact in authorization rates, it doesn't ask for more to minimize customer friction.

wind sierra
#

Do I need to change anything then? Because like I say its working 99.9% it's only the name apple doesn't seem to be returning?

#

In google pay express element it returns everything in "billing_details" from the payment_method like this (I've added ********'s )

#

"address": {
"city": "Worcester",
"country": "GB",
"line1": "The ",
"line2": "Sp
"",
"postal_code": "WR*****",
"state": ""
},
"email": "james*****"@gmail.com",
"name": "J*****",
"phone": "+44 7939 *****",

modest quest
#

If you want to always collect these details, then yes you will need to make changes.

Either you'll want to use the Express Checkout Element, which you can force to collect all the details you're looking for, or add custom input fields alongisde the Payment Element that capture the details you need for your flow.

wind sierra
#

but it does all work just fine, apple pay is fine and returns everything but the name

#

const optionsExpress = {
shippingAddressRequired: true,
allowedShippingCountries: ['GB'],
shippingRates:shippingRatesArr,
emailRequired: true,
phoneNumberRequired: true,
};

    // Set up Stripe.js and Elements to use in checkout form.
    const elements = stripe.elements(options);

    // Create and mount the Express Checkout Element
    const expressCheckoutElement = elements.create('expressCheckout',optionsExpress);

    expressCheckoutElement.mount('#express-checkout-element');
#

when making the express buttons we do force it to require shipping address and phone number like that too

modest quest
#

Not sure if you're trying to tell me something or ask me something there. Do you have examples that used the Express Checkout Element that didn't collect the details it's configured to?

Based on what I'm hearing so far, you essentially have two Stripe integrations running on your site.

  1. Uses the Payment Element (which can't be configured to always collect billing details)
  2. Uses the Express Checkout Element, which you've configured to collect the details you want access to
wind sierra
#

Ah sorry, no the payment element is totally fine no issue there as it's only used when customers enter their name etc on the website before checkout anyway

The express elements are working fine too, it's just with Apple pay it doesn't return the billing_details->name whereas with google checkout it does

#

SO I don't know if its an issue with Stripe or Apple Pay not returning the billing name for some reason, it returns the address and phone number just fine so it is really odd!

modest quest
#

Do you have an example that used the Express Checkout Element that didn't behave as you expected that you can share?

wind sierra
#

sorry I will have to come back to it tomorrow now so can't send anything I will start a new thread on this tomorrow if we can't work it out, thanks for your help ๐Ÿ™‚