Bulky
Bulky copied to clipboard
"Stripe.StripeException: One of the following params should be provided for this request payment_intent or charge"
Any One Help ... when I Refunding on CancelOrder, Occur this error "Stripe.StripeException: One of the following params should be provided for this request payment_intent or charge"
Hello, I do show the fix in the next video.
Hello, I do show the fix in the next video.
Ok Sir..... Thank you for your prompt response.
Sir please help this problem .. I can't solve this issue
Hello, everyone.
I have found a fix. The whole thing works if we use UpdateStripePaymentId()
method inside public IActionResult OrderConfirmation(int id)
method. Due to the latest Stripe update, A PaymentIntent
is no longer created during Checkout Session creation in payment mode. Instead, aPaymentIntent
will be created when the Session is confirmed.
This is my method :
public IActionResult OrderConfirmation(int id)
{
OrderHeader orderHeader = _db.OrderHeader.GetFirstorDefault(u => u.Id == id);
if (orderHeader.PaymentStatus != SD.PaymentStatusDelayedPayment)
{
//if condition checks if the user is a company user. If hes is not then this block will execute.
var service = new SessionService();
Session session = service.Get(orderHeader.SessionId);
if (session.PaymentStatus.ToLower() == "paid")
{
_db.OrderHeader.UpdateStripePaymentId(orderHeader.Id, session.Id, session.PaymentIntentId);
_db.OrderHeader.UpdateStatus(id, SD.StatusApproved, SD.PaymentStatusApproved);
_db.Save();
}
}
List<ShoppingCart> shoppingCarts = _db.ShoppingCart.GetAll(u=>u.ApplicationUserId==orderHeader.ApplicationUserId).ToList();
_db.ShoppingCart.RemoveRange(shoppingCarts);
_db.Save();
return View(id);
}
This is Not working ....
On Thu, Oct 6, 2022, 3:38 AM Tahmeed Asaad @.***> wrote:
Hello, everyone.
I have found a fix. The whole thing works if we use UpdateStripePaymentId() method inside public IActionResult OrderConfirmation(int id) method. Due to the latest Stripe update, A PaymentIntent is no longer created during Checkout Session creation in payment mode. Instead, aPaymentIntentwill be created when the Session is confirmed.
This is my method :
`public IActionResult OrderConfirmation(int id)
{ OrderHeader orderHeader = _db.OrderHeader.GetFirstorDefault(u => u.Id == id); if (orderHeader.PaymentStatus != SD.PaymentStatusDelayedPayment) { //if condition checks if the user is a company user. If hes is not then this block will execute. var service = new SessionService(); Session session = service.Get(orderHeader.SessionId); if (session.PaymentStatus.ToLower() == "paid") { _db.OrderHeader.UpdateStripePaymentId(orderHeader.Id, session.Id, session.PaymentIntentId); _db.OrderHeader.UpdateStatus(id, SD.StatusApproved, SD.PaymentStatusApproved); _db.Save(); } } List<ShoppingCart> shoppingCarts = _db.ShoppingCart.GetAll(u=>u.ApplicationUserId==orderHeader.ApplicationUserId).ToList(); _db.ShoppingCart.RemoveRange(shoppingCarts); _db.Save(); return View(id); }`
— Reply to this email directly, view it on GitHub https://github.com/bhrugen/Bulky/issues/8#issuecomment-1269031366, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALV27SYACJJUEXXGB3ILY7DWBX34XANCNFSM6AAAAAAQUCM6OU . You are receiving this because you authored the thread.Message ID: @.***>
how can i fixed it ? please tell me.