Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Fix generate url with https, Remove dependence to PHP intl extension
Browse files Browse the repository at this point in the history
  • Loading branch information
regdos committed Feb 17, 2017
1 parent 6680360 commit 0f672e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.2.2
* Fix generate url with https
* Remove dependence to PHP intl extension

## 3.2.1
* Fix language

Expand Down
17 changes: 5 additions & 12 deletions upload/catalog/controller/extension/payment/payu.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ControllerExtensionPaymentPayU extends Controller
{
const PAY_BUTTON = 'https://static.payu.com/pl/standard/partners/buttons/payu_account_button_01.png';

const VERSION = '3.2.1';
const VERSION = '3.2.2';

private $ocr = array();
private $totalWithoutDiscount = 0;
Expand All @@ -35,7 +35,7 @@ private function loadLibConfig()
public function index()
{
$data['payu_button'] = self::PAY_BUTTON;
$data['action'] = $this->url->link('extension/payment/payu/pay');
$data['action'] = $this->url->link('extension/payment/payu/pay','', true);

return $this->load->view('extension/payment/payu', $data);
}
Expand Down Expand Up @@ -68,7 +68,7 @@ public function pay()

$return['status'] = 'SUCCESS';

$return['redirectUri'] = $response->getResponse()->redirectUri . '&lang=' . $this->getLanguage($this->session->data['language']);
$return['redirectUri'] = $response->getResponse()->redirectUri . '&lang=' . substr($this->session->data['language'], 0, 2);

} else {
$return['status'] = 'ERROR';
Expand Down Expand Up @@ -174,11 +174,10 @@ private function buildOrder()

//OCR basic data
$this->ocr['merchantPosId'] = OpenPayU_Configuration::getMerchantPosId();
$this->ocr['orderUrl'] = $this->url->link('extension/payment/payu/callback') . '?order=' . $order_info['order_id'];
$this->ocr['description'] = $this->language->get('text_payu_order') . ' #' . $order_info['order_id'];
$this->ocr['customerIp'] = $this->getIP($order_info['ip']);
$this->ocr['notifyUrl'] = $this->url->link('extension/payment/payu/ordernotify');
$this->ocr['continueUrl'] = $this->url->link('checkout/success');
$this->ocr['notifyUrl'] = $this->url->link('extension/payment/payu/ordernotify', '', true);
$this->ocr['continueUrl'] = $this->url->link('checkout/success', '', true);
$this->ocr['currencyCode'] = $order_info['currency_code'];
$this->ocr['totalAmount'] = $this->toAmount(
$this->currencyFormat($order_info['total'], $order_info['currency_code'])
Expand Down Expand Up @@ -305,10 +304,4 @@ private function getIP($orderIP)
? '127.0.0.1' : $orderIP;
}

private function getLanguage($code)
{
$locale = locale_parse($code);
return $locale['language'];
}

}

0 comments on commit 0f672e0

Please sign in to comment.