#lozzy.

1 messages ยท Page 1 of 1 (latest)

scenic riverBOT
timid kelp
#

Hi ๐Ÿ‘‹ can you elaborate a bit more on what you're trying to do? Right now it sounds like you're trying to use Google Pay to get card details, and are then trying to provide those to Stripe, rather than using our existing Google Pay integrations. I wouldn't recommend that approach, especially if the Google Pay integration you're using is providing you with raw card details in any way, as that greatly increases the compliance burden on you.

It is also worth noting, that payment_method_data.card.wallet.google_pay is not a field that you can write to when making a request to confirm a Payment Intent:
https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-payment_method_data

deft totem
#

I understand you have your own Google pay integration. However, this is the approach we are going with for now. The payload received is essentially a token and no card data is present. When integrating directly with Google API. How should the token be sent back to Stripe?

payment_method_data.card.wallet.type is set to google_pay. In response I get "Google Pay Payment Method token is invalid." However, I do not see which parameter I have to send the token under?

timid kelp
#

I've never seen this approach before, and am not sure it's possible/supported. I'll need some time to look into that.

deft totem
#

No problem, please do let me know when you have an answer. I guess the alternative question would be what information do we need to provide Stripe if we directly integrate with Google pay rather than using Stripes' integration.

I assume the google_pay parameters being mentioned in the documentation is only if you use Stripes' own integration with Google Pay?

timid kelp
#

Thank you for your patience, it does look like this is possible. Currently, when you finish the Google Pay process, what do you get back from them. Is it a Token object with a tok_ prefixed ID?

deft totem
#

You get a JSON object and within that you do get a tok_ prefix

timid kelp
#

Gotcha. So you'll use that Token to create a Payment Method using this endpoint:
https://stripe.com/docs/api/payment_methods/create
passing the Token into the card.token field. That isn't a listed field, but the description of the card field in that endpoint shows how to leverage it.

Then you can use that Payment Method to process payments.

scenic riverBOT
deft totem
#

I understand this is for Payment Methods, but I know that you can embed payment method data into paymentintent. Does this still apply to PaymentIntent?

I ask this because we have an integration with PaymentIntent and ideally would like to stick to that endpoint

timid kelp
#

There is not a payment_method_data.card field when confirming a Payment Intent, so I don't believe you'll be able to pass the Token directly there, but you can try.

deft totem
#

I've just ran a direct test, and payment_method_data.card.token gave me a success. Only worked once as the token from Gpay is a one and done token.

swift sonnet
#

This exists, but is undocumented because it's not a common or recommended pattern. It is possible to pass:

payment_method_data[type]=card
payment_method_data[card][token]=tok_visa
deft totem
#

Could you confirm that this is trhe correct approach if we are not using Stripes' own gpay integration?

swift sonnet
#

It's not recommended, but is possible if that's how you want to integrate. If what you put teogether works for you, then great!

deft totem
#

Thank you, generally speaking is it recommended to send optional parameters such as billing address with the google pay token or would you take that value from google pay anyways as you typically do provide billing address to Google pay?

swift sonnet
swift sonnet
deft totem
#

Got you, thank you for your help. I assume the same applies for Apple pay? You get a token returned and I'd have to send it under card.token?

swift sonnet
#

There's a similar flow for apple pay, yes, but it's more complex

deft totem
#

Is this also undocumented? If so can you tell me what parameters to send?

swift sonnet
#

it's the pk_token* parameters

deft totem
#

pk_token
pk_token_instrument_name
pk_token_payment_network
pk_token_transaction_id

#

Okay these four parameters are required to send through a request? We will also be integrating this directly as opposed to using Stripes checkout buttons.

swift sonnet
#

Yep, those are the ones

deft totem
#

In a request format, would I be sending:
payment_method_data[card][pk_token]
payment_method_data[card][pk_token_instrument_name] etc?

swift sonnet
#

Yep!

deft totem
#

Thank you. I've not moved onto Apple pay at the moment. If I do get stuck in the future, do we continue under the same thread or do I have to make a new one?

swift sonnet
#

You can make a new one to focus on helping you with anything new you get stuck on ๐Ÿ™‚