- payment : first date error corrected

- payment : added httpErrorException
- payment : error handling wip
- profil page restriction gives access to admin and editor
This commit is contained in:
asus
2024-03-07 10:26:11 +01:00
parent 2fb1ec35aa
commit b8fbd84d53
7 changed files with 59 additions and 18 deletions

View File

@@ -33,6 +33,8 @@ export async function onApprove(data, actions) {
return actions.restart();
} else if (errorDetail) {
// (2) Other non-recoverable errors -> Show a failure message
console.log("errorDetail:");
console.log(errorDetail);
throw new Error(`${errorDetail.description} (${orderData.debug_id})`);
} else if (!orderData.purchase_units) {
throw new Error(JSON.stringify(orderData));
@@ -51,7 +53,7 @@ export async function onApprove(data, actions) {
orderData,
JSON.stringify(orderData, null, 2),
);
//actions.redirect(PLGNTLS_data.paypal_redirection_success);
actions.redirect(PLGNTLS_data.paypal_redirection_success);
} catch (error) {
console.error("payment ok but error on traitment afterwards : ", error);
}