#sainita_google-pay-invalid-pk

1 messages · Page 1 of 1 (latest)

humble dewBOT
#

👋 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/1339268762775584839

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

midnight comet
north igloo
#

Is this a public url I can check?

midnight comet
#

It's a public url but you need submit a form to get this page

north igloo
#

Can I use test data?

#

I need a url to look and help

midnight comet
#

Let me share the details

#

In server field add this : https://dev.blinkpayment.co.uk/

#

API key : 490bcf4576104e2fb55c813e353199b7aa0ee864848252950e5c85ed369042a6

#

secret Key : 7aa5b840a1c27c82827aef1f8da12a18509d65b2cb9b6c7c5f72bca11fe1c5ad

#

currency : GBP

#

Select "pay with stripe" radio button and hit submit

#

You should get the form where these buttons are displayed while clicking "see more"

north igloo
#

Yeah I see

#

When do you get the error?

#

On load I didn't get it

midnight comet
#

after filling customername and email if I click on google pay button and choose the card then I am getting this error

#

payment is also failed

north igloo
#

Do you see Test environment. Card and address fields are pre-filled with fake test data. in the google pay modal though?

#

Ok I got the same error

midnight comet
#

I have checked the api key. It's the correct one pk_test............

north igloo
#

Can you share the client side code you're using here?

midnight comet
#

Yes

#

var stripe =Stripe(apiKey,{
'stripeAccount': document.querySelector('input[name=stripe_account_id]').value
});
const expressCheckoutOptions = {
buttonType: {
googlePay: 'buy'
},
buttonTheme: {
googlePay: 'black'
}
};

#

const elements = stripe.elements({
mode: 'payment',
amount: $("input[name=stripe_amount]").val() * 100,
currency: $("input[name=stripe_currency]").val(),
});
const expressCheckoutElement = elements.create(
'expressCheckout',
expressCheckoutOptions
);
expressCheckoutElement.mount('#PayByStripeGooglePay');
expressCheckoutElement.on('click', (event) => {
if ($('input[name=customer_name]').val() == '' || $('input[name=customer_email]').val() == '') {
alert('Customer name and email are required');
return;
}
const options = {
business: {
name: $('input[name=page_url]').val()
},
emailRequired: true
};
event.resolve(options);
});
const handleError = (error) => {
const messageContainer = document.querySelector('#error-message');
messageContainer.textContent = error.message;
}

expressCheckoutElement.on('confirm', async (event) => {
    const {
        error: submitError
    } = await elements.submit();
    if (submitError) {
        alert(submitError);
        return;
    }
#

const clientSecret = $('input[name=google_pay_payment_intent_client_secret]').val();
const {
error
} = await stripe.confirmPayment({
elements,
clientSecret,
redirect: 'if_required',
confirmParams: {
return_url: $('input[name=return_url]').val(),
},

    });

    if (error) {
        var paymentIntentId = $('input[name=s_intent]').val();
        var success = false;
        postPayment(paymentIntentId, success);
    } else {
        var paymentIntentId = $('input[name=s_intent]').val();
        var success = true;
        postPayment(paymentIntentId, success);
    }
});
north igloo
#

Ok so you're also passing a stripe account header. Can you verify the accountID specified in stripeAccount matches what's being set on the payment intent?

midnight comet
#

ok checking

north igloo
#

Can you also share a payment intent id?

#

Want to check some logs

midnight comet
#

You will get the payment intent id from the field s_intent.. Please inspect the form andyou will see the value of s_intent which is the payment intent value and account id is also mentioned there

humble dewBOT
north igloo
#

@midnight comet did you check the stripeAccount param?

#

If that's not it I'm not really sure what else to suggest. You'll have to write into support so we can investigate this async

midnight comet
#

I am checking it

north igloo
#

Publishable key should match the one belonging to acct_1MmGiGHMOCsDa4Df and the stripeAccount should be set to acct_1O5RR7Hcs8fOq1ZE

midnight comet
#

yes stripe account is set to this one .. acct_1O5RR7Hcs8fOq1ZE

humble dewBOT
#

Hello @midnight comet, we have sent you a direct message, please check it at https://discord.com/channels/@me/1339281037129420830

  • 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
north igloo
#

I think you'll need to write in per ^

#

We'll need to investigate this further async

midnight comet
#

ok