#joannagasiewska_error
1 messages · Page 1 of 1 (latest)
👋 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/1466071376388554775
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! Can you share the request ID or payment intent ID for the payment that failed as well as one that succeeeded recently?
Hello! sure the successfull payment ID pi_3SsLHHFJ5M3zFQRQ0u7UC2Bk, the failed one pi_3SuZIKFJ5M3zFQRQ0FzFR4ff
Thanks! Do you know if anything changed about your test flow between these?
The failed payment intent looks like what we expect when you click the "Fail Test Payment" button on the alipay test payment page. Are you sure you clicked "Authorize test payment" instead?
How are you testing this then?
Hi @vast halo , let me add more context:
We're using this account in test mode: https://dashboard.stripe.com/acct_1DgSjQFJ5M3zFQRQ/test/payments
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
And, as @exotic fossil said, it fails whenever we click in continue with alipay.
We created a sandbox under the same account, and with that account, after clicking in continue with alipay, we land in this page where we can accept/reject the payment#1466071376388554775 message
This is the sandbox account we've just created: https://dashboard.stripe.com/acct_1SuZj9FQHL1IezxM/test/payments
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
To clarify:
- On your test account, clicking continue shows the "An unknown error has occurred" box and results in a the failed payment intent
- On your sandbox account, clicking continue brings you to the expected test payment page and allows you to accept or fail the payment accordingly
Is that right?
yes, that's right
Can you please share a request or payment intent ID from the sandbox account?
A new payment pi_3SuZk5FQHL1IezxM1tjC15nc for EUR 1.22 was created
Request post: {
"cancel_url": "http://localhost:4242/cancel.html",
"client_reference_id": "e45bca96-d593-4adb-a1a1-bc5e42624964",
"line_items": {
"0": {
"amount": "122",
"currency": "eur",
"description": "Sample description",
"name": "Sample Product",
"quantity": "1"
}
},
"payment_intent_data": {
"description": "Payment for order e45bca96-d593-4adb-a1a1-bc5e42624964"
},
"payment_method_types": {
"0": "alipay"
},
"success_url": "http://localhost:4242/success.html"
}
full flow on sandbox account
Failed flow in test account:
Thanks for all these details! Are you getting the error every time you try to checkout with the same integration for your test account?
And you're testing the exact same integration / code with the sandbox account? Meaning you're only changing the API keys?
yes, and not only in that test account, in all test accounts we have.
yes, just changing the api key let us proceed with alipay
to add more info, this is what we can see in the network:
Very strange! Can you share your code snippets for creating and redirecting to checkout?
[HttpPost]
public async Task<IActionResult> Create([FromBody] CreateCheckoutSessionRequest? request)
{
if (!TryNormalizeValue(request?.PaymentMethodType, _options.AllowedPaymentMethodTypes, out var paymentMethodType))
{
return BadRequest(new { error = "Unsupported payment method type." });
}
if (!TryNormalizeValue(request?.Currency, _options.AllowedCurrencies, out var currency))
{
return BadRequest(new { error = "Unsupported currency." });
}
var paymentIdentifier = Guid.NewGuid();
var domain = string.IsNullOrWhiteSpace(_options.Domain) ? "http://localhost:4242" : _options.Domain;
var options = new SessionCreateOptions
{
LineItems = new List<SessionLineItemOptions>
{
new()
{
Quantity = 1,
Currency = currency,
Name = _options.DefaultProductName,
Description = _options.DefaultProductDescription,
Amount = _options.DefaultAmount
}
},
PaymentMethodTypes = [paymentMethodType],
SuccessUrl = domain + "/success.html",
CancelUrl = domain + "/cancel.html",
ClientReferenceId = paymentIdentifier.ToString(),
PaymentIntentData = new SessionPaymentIntentDataOptions
{
Description = "Payment for order " + paymentIdentifier
}
};
var service = new SessionService();
var session = await service.CreateAsync(options);
return Ok(new { id = session.Id });
}
document.getElementById('checkout-button').addEventListener('click', async () => {
clearError();
try {
const response = await fetch('/create-checkout-session', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
paymentMethodType: paymentMethodEl.value,
currency: currencyEl.value
})
});
const payload = await response.json();
if (!response.ok) {
showError(payload.error || 'Unable to start checkout.');
return;
}
const result = await stripe.redirectToCheckout({
sessionId: payload.id
});
if (result.error) {
showError(result.error.message);
}
} catch (error) {
showError('Something went wrong. Check the server logs.');
}
});
those are some examples where you can see it stopped working, but it was working in the past in the test mode
and this from other test account:
There is a url attribute on the session object in your first code snippet. Can you try loading that directly in your browser (for your test account) and let me know if it's the same behaviour?
I ask because stripe.redirectToCheckout is an old pattern that was depricated in later API versions. However, if it's working with your sandbox account it shouldn't be any different for your test account.
same behavior, I've just opened in a browser the url comming in the session.StripeResponse.Content and I get the error
we're using 2019-10-08 api version
Ok, glad we ruled that out.
And you said this is happening for ALL your test accounts?
I've tried with 5 test accounts, same behavior in all for alipay,
but it works for credit card
I see an internal error that needs further investigation. It's likely not a problem with your integration. I'll have our bot send you a DM with a link to a create a case so we can continue this conversation over email. Please include the accounts and examples you shared. Thank you!
Hello @exotic fossil, we have sent you a direct message, please check it at https://discord.com/channels/@me/1466090336353910827
- 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
ok I will add it. Thank you for your investigation.
Thanks for reporting this!
one last question, do you recommend us to use sandboxes or we can keep using test mode?