#Hey everyone, I implemented Google Pay
1 messages · Page 1 of 1 (latest)
Hi Maddie. Google Pay usually does not return a 400. Are you talking about forwarding the resulting Google Pay token to your server or PSP?
Or, could you send me a screenshot/video recording of your Google Pay transaction in WebView on Prod?
Hi Domi. No, the failure isn’t coming from the Google Pay SDK. The SDK provides the wallet token to the app, and I then send it as part of the payload (as a string) to the server. The API that processes this request is what fails.
As I explained, this issue happens only on Prod in WebView , it doesn’t occur in QA or in a browser. My question is: could there be any specific encoding or length limitations in WebView that might cause this payload to be blocked?
not really. how (code wise) do you send the payload to the server?
We’re using GraphQL Yoga on our backend, so our checkout call is sent as a GraphQL mutation inside the request payload. The only part that differs significantly is the payload (it contains the Google Pay walletProviderToken).
fetch(".../api?o=finishCheckout", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-mobile-app": "true",
"x-request-url": ".../shop/checkout"
},
referrer: ".../shop/checkout",
body: JSON.stringify({
query: mutation finishCheckout($input: FinishCheckoutMutationInput) { finishCheckout(input: $input) { errors { key message } order { id number status } } } ,
variables: {
input: {
walletProviderToken: JSON.stringify({
signature: "<hidden>",
protocolVersion: "<hidden>",
signedMessage: "{...}"
}),
screenHeight: 718,
screenWidth: 384,
colorDepth: 24,
timeZoneOffset: "-120"
}
}
}),
mode: "cors",
credentials: "include"
});