removed obsolete post information and now giving the source in the url

This commit is contained in:
Dorian Vabre 2021-04-22 15:52:45 +02:00
parent eb96d5bd58
commit 804547997b
2 changed files with 3 additions and 11 deletions

View File

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

View File

@ -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();