Skip to content

Commit

Permalink
Fix state code for payment from indonesia
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed May 25, 2018
1 parent 37dcfe4 commit bf81b75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions htdocs/public/payment/newpayment.php
Expand Up @@ -271,6 +271,7 @@
$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");
Expand All @@ -283,6 +284,12 @@
$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))
{
Expand Down Expand Up @@ -1280,6 +1287,7 @@
$phoneNum=$member->phone;
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip)
{
print '<!-- Shipping address information -->';
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
print '<input type="hidden" name="shipToStreet" value="'.$shipToStreet.'">'."\n";
print '<input type="hidden" name="shipToCity" value="'.$shipToCity.'">'."\n";
Expand Down
11 changes: 9 additions & 2 deletions htdocs/public/paypal/newpayment.php
Expand Up @@ -195,7 +195,8 @@
$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");
Expand All @@ -207,7 +208,13 @@
$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);
Expand Down

0 comments on commit bf81b75

Please sign in to comment.