#Dan.b - Google Pay

1 messages ยท Page 1 of 1 (latest)

raw lark
#

Hello ๐Ÿ‘‹

sudden pewter
#

๐Ÿ‘‹

raw lark
#

I'm trying to break down your 'graph into steps so I can better understand what is going on here

#

So the request that is failing is the request to /v1/payment_intents?

#

Can you share a request ID?

sudden pewter
#

No, to /v1/paymentmethods

#

req_5JrPT2GJI5AAFe

raw lark
#

Can you try the same flow just on your account? Without the connected account?

sudden pewter
#

Sorry, Im not sure what you mean. How would I change that?

raw lark
#

Exclude the Stripe Account header

sudden pewter
#

yup, gimmie a moment

#

That appears to allow me to create a paymentmethod! Never would have figured that one out on my own. Thanks so much!

#

Is there a guide to when to use the requestoptions stripeaccount header and when not to? I know we use it for paymentintent.

raw lark
#

Yeah sometimes the whole tokem -> payment_method flow doesn't work so well when the token belongs to one account and the payment_method request is made by another.

#

With connected accounts

sudden pewter
#

Thats totally understandable

#

So should I include the account header in this paymentintent or exclude it. The previous working code included it.

raw lark
#

Okay so just to be clear, you are using Standard Accounts with Direct charges, correct?

sudden pewter
#

These are going to be used in connected accounts

raw lark
#

Right but we have 3 kinds of connected accounts. The one from the request you shared is a Standard account so I'm guessing you'll probably be using those.

sudden pewter
#

How would I check?

raw lark
#

It says so in the platform dashboard

#

Under Connected Accounts

sudden pewter
#

yup, under the account im testing it its says standard

#

Creating a paymentintent with the new paymentmethod results in an error now:

#

Stripe.StripeException: 'No such PaymentMethod: 'pm_1KHchuGpko9Q3UHCjWOSQrHW'; OAuth key or Stripe-Account header was used but API request was provided with a platform-owned payment method ID. Please ensure that the provided payment method matches the specified account.'

raw lark
#

Okay so the problem is that the Google Pay integration will always create the token on the Platform account

sudden pewter
#

Ahhh, makes sense

raw lark
#

And in order to follow the proper funds flow, all these objects need to exist on the connected account

#

However there is a hack...

sudden pewter
#

I like hacks

raw lark
#

We have other recommended integrations with Google pay but I'll save those

#

Google provides documentation on how to tokenize without using connect

sudden pewter
#

Yeah we have used stripe's button / easy integration, but for...reasons were making this implementation

raw lark
#
const tokenizationSpecification = {
  type: 'PAYMENT_GATEWAY',
  parameters: {
    "gateway": "stripe"
    "stripe:version": "2018-10-31"
    "stripe:publishableKey": "pk_test_123"
  }
};
sudden pewter
#

use the old version?

raw lark
#

I've worked at places that had ...reasons. I can understand that

#

Well wait...that's just an example

#

To use the native Google Pay API with Connect you can pass the platform's publishable key and the connected account's ID the same way Stripe.js does when used with Connect

#
const tokenizationSpecification = {
  type: 'PAYMENT_GATEWAY',
  parameters: {
    "gateway": "stripe"
    "stripe:version": "2018-10-31"
    "stripe:publishableKey": "pk_test_123/acct_123"
  }
};
#

In other words, use the platform's publishable key + a forward slash + the connected account ID for the stripe:publishableKey value in order to tokenize on the connected account.

sudden pewter
#

Oh that little slash haha

#

gimmie a few

raw lark
#

Otherwise, here's the flow:

  1. Token on platform
  2. Payment Method on Platform
  3. Attach Payment method on Platform
  4. Clone customer & PM to connect account
  5. process paymentIntent on connected account
sudden pewter
#

so testing this and I think google hates it
"tokenizationSpecification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "stripe",
"stripe:version": "2018-10-31",
"stripe:publishableKey": "pk_test_123/acct_123"
}
}

#

Results in 'Invalid stripe:publishableKey for current environment. Make sure you are using Stripe's test key.' errors coming from the google payment sheet.

#

But im pretty sure thats only from google as i dont even see it hitting stripe in the logs at /v1/tokens

raw lark
#

Okay I'm assuming you are using the actual platform pk_test_xxx key as well as the connected accounts ID. Just making sure.

sudden pewter
#

Yeah I obfuscated before I pasted

raw lark
#

Okay cool. I just like to check because I've spent a long time going back and forth while something like that was happening

sudden pewter
#

I confirmed they are keys that are in the api keys section and match the accountId in connect

raw lark
#

Okay well that was only only sneaky option. Otherwise it's the involved process I outlined above.

sudden pewter
#

Got it. Well, Thanks so much for your help, at least I have a path to work with ehre.

#

here*

raw lark