-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Paymennt.com OpenCart plugin version 1.0.1
- Loading branch information
Sameer Ababneh
committed
Dec 8, 2023
0 parents
commit edf8852
Showing
78 changed files
with
5,801 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Paymennt.com OpenCart extension | ||
|
||
Download following zip file paymennt.ocmod.zip | ||
|
||
- Login to OpenCart admin pannel | ||
- Go to Extensions -> Installer | ||
- Download the latest release of paymennt.ocmod.zip extension from [releases section](https://github.com/paymennt/opencart/releases/latest) | ||
- Click on upload button and upload the downloaded paymennt.ocmod.zip | ||
- Click install | ||
- Click on the add button in-front of Paymennt.com extension | ||
- Go to Extensions -> Extensions -> Payments | ||
- Navigate to Paymennt.com extetion click add | ||
- Once extension added click edit icon | ||
- On Extension settings page enter to the API credentials provided by Paymennt.com and then click save. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?php | ||
namespace Opencart\Admin\Controller\Extension\Paymennt\Payment; | ||
class Paymennt extends \Opencart\System\Engine\Controller { | ||
public function index(): void { | ||
|
||
if(count($this->request->post) > 0 ) { | ||
$this->save(); | ||
die(); | ||
} | ||
|
||
$this->load->language('extension/paymennt/payment/paymennt'); | ||
|
||
$this->document->setTitle($this->language->get('heading_title')); | ||
|
||
$data['breadcrumbs'] = []; | ||
|
||
$data['breadcrumbs'][] = [ | ||
'text' => $this->language->get('text_home'), | ||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token']) | ||
]; | ||
|
||
$data['breadcrumbs'][] = [ | ||
'text' => $this->language->get('text_extension'), | ||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment') | ||
]; | ||
|
||
$data['breadcrumbs'][] = [ | ||
'text' => $this->language->get('heading_title'), | ||
'href' => $this->url->link('extension/paymennt/payment/paymennt', 'user_token=' . $this->session->data['user_token']) | ||
]; | ||
|
||
$data['save'] = $this->url->link('extension/paymennt/payment/paymennt.save', 'user_token=' . $this->session->data['user_token']); | ||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment'); | ||
|
||
$data['payment_paymennt_response'] = $this->config->get('payment_paymennt_response'); | ||
$data['payment_paymennt_envrinoment'] = $this->config->get('payment_paymennt_envrinoment'); | ||
|
||
$approved_status = 2; | ||
if($this->config->get('payment_paymennt_approved_status_id') != '') | ||
$approved_status = $this->config->get('payment_paymennt_approved_status_id'); | ||
|
||
$failed_status = 10; | ||
if($this->config->get('payment_paymennt_failed_status_id') != '') | ||
$failed_status = $this->config->get('payment_paymennt_failed_status_id'); | ||
|
||
$order_status = 1; | ||
if($this->config->get('payment_paymennt_order_status_id') != '') | ||
$order_status = $this->config->get('payment_paymennt_order_status_id'); | ||
|
||
$data['payment_paymennt_approved_status_id'] = $approved_status; | ||
$data['payment_paymennt_failed_status_id'] = $failed_status; | ||
|
||
$data['payment_paymennt_order_status_id'] = $order_status; | ||
|
||
|
||
$data['payment_paymennt_apikey'] = $this->config->get('payment_paymennt_apikey'); | ||
$data['payment_paymennt_apisecret'] = $this->config->get('payment_paymennt_apisecret'); | ||
$data['payment_paymennt_publickey'] = $this->config->get('payment_paymennt_publickey'); | ||
$data['payment_paymennt_paymenttype'] = $this->config->get('payment_paymennt_paymenttype'); | ||
|
||
|
||
$this->load->model('localisation/order_status'); | ||
|
||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses(); | ||
|
||
$data['payment_paymennt_geo_zone_id'] = $this->config->get('payment_paymennt_geo_zone_id'); | ||
|
||
$this->load->model('localisation/geo_zone'); | ||
|
||
$data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones(); | ||
|
||
$data['payment_paymennt_status'] = $this->config->get('payment_paymennt_status'); | ||
$data['payment_paymennt_sort_order'] = $this->config->get('payment_paymennt_sort_order'); | ||
|
||
|
||
$data['header'] = $this->load->controller('common/header'); | ||
$data['column_left'] = $this->load->controller('common/column_left'); | ||
$data['footer'] = $this->load->controller('common/footer'); | ||
|
||
$this->response->setOutput($this->load->view('extension/paymennt/payment/paymennt', $data)); | ||
} | ||
|
||
public function save(): void { | ||
|
||
$this->load->language('extension/paymennt/payment/paymennt'); | ||
$json = []; | ||
|
||
if (!$this->user->hasPermission('modify', 'extension/paymennt/payment/paymennt')) { | ||
$json['error'] = $this->language->get('error_permission'); | ||
} | ||
|
||
if (empty($json['error'])) { | ||
|
||
$this->load->model('setting/setting'); | ||
|
||
$this->model_setting_setting->editSetting('payment_paymennt', $this->request->post); | ||
//echo "I am here"; | ||
$json['success'] = $this->language->get('text_success'); | ||
|
||
} | ||
|
||
$this->response->addHeader('Content-Type: application/json'); | ||
echo json_encode($json); | ||
// $this->response->setOutput(json_encode($json)); | ||
} | ||
|
||
public function install(): void { | ||
//if ($this->user->hasPermission('modify', 'extension/paymennt/payment/paymennt')) { | ||
$this->load->model('extension/paymennt/payment/paymennt'); | ||
|
||
$this->model_extension_paymennt_payment_paymennt->install(); | ||
//} | ||
} | ||
|
||
public function uninstall(): void { | ||
//if ($this->user->hasPermission('modify', 'extension/paymennt/payment/paymennt')) { | ||
$this->load->model('extension/paymennt/payment/paymennt'); | ||
|
||
$this->model_extension_paymennt_payment_paymennt->uninstall(); | ||
//} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
// Heading | ||
$_['heading_title'] = 'Paymennt.com <img src="https://www.paymennt.com/img/web/paymennt-logo-sm.png" width="79px">'; | ||
|
||
// Text | ||
$_['text_description'] = 'Let your customers pay using Credit cart - via Paymennt'; | ||
|
||
$_['text_sandbox'] = 'Testing'; | ||
$_['text_production'] = 'Live'; | ||
$_['text_apikey'] = 'API Key'; | ||
$_['text_apisecret'] = 'API Secret'; | ||
$_['text_publickey'] = 'Public Key'; | ||
$_['text_paymenttype'] = 'Payment Type'; | ||
$_['text_paymenttypeframes'] = 'Drop-in Frames'; | ||
$_['text_paymenttypehosted'] = 'Hosted Checkout'; | ||
|
||
$_['text_extension'] = 'Extensions'; | ||
$_['text_success'] = 'Success: You have modified credit card payment module!'; | ||
$_['text_edit'] = 'Edit Paymennt settings'; | ||
$_['text_general'] = 'General'; | ||
$_['text_developer'] = 'Developer'; | ||
$_['text_approve'] = 'Approve'; | ||
$_['text_success'] = 'Paymennt configuration has been saved.'; | ||
|
||
$_['text_deny'] = 'Deny'; | ||
$_['text_report'] = 'Report'; | ||
|
||
// Column | ||
$_['column_order'] = 'Order ID'; | ||
$_['column_card'] = 'Credit Card'; | ||
$_['column_amount'] = 'Amount'; | ||
$_['column_response'] = 'Response'; | ||
$_['column_status'] = 'Order Status'; | ||
$_['column_date_added'] = 'Date Added'; | ||
$_['column_action'] = 'Action'; | ||
|
||
// Entry | ||
$_['entry_response'] = 'Card Processor Response'; | ||
$_['entry_approved_status'] = 'Approved Status'; | ||
$_['entry_failed_status'] = 'Failed Status'; | ||
$_['entry_order_status'] = 'Order Status'; | ||
$_['entry_geo_zone'] = 'Geo Zone'; | ||
$_['entry_status'] = 'Status'; | ||
$_['entry_sort_order'] = 'Sort Order'; | ||
$_['entry_env'] = 'Mode'; | ||
// Help | ||
$_['help_response'] = 'Choose if the credit card should return approved or denied making test orders'; | ||
|
||
// Error | ||
$_['error_permission'] = 'Warning: You do not have permission to modify payment credit card!'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
namespace Opencart\Admin\Model\Extension\Paymennt\Payment; | ||
class Paymennt extends \Opencart\System\Engine\Model { | ||
public function install(): void { | ||
|
||
} | ||
|
||
public function uninstall(): void { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
{{ header }}{{ column_left }} | ||
<div id="content"> | ||
<div class="page-header"> | ||
<div class="container-fluid"> | ||
<div class="float-end"> | ||
<button type="submit" form="form-payment" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-save"></i></button> | ||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div> | ||
<h1>{{ heading_title }}</h1> | ||
<ol class="breadcrumb"> | ||
{% for breadcrumb in breadcrumbs %} | ||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li> | ||
{% endfor %} | ||
</ol> | ||
</div> | ||
</div> | ||
<div class="container-fluid"> | ||
|
||
<div class="card"> | ||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_edit }}</div> | ||
<div class="card-body"> | ||
<form id="form-payment" action="" method="post" data-oc-toggle="ajax"> | ||
<ul class="nav nav-tabs"> | ||
<li class="nav-item"><a href="#tab-general" data-bs-toggle="tab" class="nav-link active">{{ tab_general }}</a></li> | ||
|
||
</ul> | ||
<div class="tab-content"> | ||
<div id="tab-general" class="tab-pane active"> | ||
|
||
<fieldset> | ||
|
||
<!-- <div class="row mb-3"> | ||
<label for="input-response" class="col-sm-2 col-form-label">{{ entry_response }}</label> | ||
<div class="col-sm-10"> | ||
<select name="payment_paymennt_response" id="input-response" class="form-select"> | ||
<option value="1"{% if payment_paymennt_response %} selected{% endif %}>{{ text_approve }}</option> | ||
<option value="0"{% if not payment_paymennt_response %} selected{% endif %}>{{ text_deny }}</option> | ||
</select> | ||
</div> | ||
</div> --> | ||
<div class="row mb-3"> | ||
<label for="input-status" class="col-sm-2 col-form-label">{{ entry_status }}</label> | ||
<div class="col-sm-10"> | ||
<div class="form-check form-switch form-switch-lg"> | ||
<input type="hidden" name="payment_paymennt_status" value="0"/> <input type="checkbox" name="payment_paymennt_status" value="1" id="input-status" class="form-check-input"{% if payment_paymennt_status %} checked{% endif %}/> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row mb-3"> | ||
<label for="input-response" class="col-sm-2 col-form-label">{{ entry_env }}</label> | ||
<div class="col-sm-10"> | ||
<select name="payment_paymennt_envrinoment" id="input-response" class="form-select"> | ||
<option value="1"{% if payment_paymennt_envrinoment %} selected{% endif %}>{{ text_production }}</option> | ||
<option value="0"{% if not payment_paymennt_envrinoment %} selected{% endif %}>{{ text_sandbox }}</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="row mb-3"> | ||
<label for="input-sort-order" class="col-sm-2 col-form-label">{{ text_apikey }}</label> | ||
<div class="col-sm-10"> | ||
<input type="text" name="payment_paymennt_apikey" value="{{ payment_paymennt_apikey }}" placeholder="{{ text_apikey }}" id="input-sort-order" class="form-control"/> | ||
</div> | ||
</div> | ||
|
||
<div class="row mb-3"> | ||
<label for="input-sort-order" class="col-sm-2 col-form-label">{{ text_apisecret }}</label> | ||
<div class="col-sm-10"> | ||
<input type="text" name="payment_paymennt_apisecret" value="{{ payment_paymennt_apisecret }}" placeholder="{{ text_apisecret }}" id="input-sort-order" class="form-control"/> | ||
</div> | ||
</div> | ||
|
||
<div class="row mb-3"> | ||
<label for="input-sort-order" class="col-sm-2 col-form-label">{{ text_publickey }}</label> | ||
<div class="col-sm-10"> | ||
<input type="text" name="payment_paymennt_publickey" value="{{ payment_paymennt_publickey }}" placeholder="{{ text_publickey }}" id="input-sort-order" class="form-control"/> | ||
</div> | ||
</div> | ||
|
||
<div class="row mb-3"> | ||
<label for="input-response" class="col-sm-2 col-form-label">{{ text_paymenttype }}</label> | ||
<div class="col-sm-10"> | ||
<select name="payment_paymennt_paymenttype" id="input-response" class="form-select"> | ||
<option value="frames" {% if payment_paymennt_paymenttype == 'frames' %} selected{% endif %}>{{ text_paymenttypeframes }}</option> | ||
<option value="hosted" {% if payment_paymennt_paymenttype == 'hosted' %} selected{% endif %}>{{ text_paymenttypehosted }}</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="row mb-3"> | ||
<label for="input-approved-status" class="col-sm-2 col-form-label">{{ entry_approved_status }}</label> | ||
<div class="col-sm-10"> | ||
<select name="payment_paymennt_approved_status_id" id="input-approved-status" class="form-select"> | ||
|
||
{% for order_status in order_statuses %} | ||
|
||
<option value="{{ order_status.order_status_id }}"{% if order_status.order_status_id == payment_paymennt_approved_status_id %} selected{% endif %}>{{ order_status.name }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
<div class="row mb-3"> | ||
<label for="input-failed-status" class="col-sm-2 col-form-label">{{ entry_failed_status }}</label> | ||
<div class="col-sm-10"> | ||
<select name="payment_paymennt_failed_status_id" id="input-failed-status" class="form-select"> | ||
{% for order_status in order_statuses %} | ||
<option value="{{ order_status.order_status_id }}"{% if order_status.order_status_id == payment_paymennt_failed_status_id %} selected{% endif %}>{{ order_status.name }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
<div class="row mb-3"> | ||
<label for="input-order-status" class="col-sm-2 col-form-label">{{ entry_order_status }}</label> | ||
<div class="col-sm-10"> | ||
<select name="payment_paymennt_order_status_id" id="input-order-status" class="form-select"> | ||
{% for order_status in order_statuses %} | ||
<option value="{{ order_status.order_status_id }}"{% if order_status.order_status_id == payment_paymennt_order_status_id %} selected{% endif %}>{{ order_status.name }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
<div class="row mb-3"> | ||
<label for="input-geo-zone" class="col-sm-2 col-form-label">{{ entry_geo_zone }}</label> | ||
<div class="col-sm-10"> | ||
<select name="payment_paymennt_geo_zone_id" id="input-geo-zone" class="form-select"> | ||
<option value="0">{{ text_all_zones }}</option> | ||
{% for geo_zone in geo_zones %} | ||
<option value="{{ geo_zone.geo_zone_id }}"{% if geo_zone.geo_zone_id == payment_paymennt_geo_zone_id %} selected{% endif %}>{{ geo_zone.name }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
|
||
<div class="row mb-3"> | ||
<label for="input-sort-order" class="col-sm-2 col-form-label">{{ entry_sort_order }}</label> | ||
<div class="col-sm-10"> | ||
<input type="text" name="payment_paymennt_sort_order" value="{{ payment_paymennt_sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order" class="form-control"/> | ||
</div> | ||
</div> | ||
</fieldset> | ||
</div> | ||
|
||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{ footer }} |
Oops, something went wrong.