@@ -108,12 +108,12 @@ |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
111 | - * @param int $userId |
|
112 | - * @param int $courseCode |
|
113 | - * @param int $sessionId |
|
114 | - * @param boolean $sendEmail Optional. Indicate whether the mail must be sent. Default is true |
|
115 | - * @return mixed |
|
116 | - */ |
|
111 | + * @param int $userId |
|
112 | + * @param int $courseCode |
|
113 | + * @param int $sessionId |
|
114 | + * @param boolean $sendEmail Optional. Indicate whether the mail must be sent. Default is true |
|
115 | + * @return mixed |
|
116 | + */ |
|
117 | 117 | public function saveUserLegal($userId, $courseCode, $sessionId, $sendEmail = true) |
118 | 118 | { |
119 | 119 | $courseInfo = api_get_course_info($courseCode); |
@@ -421,7 +421,7 @@ |
||
421 | 421 | array('id = ? ' => $id) |
422 | 422 | ); |
423 | 423 | if (!empty($legalData['filename'])) { |
424 | - $fileToDelete = $coursePath . '/' . $legalData['filename']; |
|
424 | + $fileToDelete = $coursePath.'/'.$legalData['filename']; |
|
425 | 425 | if (file_exists($fileToDelete)) { |
426 | 426 | unlink($fileToDelete); |
427 | 427 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | /* For license terms, see /license.txt */ |
3 | 3 | |
4 | -require_once dirname(__FILE__) . '/config.php'; |
|
4 | +require_once dirname(__FILE__).'/config.php'; |
|
5 | 5 | |
6 | 6 | if (!api_is_platform_admin()) { |
7 | 7 | die ('You must have admin permissions to install plugins'); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | if ($commissionsEnable == "true") { |
25 | 25 | |
26 | - $htmlHeadXtra[] = '<script type="text/javascript" src="' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/js/commissions.js"></script>'; |
|
26 | + $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_PLUGIN_PATH).'buycourses/resources/js/commissions.js"></script>'; |
|
27 | 27 | $defaultCommissions = []; |
28 | 28 | $commissions = ""; |
29 | 29 | |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | . '<script>' |
171 | 171 | . '$(function(){' |
172 | 172 | . 'if ($("[name=\'commissions\']").val() === "") {' |
173 | - . '$("#panelSliders").html("<button id=\"setCommissionsButton\" class=\"btn btn-warning\">' . get_plugin_lang("SetCommissions", "BuyCoursesPlugin") . '</button>");' |
|
173 | + . '$("#panelSliders").html("<button id=\"setCommissionsButton\" class=\"btn btn-warning\">'.get_plugin_lang("SetCommissions", "BuyCoursesPlugin").'</button>");' |
|
174 | 174 | . '} else {' |
175 | - . 'showSliders(100, "default", "' . $commissions . '");' |
|
175 | + . 'showSliders(100, "default", "'.$commissions.'");' |
|
176 | 176 | . '}' |
177 | 177 | . '});' |
178 | 178 | |
@@ -226,14 +226,14 @@ discard block |
||
226 | 226 | |
227 | 227 | $platformCommission = $plugin->getPlatformCommission(); |
228 | 228 | |
229 | - $form->addHtml( '' |
|
229 | + $form->addHtml('' |
|
230 | 230 | . '<div class="form-group">' |
231 | 231 | . '<label for="sliders" class="col-sm-2 control-label">' |
232 | 232 | . get_plugin_lang('Commissions', 'BuyCoursesPlugin') |
233 | 233 | . '</label>' |
234 | 234 | . '<div class="col-sm-8">' |
235 | 235 | . Display::return_message( |
236 | - sprintf($plugin->get_lang('TheActualPlatformCommissionIsX'), $platformCommission['commission']. '%'), |
|
236 | + sprintf($plugin->get_lang('TheActualPlatformCommissionIsX'), $platformCommission['commission'].'%'), |
|
237 | 237 | 'info', |
238 | 238 | false |
239 | 239 | ) |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $plugin->deleteItem($productItem['id']); |
293 | 293 | } |
294 | 294 | |
295 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/configuration.php'); |
|
295 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/configuration.php'); |
|
296 | 296 | exit; |
297 | 297 | } |
298 | 298 |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | return false; |
88 | 88 | } |
89 | 89 | |
90 | - require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php'; |
|
90 | + require_once api_get_path(SYS_PLUGIN_PATH).'buycourses/database.php'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | ); |
653 | 653 | |
654 | 654 | if (!empty($sessionImage)) { |
655 | - $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH) . $sessionImage['value']; |
|
655 | + $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH).$sessionImage['value']; |
|
656 | 656 | } |
657 | 657 | |
658 | 658 | $sessionCourses = $session->getCourses(); |
@@ -1094,7 +1094,7 @@ discard block |
||
1094 | 1094 | |
1095 | 1095 | $str = ''; |
1096 | 1096 | |
1097 | - srand((double)microtime() * 1000000); |
|
1097 | + srand((double) microtime() * 1000000); |
|
1098 | 1098 | |
1099 | 1099 | for ($i = 0; $i < $length; $i++) { |
1100 | 1100 | $numbers = rand(0, strlen($salt) - 1); |
@@ -1441,8 +1441,8 @@ discard block |
||
1441 | 1441 | */ |
1442 | 1442 | public function getPayouts($status = self::PAYOUT_STATUS_PENDING, $payoutId = false, $userId = false) |
1443 | 1443 | { |
1444 | - $condition = ($payoutId) ? 'AND p.id = '. intval($payoutId) : ''; |
|
1445 | - $condition2 = ($userId) ? ' AND p.user_id = ' . intval($userId) : ''; |
|
1444 | + $condition = ($payoutId) ? 'AND p.id = '.intval($payoutId) : ''; |
|
1445 | + $condition2 = ($userId) ? ' AND p.user_id = '.intval($userId) : ''; |
|
1446 | 1446 | $typeResult = ($condition) ? 'first' : 'all'; |
1447 | 1447 | $payoutsTable = Database::get_main_table(BuyCoursesPlugin::TABLE_PAYPAL_PAYOUTS); |
1448 | 1448 | $saleTable = Database::get_main_table(BuyCoursesPlugin::TABLE_SALE); |
@@ -1469,14 +1469,14 @@ discard block |
||
1469 | 1469 | INNER JOIN $saleTable s ON s.id = p.sale_id |
1470 | 1470 | INNER JOIN $currencyTable c ON s.currency_id = c.id |
1471 | 1471 | LEFT JOIN $extraFieldValues efv ON p.user_id = efv.item_id |
1472 | - AND field_id = " . intval($paypalExtraField['id']) . " |
|
1472 | + AND field_id = ".intval($paypalExtraField['id'])." |
|
1473 | 1473 | "; |
1474 | 1474 | |
1475 | 1475 | $payouts = Database::select( |
1476 | 1476 | "p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code", |
1477 | 1477 | "$payoutsTable p $innerJoins", |
1478 | 1478 | [ |
1479 | - 'where' => ['p.status = ? '.$condition . ' ' .$condition2 => $status] |
|
1479 | + 'where' => ['p.status = ? '.$condition.' '.$condition2 => $status] |
|
1480 | 1480 | ], |
1481 | 1481 | $typeResult |
1482 | 1482 | ); |
@@ -1540,7 +1540,7 @@ discard block |
||
1540 | 1540 | $platformCommission = $this->getPlatformCommission(); |
1541 | 1541 | |
1542 | 1542 | $sale = $this->getSale($saleId); |
1543 | - $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission']))/100, 2); |
|
1543 | + $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission'])) / 100, 2); |
|
1544 | 1544 | |
1545 | 1545 | |
1546 | 1546 | $beneficiaries = $this->getBeneficiariesBySale($saleId); |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | 'payout_date' => getdate(), |
1553 | 1553 | 'sale_id' => intval($saleId), |
1554 | 1554 | 'user_id' => $beneficiary['user_id'], |
1555 | - 'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions']))/100, 2), |
|
1555 | + 'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions'])) / 100, 2), |
|
1556 | 1556 | 'status' => self::PAYOUT_STATUS_PENDING |
1557 | 1557 | ] |
1558 | 1558 | ); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | Display::return_message(get_lang('ItemRemoved'), 'success') |
28 | 28 | ); |
29 | 29 | |
30 | - header('Location: ' . api_get_self()); |
|
30 | + header('Location: '.api_get_self()); |
|
31 | 31 | exit; |
32 | 32 | } |
33 | 33 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | Display::return_message(get_lang('Saved'), 'success') |
44 | 44 | ); |
45 | 45 | |
46 | - header('Location:' . api_get_self()); |
|
46 | + header('Location:'.api_get_self()); |
|
47 | 47 | exit; |
48 | 48 | } |
49 | 49 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | Display::return_message(get_lang('Saved'), 'success') |
89 | 89 | ); |
90 | 90 | |
91 | - header('Location:' . api_get_self()); |
|
91 | + header('Location:'.api_get_self()); |
|
92 | 92 | exit; |
93 | 93 | } |
94 | 94 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | Display::return_message(get_lang('Saved'), 'success') |
128 | 128 | ); |
129 | 129 | |
130 | - header('Location:' . api_get_self()); |
|
130 | + header('Location:'.api_get_self()); |
|
131 | 131 | exit; |
132 | 132 | } |
133 | 133 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | Display::return_message(get_lang('Saved'), 'success') |
154 | 154 | ); |
155 | 155 | |
156 | - header('Location:' . api_get_self()); |
|
156 | + header('Location:'.api_get_self()); |
|
157 | 157 | exit; |
158 | 158 | } |
159 | 159 |
@@ -40,8 +40,8 @@ |
||
40 | 40 | $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); |
41 | 41 | |
42 | 42 | echo "SetExpressCheckout API call failed. "; |
43 | - echo "Detailed Error Message: " . $ErrorLongMsg; |
|
44 | - echo "Short Error Message: " . $ErrorShortMsg; |
|
45 | - echo "Error Code: " . $ErrorCode; |
|
46 | - echo "Error Severity Code: " . $ErrorSeverityCode; |
|
43 | + echo "Detailed Error Message: ".$ErrorLongMsg; |
|
44 | + echo "Short Error Message: ".$ErrorShortMsg; |
|
45 | + echo "Error Code: ".$ErrorCode; |
|
46 | + echo "Error Severity Code: ".$ErrorSeverityCode; |
|
47 | 47 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | unset($_SESSION['bc_sale_id']); |
59 | 59 | |
60 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php'); |
|
60 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php'); |
|
61 | 61 | exit; |
62 | 62 | } |
63 | 63 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | unset($_SESSION['bc_sale_id']); |
169 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/course_catalog.php'); |
|
169 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/course_catalog.php'); |
|
170 | 170 | exit; |
171 | 171 | } |
172 | 172 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $currentUserId = api_get_user_id(); |
13 | 13 | |
14 | 14 | if (empty($currentUserId)) { |
15 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'auth/inscription.php'); |
|
15 | + header('Location: '.api_get_path(WEB_CODE_PATH).'auth/inscription.php'); |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | $buyingCourse = intval($_REQUEST['t']) === BuyCoursesPlugin::PRODUCT_TYPE_COURSE; |
29 | 29 | $buyingSession = intval($_REQUEST['t']) === BuyCoursesPlugin::PRODUCT_TYPE_SESSION; |
30 | -$queryString = 'i=' . intval($_REQUEST['i']) . '&t=' . intval($_REQUEST['t']); |
|
30 | +$queryString = 'i='.intval($_REQUEST['i']).'&t='.intval($_REQUEST['t']); |
|
31 | 31 | |
32 | 32 | if ($buyingCourse) { |
33 | 33 | $courseInfo = $plugin->getCourseInfo($_REQUEST['i']); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | Display::addFlash( |
49 | 49 | Display::return_message($plugin->get_lang('NeedToSelectPaymentType'), 'error', false) |
50 | 50 | ); |
51 | - header('Location:' . api_get_self() . '?' . $queryString); |
|
51 | + header('Location:'.api_get_self().'?'.$queryString); |
|
52 | 52 | exit; |
53 | 53 | } |
54 | 54 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | if ($saleId !== false) { |
58 | 58 | $_SESSION['bc_sale_id'] = $saleId; |
59 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/process_confirm.php'); |
|
59 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/process_confirm.php'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | exit; |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * phoneNum: the phoneNum entered on the merchant's site |
112 | 112 | */ |
113 | 113 | function CallMarkExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, |
114 | - $cancelURL, $shipToName, $shipToStreet, $shipToCity, $shipToState, |
|
115 | - $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum |
|
114 | + $cancelURL, $shipToName, $shipToStreet, $shipToCity, $shipToState, |
|
115 | + $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum |
|
116 | 116 | ) |
117 | 117 | { |
118 | 118 | // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | */ |
266 | 266 | |
267 | 267 | function DirectPayment($paymentType, $paymentAmount, $creditCardType, $creditCardNumber, |
268 | - $expDate, $cvv2, $firstName, $lastName, $street, $city, $state, $zip, |
|
269 | - $countryCode, $currencyCode) |
|
268 | + $expDate, $cvv2, $firstName, $lastName, $street, $city, $state, $zip, |
|
269 | + $countryCode, $currencyCode) |
|
270 | 270 | { |
271 | 271 | //Construct the parameter string that describes DoDirectPayment |
272 | 272 | $nvpstr = "&AMT=" . $paymentAmount; |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | function CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $extra) |
68 | 68 | { |
69 | 69 | // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation |
70 | - $nvpstr = "&PAYMENTREQUEST_0_AMT=" . $paymentAmount; |
|
71 | - $nvpstr .= "&PAYMENTREQUEST_0_ITEMAMT=" . $paymentAmount; |
|
72 | - $nvpstr .= "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType; |
|
73 | - $nvpstr .= "&RETURNURL=" . $returnURL; |
|
74 | - $nvpstr .= "&CANCELURL=" . $cancelURL; |
|
75 | - $nvpstr .= "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType; |
|
70 | + $nvpstr = "&PAYMENTREQUEST_0_AMT=".$paymentAmount; |
|
71 | + $nvpstr .= "&PAYMENTREQUEST_0_ITEMAMT=".$paymentAmount; |
|
72 | + $nvpstr .= "&PAYMENTREQUEST_0_PAYMENTACTION=".$paymentType; |
|
73 | + $nvpstr .= "&RETURNURL=".$returnURL; |
|
74 | + $nvpstr .= "&CANCELURL=".$cancelURL; |
|
75 | + $nvpstr .= "&PAYMENTREQUEST_0_CURRENCYCODE=".$currencyCodeType; |
|
76 | 76 | $nvpstr .= $extra; |
77 | 77 | |
78 | 78 | $_SESSION["currencyCodeType"] = $currencyCodeType; |
@@ -116,20 +116,20 @@ discard block |
||
116 | 116 | ) |
117 | 117 | { |
118 | 118 | // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation |
119 | - $nvpstr = "&PAYMENTREQUEST_0_AMT=" . $paymentAmount; |
|
120 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType; |
|
121 | - $nvpstr = $nvpstr . "&RETURNURL=" . $returnURL; |
|
122 | - $nvpstr = $nvpstr . "&CANCELURL=" . $cancelURL; |
|
123 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType; |
|
124 | - $nvpstr = $nvpstr . "&ADDROVERRIDE=1"; |
|
125 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTONAME=" . $shipToName; |
|
126 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOSTREET=" . $shipToStreet; |
|
127 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOSTREET2=" . $shipToStreet2; |
|
128 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOCITY=" . $shipToCity; |
|
129 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOSTATE=" . $shipToState; |
|
130 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=" . $shipToCountryCode; |
|
131 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOZIP=" . $shipToZip; |
|
132 | - $nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOPHONENUM=" . $phoneNum; |
|
119 | + $nvpstr = "&PAYMENTREQUEST_0_AMT=".$paymentAmount; |
|
120 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_PAYMENTACTION=".$paymentType; |
|
121 | + $nvpstr = $nvpstr."&RETURNURL=".$returnURL; |
|
122 | + $nvpstr = $nvpstr."&CANCELURL=".$cancelURL; |
|
123 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_CURRENCYCODE=".$currencyCodeType; |
|
124 | + $nvpstr = $nvpstr."&ADDROVERRIDE=1"; |
|
125 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTONAME=".$shipToName; |
|
126 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTREET=".$shipToStreet; |
|
127 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTREET2=".$shipToStreet2; |
|
128 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOCITY=".$shipToCity; |
|
129 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTATE=".$shipToState; |
|
130 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=".$shipToCountryCode; |
|
131 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOZIP=".$shipToZip; |
|
132 | + $nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOPHONENUM=".$phoneNum; |
|
133 | 133 | |
134 | 134 | $_SESSION["currencyCodeType"] = $currencyCodeType; |
135 | 135 | $_SESSION["PaymentType"] = $paymentType; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * Build a second API request to PayPal, using the token as the |
173 | 173 | * ID to get the details on the payment authorization |
174 | 174 | */ |
175 | - $nvpstr = "&TOKEN=" . $token; |
|
175 | + $nvpstr = "&TOKEN=".$token; |
|
176 | 176 | |
177 | 177 | /** |
178 | 178 | * Make the API call and store the results in an array. |
@@ -213,9 +213,9 @@ discard block |
||
213 | 213 | $payerID = urlencode($_SESSION['payer_id']); |
214 | 214 | $serverName = urlencode($_SERVER['SERVER_NAME']); |
215 | 215 | |
216 | - $nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTREQUEST_0_PAYMENTACTION=' . $paymentType . '&PAYMENTREQUEST_0_AMT=' . $FinalPaymentAmt; |
|
217 | - $nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE=' . $currencyCodeType . '&IPADDRESS=' . $serverName; |
|
218 | - $nvpstr = '&' . http_build_query([ |
|
216 | + $nvpstr = '&TOKEN='.$token.'&PAYERID='.$payerID.'&PAYMENTREQUEST_0_PAYMENTACTION='.$paymentType.'&PAYMENTREQUEST_0_AMT='.$FinalPaymentAmt; |
|
217 | + $nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE='.$currencyCodeType.'&IPADDRESS='.$serverName; |
|
218 | + $nvpstr = '&'.http_build_query([ |
|
219 | 219 | 'TOKEN' => $token, |
220 | 220 | 'PAYERID' => $payerID, |
221 | 221 | 'PAYMENTACTION' => $paymentType, |
@@ -269,20 +269,20 @@ discard block |
||
269 | 269 | $countryCode, $currencyCode) |
270 | 270 | { |
271 | 271 | //Construct the parameter string that describes DoDirectPayment |
272 | - $nvpstr = "&AMT=" . $paymentAmount; |
|
273 | - $nvpstr = $nvpstr . "&CURRENCYCODE=" . $currencyCode; |
|
274 | - $nvpstr = $nvpstr . "&PAYMENTACTION=" . $paymentType; |
|
275 | - $nvpstr = $nvpstr . "&CREDITCARDTYPE=" . $creditCardType; |
|
276 | - $nvpstr = $nvpstr . "&ACCT=" . $creditCardNumber; |
|
277 | - $nvpstr = $nvpstr . "&EXPDATE=" . $expDate; |
|
278 | - $nvpstr = $nvpstr . "&CVV2=" . $cvv2; |
|
279 | - $nvpstr = $nvpstr . "&FIRSTNAME=" . $firstName; |
|
280 | - $nvpstr = $nvpstr . "&LASTNAME=" . $lastName; |
|
281 | - $nvpstr = $nvpstr . "&STREET=" . $street; |
|
282 | - $nvpstr = $nvpstr . "&CITY=" . $city; |
|
283 | - $nvpstr = $nvpstr . "&STATE=" . $state; |
|
284 | - $nvpstr = $nvpstr . "&COUNTRYCODE=" . $countryCode; |
|
285 | - $nvpstr = $nvpstr . "&IPADDRESS=" . $_SERVER['REMOTE_ADDR']; |
|
272 | + $nvpstr = "&AMT=".$paymentAmount; |
|
273 | + $nvpstr = $nvpstr."&CURRENCYCODE=".$currencyCode; |
|
274 | + $nvpstr = $nvpstr."&PAYMENTACTION=".$paymentType; |
|
275 | + $nvpstr = $nvpstr."&CREDITCARDTYPE=".$creditCardType; |
|
276 | + $nvpstr = $nvpstr."&ACCT=".$creditCardNumber; |
|
277 | + $nvpstr = $nvpstr."&EXPDATE=".$expDate; |
|
278 | + $nvpstr = $nvpstr."&CVV2=".$cvv2; |
|
279 | + $nvpstr = $nvpstr."&FIRSTNAME=".$firstName; |
|
280 | + $nvpstr = $nvpstr."&LASTNAME=".$lastName; |
|
281 | + $nvpstr = $nvpstr."&STREET=".$street; |
|
282 | + $nvpstr = $nvpstr."&CITY=".$city; |
|
283 | + $nvpstr = $nvpstr."&STATE=".$state; |
|
284 | + $nvpstr = $nvpstr."&COUNTRYCODE=".$countryCode; |
|
285 | + $nvpstr = $nvpstr."&IPADDRESS=".$_SERVER['REMOTE_ADDR']; |
|
286 | 286 | |
287 | 287 | $resArray = hash_call("DoDirectPayment", $nvpstr); |
288 | 288 | |
@@ -345,13 +345,13 @@ discard block |
||
345 | 345 | //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled. |
346 | 346 | //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php |
347 | 347 | if ($USE_PROXY) { |
348 | - curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST . ":" . $PROXY_PORT); |
|
348 | + curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST.":".$PROXY_PORT); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | //NVPRequest for submitting to server |
352 | - $nvpreq = "METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) . |
|
353 | - "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . |
|
354 | - "&SIGNATURE=" . urlencode($API_Signature) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode); |
|
352 | + $nvpreq = "METHOD=".urlencode($methodName)."&VERSION=".urlencode($version). |
|
353 | + "&PWD=".urlencode($API_Password)."&USER=".urlencode($API_UserName). |
|
354 | + "&SIGNATURE=".urlencode($API_Signature).$nvpStr."&BUTTONSOURCE=".urlencode($sBNCode); |
|
355 | 355 | |
356 | 356 | //setting the nvpreq as POST FIELD to curl |
357 | 357 | curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); |
@@ -385,8 +385,8 @@ discard block |
||
385 | 385 | { |
386 | 386 | global $PAYPAL_URL; |
387 | 387 | // Redirect to paypal.com here |
388 | - $payPalURL = $PAYPAL_URL . $token; |
|
389 | - header("Location: " . $payPalURL); |
|
388 | + $payPalURL = $PAYPAL_URL.$token; |
|
389 | + header("Location: ".$payPalURL); |
|
390 | 390 | exit; |
391 | 391 | } |
392 | 392 |