diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index acd0f5e4740..5c9ade4893d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -271,6 +271,7 @@ if ($action == 'dopayment') $PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT'); $PAYPAL_PAYMENT_TYPE='Sale'; + // Vars that are used as global var later in print_paypal_redirect() $origfulltag=GETPOST("fulltag",'alpha'); $shipToName=GETPOST("shipToName"); $shipToStreet=GETPOST("shipToStreet"); @@ -283,6 +284,12 @@ if ($action == 'dopayment') $email=GETPOST("email"); $desc=GETPOST("desc",'alpha'); + // Special case for Paypal-Indonesia + if ($shipToCountryCode == 'ID' && ! preg_match('/\-/', $shipToState)) + { + $shipToState = 'ID-'.$shipToState; + } + $mesg=''; if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) { @@ -1280,6 +1287,7 @@ if ($source == 'membersubscription') $phoneNum=$member->phone; if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) { + print ''; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index b1ecfa43803..b409ab3b14f 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -195,7 +195,8 @@ if (GETPOST('action','aZ09') == 'dopayment') $PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT'); $PAYPAL_PAYMENT_TYPE='Sale'; - $origfulltag=GETPOST("fulltag",'alpha'); + // Vars that are used as global var later in print_paypal_redirect() + $origfulltag=GETPOST("fulltag",'alpha'); $shipToName=GETPOST("shipToName"); $shipToStreet=GETPOST("shipToStreet"); $shipToCity=GETPOST("shipToCity"); @@ -207,7 +208,13 @@ if (GETPOST('action','aZ09') == 'dopayment') $email=GETPOST("email"); $desc=GETPOST("desc"); - $mesg=''; + // Special case for Paypal-Indonesia + if ($shipToCountryCode == 'ID' && ! preg_match('/\-/', $shipToState)) + { + $shipToState = 'ID-'.$shipToState; + } + + $mesg=''; if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); //elseif (empty($EMAIL)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); //elseif (! isValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL);