#pillow-fun_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1255005899693621298
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi, what errors are you seeing? Can you share the request id where you're seeing this error? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
request
{
"key": "pk_live_*********************************qBtPSt",
"type": "payment_intent",
"client_secret": "",
"stripe_js_id": "a6eec092-ed77-4841-a9be-d831dc652328",
"referrer_host": "ghost-thorough-pegasus.ngrok-free.app",
"locale": "zh-CN",
"_stripe_account": "acct_1PU16SCnVROFWTKC",
"expand": {
"0": "payment_method_preference.payment_intent.payment_method"
}
}
response
{
"error": {
"message": "The client_secret provided does not match any associated PaymentIntent on this account. Ensure the publishable key used belongs to the same account that created the PaymentIntent.",
"param": "client_secret",
"request_log_url": "https://dashboard.stripe.com/acct_1PU16SCnVROFWTKC/logs/req_8n4nlGyr7cY8s0?t=1719285788",
"type": "invalid_request_error"
}
}
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
GET /v1/elements/sessions
On your server side, how are you creating the PaymentIntent?
$stripe = new \Stripe\StripeClient($this->payconfig['api_key']);$paymentIntent = $stripe->paymentIntents->create(
[
'amount' => 1099,
'currency' => 'usd',
'automatic_payment_methods' => ['enabled' => true],
]
);
$data['client_secret'] = $paymentIntent->client_secret;
$error = '';
$data['public_key'] = $this->payconfig['public_key'];
$data['error'] = $error;
$data['data_paymentIntent_express_faild'] = $paymentIntent;
$data['connected_account_id'] = $this->payconfig['connected_account_id'];
the 'data' is the 'json', on above js script
Can you share the request id for when you created the intent for the above example?
wait a moment
sure
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
{
"automatic_payment_methods": {
"enabled": "true"
},
"currency": "usd",
"amount": "1099"
}
{
"id": "pi_3PVQa7CnVROFWTKC092zGrsx",
"object": "payment_intent",
"amount": 1099,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 0,
"application": "ca_POxDdW8GXU0yvr8Fis61TaCNPlhpw9OP",
"application_fee_amount": null,
"automatic_payment_methods": {
"allow_redirects": "always",
"enabled": true
},
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic_async",
"client_secret": "pi_3P*************************************************dvSi",
"confirmation_method": "automatic",
"created": 1719288131,
"currency": "usd",
"customer": null,
"description": null,
"invoice": null,
"last_payment_error": null,
"latest_charge": null,
"livemode": true,
"metadata": {
},
"next_action": null,
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "pmc_1PU1lDCnVROFWTKCChyusvGk",
"parent": "pmc_1PI4KlGYwkaB6J4B08gDHcLm"
},
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "requires_payment_method",
"transfer_data": null,
"transfer_group": null
}
i got the right session now
but i can't see the EXPRESS BUTTON
What do you mean by 'EXPRESS BUTTON'?
Hi @boreal girder I'm taking over, let me know if you have any follow-up questions.
the EXPRESS BUTTON is not found
Is it about ExpressCheckouElement?
yes
const stripe = Stripe(json.public_key , {
stripeAccount: json.connected_account_id
});
const elements_options = {
clientSecret: json.client_secret
};
const elements = stripe.elements(elements_options);
const expressCheckoutElement = elements.create('expressCheckout', {})
expressCheckoutElement.mount('#express-checkout-element')
Ok, I do see the ExpressCheckoutElement displayed in the screenshot.
So what buttons are you looking for? google pay button ?
but the "express-checkout-element" dom is empty
i am looking for the "Link" button
OK, do you see any errors in the browser console?
no error on console
Ok, looks like you didn't specify options to elements
Can I suggest you to follow this guide https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#set-up-elements for your express checkout element integration?
like this ?
const elements = stripe.elements(elements_options);
const options = {
paymentMethods:{
applePay:'always',
link:'auto',
paypal:'auto',
}
};
const expressCheckoutElement = elements.create('expressCheckout', options)
expressCheckoutElement.mount('#express-checkout-element')
mode: 'payment',
amount: 1099,
currency: 'usd',
// Customizable with appearance API.
appearance: {/*...*/},
};
// Set up Stripe.js and Elements to use in checkout form
const elements = stripe.elements(options);```
Invalid options for elements(): Expected either mode or clientSecret, but not both
i pass the clientSecret
when i use mode replace the clientSecret, I got the same result
Remove clientSecret and try again
const elements_options = {
mode: 'payment',
amount: 1099,
currency: 'usd',
// clientSecret: json.client_secret
};
const elements = stripe.elements(elements_options);
const options = {
paymentMethods:{
applePay:'always',
link:'auto',
paypal:'auto',
}
};
const expressCheckoutElement = elements.create('expressCheckout', options)
expressCheckoutElement.mount('#express-checkout-element')
still empty
When I use public key in my own account, it is ok, like this :
const stripe = Stripe('pk_live_51PU16SCnVROFWTKCB2PWmWBhychOK6Q5AxBwRzNp82Ath4UEQPJRRs0yziXZhsKnBpt7dFJnvpGkqJQvQYFYaQhq00g6v1cfMD' );
const elements_options = {
mode: 'payment',
amount: 1099,
currency: 'usd',
};
const elements = stripe.elements(elements_options);
const options = {
paymentMethods:{
applePay:'always',
link:'auto',
paypal:'auto',
}
};
When I use connected Acount like this, the dom is empty
const stripe = Stripe(json.public_key , {
stripeAccount: json.connected_account_id
});
I'm going to take a nap soon, and I'll continue with you later
What's the connected account ID?
OK, have you registered payment method domain for this connected account?
wait an moment
ๅๅ
ghost-thorough-pegasus.ngrok-free.app
โ
ๅๅ ID
pmd_1PU6cPCnVROFWTKC7MzEdPPE
Do you have any css sizing restictions? Can you share the firect URL so I can debug this fruther on my end?
Let me take a look
Is there any configuration that hasn't been enabled
stripeAccount: json.connected_account_id
});```
is this public_key the platform's publishable key ?
yes
initialize();
function initialize() {
$.ajax({
url: "/index/payment/fast_strip/initEmbeddedCheckout",
data:{ },
method:"POST",
dataType: 'json',
success: function (json) {
console.log('data_paymentIntent_payment_ok')
console.log(json.public_key)
console.log(json.connected_account_id)
console.log(json.data_paymentIntent_payment_ok)
const stripe = Stripe(json.public_key, {
stripeAccount: json.connected_account_id,
});
const options = {
clientSecret: json.client_secret_embedded,
appearance: {},
};
$('#payment-form').show();
const elements = stripe.elements(options);
const paymentElement = elements.create('payment');
paymentElement.mount('#payment_content_stripe');
},
error: function (xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
} );
}
I saw Apple Pay in Safari
oh~
Hmm, so are you using payment element or express checkout element?
The code snippet that you just shared is about payment element
express checkout element
The payment element is not a problem, so I believe this platform's publishable keyis correct
Can you try this?
paymentMethods:{
applePay:'always',
link:'always',
paypal:'always',
}
};```
you saw Apple Pay in Safari, link payment should show chrome?
ok I will try
I can't set "always"
I'll be out for a few minutes, I'll contact you later
Then set paypal to auto
I can only configure it this way:
const options = {
paymentMethods:{
applePay:'always',
link:'auto',
paypal:'auto',
}
};
I'll be out for a few minutes, I'll contact you later
I can't set link & paypal as always
Ok. I still trying to figure out why LInk doesn't show in the connected account.
Can you double check if the connected account ID is indeed acct_1PU16SCnVROFWTKC ?
Ok I found the problem
https://dashboard.stripe.com/test/settings/payment_methods/connected_accounts?config_id=pmc_1PVTsMGYwkaB6J4Bz6u7OQTc the platform set Link off by default. Can you enable it and try again?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.