mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
show an error if payment success but payment_state != paid
This commit is contained in:
parent
ded92dfb89
commit
e7d5cbfb2e
@ -72,8 +72,12 @@ const StoreCart: React.FC<StoreCartProps> = ({ onError, currentUser }) => {
|
||||
* Open/closes the payment modal
|
||||
*/
|
||||
const handlePaymentSuccess = (data: Order): void => {
|
||||
setPaymentModal(false);
|
||||
window.location.href = '/#!/store';
|
||||
if (data.payment_state === 'paid') {
|
||||
setPaymentModal(false);
|
||||
window.location.href = '/#!/store';
|
||||
} else {
|
||||
onError('Erreur inconnue after payment, please conntact admin');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -11,6 +11,7 @@ export interface Order {
|
||||
operator_profile_id?: number,
|
||||
reference?: string,
|
||||
state?: string,
|
||||
payment_state?: string,
|
||||
total?: number,
|
||||
created_at?: TDateISO,
|
||||
order_items_attributes: Array<{
|
||||
|
Loading…
x
Reference in New Issue
Block a user