Update PaymentSuccess component to set redirect hash based on payment status: '#orders' for successful payments and '#cart' for failed payments.
This commit is contained in:
@@ -108,8 +108,8 @@ class PaymentSuccess extends Component {
|
|||||||
profileUrl.searchParams.set('mollie_order_id', response.order.orderId.toString());
|
profileUrl.searchParams.set('mollie_order_id', response.order.orderId.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set hash to cart tab
|
// Set hash based on payment success: orders for successful payments, cart for failed payments
|
||||||
profileUrl.hash = '#cart';
|
profileUrl.hash = response.payment.isPaid ? '#orders' : '#cart';
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
redirectUrl: profileUrl.pathname + profileUrl.search + profileUrl.hash,
|
redirectUrl: profileUrl.pathname + profileUrl.search + profileUrl.hash,
|
||||||
|
|||||||
Reference in New Issue
Block a user