Skip to content

Commit

Permalink
Release update of Opencart V3.0 for API V3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
prabalsslw committed Jun 9, 2020
1 parent eaddab8 commit b509beb
Show file tree
Hide file tree
Showing 5 changed files with 497 additions and 181 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This Module Work for Opencart Version 3.x.x

### Feature

- Version 3.0 API
- Version 3.5 API

### Installation Steps:

Expand Down
27 changes: 27 additions & 0 deletions admin/controller/extension/payment/SSLCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,42 @@ public function index() {
$data['payment_SSLCommerce_sort_order'] = $this->config->get('payment_SSLCommerce_sort_order');
}

$string = $this->url->link('extension/payment/SSLCommerce/sslcommerz_ipn', '', 'SSL');
$data['payment_SSLCommerce_ipn_url'] = preg_replace('~/admin+~', '', $string, 1);

$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');

/* admin/view/template/extension/payment/SSLCommerce.twig */

$string = $this->url->link('extension/payment/SSLCommerce/sslcommerz_ipn', '', 'SSL');
// $data['payment_SSLCommerce_ipn_url'] = preg_replace('~/admin+~', '', $string, 1);

$search = '/admin';
$replace = '';
$str = $this->str_replace_last( $search , $replace , $string );
$data['payment_SSLCommerce_ipn_url'] = $str;

$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');

/* admin/view/template/extension/payment/SSLCommerce.twig */

$this->response->setOutput($this->load->view('extension/payment/SSLCommerce', $data));

$this->response->setOutput($this->load->view('extension/payment/SSLCommerce', $data));

}

private function str_replace_last( $search , $replace , $str ) {
if( ( $pos = strrpos( $str , $search ) ) !== false ) {
$search_length = strlen( $search );
$str = substr_replace( $str , $replace , $pos , $search_length );
}
return $str;
}

private function validate() {
if (!$this->user->hasPermission('modify', 'extension/payment/SSLCommerce')) {
Expand Down
1 change: 1 addition & 0 deletions admin/language/en-gb/extension/payment/SSLCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
$_['entry_geo_zone'] = 'Geo Zone:';
$_['entry_status'] = 'Status:';
$_['entry_sort_order'] = 'Sort Order:';
$_['ipn_url'] = 'IPN URL:';

// Error
$_['error_permission'] = 'Warning: You do not have permission to modify payment SSLCommerce! You Must have SSLCommerce Store ID to Active the Account. Please Contact with SSLCommerce for Marchant.<a href="https://www.sslcommerz.com/" target="_blank">Click to Contact</a>';
Expand Down
8 changes: 8 additions & 0 deletions admin/view/template/extension/payment/SSLCommerce.twig
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@
<input type="text" name="payment_SSLCommerce_sort_order" value="{{ payment_SSLCommerce_sort_order }}" size="1" />
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label" for="ipn-url">{{ ipn_url }}</label>
<div class="col-sm-10">
<label class="col-sm-10 control-label" for="ipn-url">{{ payment_SSLCommerce_ipn_url }}</label>

</div>
</div>
</form>
</div>
</div>
Expand Down
Loading

0 comments on commit b509beb

Please sign in to comment.