1
0
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:
Du Peng 2022-08-26 12:04:19 +02:00
parent ded92dfb89
commit e7d5cbfb2e
2 changed files with 7 additions and 2 deletions

View File

@ -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');
}
};
/**

View File

@ -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<{