#daniyal-pmd-validation

1 messages · Page 1 of 1 (latest)

neon elbowBOT
#

Hello! We'll be with you shortly. 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.

robust meadow
#

Hello again

can you share the account IDs as my colleague asked the last time?

neon elbowBOT
dense saddle
#

acct_1JVFMDH21SAdRZ8C

prime swan
#

Still looking in to this.

#

I am honestly a bit surprised that the Apple Pay button is showing up here. For direct charges, domains need to be registered on the connected account and I'm only seeing registrations on the platform account. On top of that I'm only seeing a registration for stores.brooksrunning.com so www.brooksrunning.com would not be expected to show up

#

Also the error in the console from your video is more or less a separate error for when it takes more than a second to display apple pay after the user clicks submit. We can look in to that as well

dense saddle
#

when i try to register domain for www.brooksrunning.com it shows an error of apple merchant file not found.

prime swan
dense saddle
#

on every site i need apple pay to work. i'll need to host ^ this file?

#

like i've this on my app server from where payment element is being served from.

prime swan
#

Correct, Apple requires that each subdomain that their button appears on to be registered

#

Also to follow up on the console error, do you know if your page makes any networked requests or does anything time consuming between when the user clicks submit and when you attempt to confirm the payment intent?

dense saddle
#

there is some processing we do when confirming the PI

#

can you pls specify which console error are you talking about?

prime swan
#

Apologies, don't know why I talked about it like it was obvious

#

This message

dense saddle
#

integration error?

#

the first two are the errors related to the domain verification

prime swan
#

Apologies, somehow missed those and was just looking at that one. We can address the domain errors first bit the integration error will likely be worth addressing as well as it can also block apple pay payments

dense saddle
#

ahh got it.

#

sorry to ask again but i just want to confirm. i need to do domain verfication for every connected account site?

prime swan
dense saddle
#

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

$stripe->paymentMethodDomains->create(
['domain_name' => 'example.com'],
['stripe_account' => '{{CONNECTED_ACCOUNT_ID}}']
);

prime swan
#

And when registering, both URLs need to directly serve the .well-known/apple-developer-merchantid-domain-association file. For example you can't have www redirect to shopping which serves the file

dense saddle
#

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

$stripe->paymentMethodDomains->create(
['domain_name' => 'example.com'],
['stripe_account' => '{{CONNECTED_ACCOUNT_ID}}']
); this code basically does the verification if i'm right?

#

this will return true if the apple file is present there?

prime swan
#

It is possible to create a domain that works for GPay but not Apple Pay

neon elbowBOT
dense saddle
elfin maple
#

@dense saddle not sure what you're linking to

#

daniyal-pmd-validation

dense saddle
#

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

$stripe->paymentMethodDomains->create(
['domain_name' => 'example.com'],
['stripe_account' => '{{CONNECTED_ACCOUNT_ID}}']
); this code basically does the verification if i'm right?
this will return true if the apple file is present there?

elfin maple
#

@dense saddle that doesn't "return true" but that returns a PaymentMethodDomain with details about the validation for each payment method type. Did you try?

dense saddle
#

i tried \Stripe\Stripe::setApiKey("");

\Stripe\ApplePayDomain::create([
'domain_name' => 'www.brooksrunning.com',
]);

#

but it throwed an error of that apple merchant file not found

elfin maple
dense saddle
#

let me summarize what i've done till now: i've registered and verified my domain from where payment element is being served from. before this apple pay option was not appearing.

elfin maple
#

pause here

#

your code is explicitly about registering your domain for Apple Pay. And that call is failing right now. Which means you haven't done the steps for Apple Pay properly.
That's what you need to focus on. Ignore everything else about Connect or PaymentElement or anything like this.

dense saddle
elfin maple
#

Sure but to be able to offer ApplePay on that domain, that domain has to be registered. There's no way around it. So you have to work with that developer of the domain to configure ApplePay properly with you

dense saddle
#

understood.

#

now it' clear that the other connected account domain also needs to be verified.

#

in conclusion: we are supposed to host that apple file on every connected account server?

elfin maple
#

@dense saddle Assuming your code is loaded from each connected account's domain then yes

dense saddle
elfin maple
#

are you using an iframe?

dense saddle
#

no shadow dom

elfin maple
#

I don't really know what that means unfortunately

dense saddle
#

what it basically does it loads the component natively.

elfin maple
#

Sure sorry I know what shadow DOM is, I don't really grasp how your code is deployed and who hosts it on each domain

dense saddle
#

ahh ok

elfin maple
#

But ultimately what matters the most is the root URL

#

Something similar would happen for you I think in this case

dense saddle
elfin maple
#

Sorry I don't open google docs

dense saddle
#

basic flow:

#
  1. Generate Client secret

// Initialize Stripe
\Stripe\Stripe::setApiKey(PaymentIntegrationRepository::stripe_secret_key());

// Create Stripe customer
$stripe_response = \Stripe\Customer::create([
'description' => 'Locally Cart #'.$cart->hash.' : '.$user->email,
'email' => $user->email,
]);

// Save Stripe customer information to cart
$cart->stripe_response = $stripe_response;
$cart->stripe_customer_id = $stripe_response->id;
$cart->save();

// Get Stripe integration for store
$integration = PaymentIntegrationRepository::for_store($cart->store_id);

// Create a Stripe setup intent using the customer ID and store integration
try {
$intent = \Stripe\SetupIntent::create([
'customer' => $customer->id,
'on_behalf_of' => $integration->stripe_user_id
]);
} catch (\Exception $e){
return $e->getData();
}

// Return the client secret and publishable key for use by Stripe.js
$stripe_publishable_key = PaymentIntegrationRepository::stripe_publishable_key();
$data['client_secret'] = $intent->client_secret;
$data['stripe_publishable_key'] = $stripe_publishable_key;

return $data;

elfin maple
#

Sorry this is just a dump of code

#

We were talking about domain validation. What's your clear question?

dense saddle
elfin maple
#

Okay but we're back to what I already explained: what matter is the root URL of the page, so in this case the other domain, that's what needs to be registered

dense saddle
#

hmm

#

not sure what is the point of connected accounts are if we have to ask each site to manually host the verification file on their servers.

elfin maple
#

@dense saddle A connected account represents a separate entity (individual or company) that is accepting payments through your code/help. That's required to meet many compliance and legal requirements for money movement around the world.

The fact that they have to register their own domain if they want to show a payment form with Apple Pay on their own domain is an Apple requirement

dense saddle
#

understood.

#

Many thanks. Appreciate the help.