From 804547997bea4a6b65e52286ce376d671fecc91f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 22 Apr 2021 15:52:45 +0200 Subject: [PATCH] removed obsolete post information and now giving the source in the url --- htdocs/public/payment/newpayment.php | 8 +++----- htdocs/public/payment/paymentok.php | 6 ------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 461cd406a92..1b737037a93 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -207,8 +207,6 @@ if (!empty($entity)) { $urlok = preg_replace('/&$/', '', $urlok); // Remove last & $urlko = preg_replace('/&$/', '', $urlko); // Remove last & - - // Make special controls if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled)) { @@ -379,7 +377,7 @@ if ($action == 'dopayment') { // A redirect is added if API call successfull if ($source == 'conferencesubscription') { - $PAYPAL_API_OK .= '&invoice='.dol_encode($invoice->id, $dolibarr_main_instance_unique_id); + $PAYPAL_API_OK .= '&source=conferencesubscription&invoice='.dol_encode($invoice->id, $dolibarr_main_instance_unique_id); } $mesg = print_paypal_redirect($PAYPAL_API_PRICE, $PAYPAL_API_DEVISE, $PAYPAL_PAYMENT_TYPE, $PAYPAL_API_OK, $PAYPAL_API_KO, $FULLTAG); @@ -400,7 +398,7 @@ if ($action == 'dopayment') { $urlko = preg_replace('/securekey=[^&]+/', '', $urlko); if ($source == 'conferencesubscription') { - $urlok .= '&invoice='.dol_encode($invoice->id, $dolibarr_main_instance_unique_id); + $urlok .= '&source=conferencesubscription&invoice='.dol_encode($invoice->id, $dolibarr_main_instance_unique_id); } $mesg = ''; @@ -758,7 +756,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) { exit; } else { if ($source == 'conferencesubscription') { - $urlok .= '&invoice='.dol_encode($invoice->id, $dolibarr_main_instance_unique_id); + $urlok .= '&source=conferencesubscription&invoice='.dol_encode($invoice->id, $dolibarr_main_instance_unique_id); } header("Location: ".$urlok); exit; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index d4946ce0ac7..681c980a3e8 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -109,12 +109,6 @@ $invoiceref = GETPOST('invoice'); $suffix = GETPOST("suffix", 'aZ09'); $membertypeid = GETPOST("membertypeid", 'int'); -$conferencesubscription = GETPOST('conferencesubscription'); -$uncryptedconferencesubscription = dol_decode($conferencesubscription, $dolibarr_main_instance_unique_id); -$subscription = substr($uncryptedconferencesubscription, 0, strlen($uncryptedconferencesubscription)-strlen($ref)); -$reffrompayment = substr($uncryptedconferencesubscription, -strlen($ref), strlen($ref)); - - // Detect $paymentmethod $paymentmethod = ''; $reg = array();