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

Commit

Permalink
Release 1.0.41
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrowanwallee committed Dec 9, 2020
1 parent f26f691 commit f5c604b
Show file tree
Hide file tree
Showing 487 changed files with 11,797 additions and 1,625 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ This repository contains the OpenCart wallee payment module that enables the sh

## Documentation

* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.2/1.0.39/docs/en/documentation.html)
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.2/1.0.41/docs/en/documentation.html)

## Support

Support queries can be issued on the [wallee support site](https://app-wallee.com/space/select?target=/support).

## License

Please see the [license file](https://github.com/wallee-payment/opencart-2.2/blob/1.0.39/LICENSE) for more information.
Please see the [license file](https://github.com/wallee-payment/opencart-2.2/blob/1.0.41/LICENSE) for more information.
4 changes: 2 additions & 2 deletions docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/opencart-2.2/releases/tag/1.0.39/">
<a href="https://github.com/wallee-payment/opencart-2.2/releases/tag/1.0.41/">
Source
</a>
</li>
Expand All @@ -49,7 +49,7 @@ <h1>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="https://github.com/wallee-payment/opencart-2.2/releases/tag/1.0.39/">Download</a> the extension.</p>
<p><a href="https://github.com/wallee-payment/opencart-2.2/releases/tag/1.0.41/">Download</a> the extension.</p>
</li>
<li>
<p>Extract the files and upload the content of the <code>Upload</code> directory into the root directory of your store using FTP/SSH.</p>
Expand Down
89 changes: 48 additions & 41 deletions upload/admin/controller/payment/wallee.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ControllerPaymentWallee extends AbstractController {

// Holds multistore configs
protected $data = array();

/**
* This method is executed by OpenCart when the Payment module is installed from the admin.
* It will create the
Expand All @@ -21,7 +21,7 @@ public function install(){
$this->load->model("extension/wallee/setup");
$this->model_extension_wallee_setup->install();
}

/**
*
* @param bool $purge Set to false to skip purgin database.
Expand All @@ -31,7 +31,7 @@ public function uninstall($purge = true){
$this->load->model("extension/wallee/setup");
$this->model_extension_wallee_setup->uninstall($purge);
}

/**
* Render the payment method's settings page.
*/
Expand All @@ -56,7 +56,7 @@ public function index(){

$this->response->setOutput($this->loadView("payment/wallee", array_merge($storeConfigs, $pageVariables)));
}

/**
* Synchronizes webhooks and payment methods for the given space id.
*
Expand All @@ -71,7 +71,7 @@ private function synchronize($space_id){
$this->error['warning'] = $e->getMessage();
}
}

private function validateGlobalSettings(array $global){
if (!isset($global['wallee_application_key']) || empty($global['wallee_application_key'])) {
throw new Exception($this->language->get('error_application_key_unset'));
Expand All @@ -85,7 +85,7 @@ private function validateGlobalSettings(array $global){
throw new Exception($this->language->get('error_user_id_unset'));
}
}

private function validateStoreSettings(array $store){
if (isset($store['wallee_space_id']) && !empty($store['wallee_space_id'])) {
if (!ctype_digit($store['wallee_space_id'])) {
Expand All @@ -101,13 +101,16 @@ private function validateStoreSettings(array $store){
}
}
}

private function persistStoreSettings(array $global, array $store){
$newSettings = array_merge($global, $store);

// preserve migration state
$newSettings['wallee_migration_version'] = $this->config->get('wallee_migration_version');
$newSettings['wallee_migration_name'] = $this->config->get('wallee_migration_name');
if($this->config->has('wallee_migration_version')) {
$newSettings['wallee_migration_version'] = $this->config->get('wallee_migration_version');
$newSettings['wallee_migration_name'] = $this->config->get('wallee_migration_name');
}

// preserve manual tasks
$newSettings[\Wallee\Service\ManualTask::CONFIG_KEY] = WalleeVersionHelper::getPersistableSetting(
$this->model_setting_setting->getSetting(\Wallee\Service\ManualTask::CONFIG_KEY, $store['id']), 0);
Expand All @@ -133,7 +136,7 @@ private function persistStoreSettings(array $global, array $store){

return true;
}

/**
* Processes post data to settings.
*
Expand Down Expand Up @@ -179,11 +182,11 @@ private function processPostData($shops){
$this->response->redirect(
$this->createUrl("extension/payment",
array(
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
)));
}
}

/**
* Returns all variables used in the settigns page template.
*
Expand All @@ -198,17 +201,17 @@ private function getSettingPageVariables($shops){
// Form action url
$data['action'] = $this->createUrl("payment/wallee",
array(
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
));
$data['cancel'] = $this->createUrl("extension/payment",
array(
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
));

return array_merge($this->getSettingsPageTranslatedVariables(), $data, $this->getAlertTemplateVariables(), $this->getSettingsPageBreadcrumbs(),
$this->getSettingPageStoreVariables($shops), $this->getAdminSurroundingTemplates());
}

private function getSettingsPageTranslatedVariables(){
$data = array();
// Set data for template
Expand Down Expand Up @@ -270,6 +273,10 @@ private function getSettingsPageTranslatedVariables(){
$data['entry_migration_name'] = $this->language->get('entry_migration_name');
$data['entry_migration_version'] = $this->language->get('entry_migration_version');

$data['title_version'] = $this->language->get('title_version');
$data['entry_version'] = $this->language->get('entry_version');
$data['entry_date'] = $this->language->get('entry_date');

$data['text_edit'] = $this->language->get("text_edit");
$data['text_information'] = $this->language->get('text_information');

Expand All @@ -284,14 +291,14 @@ private function getSettingsPageTranslatedVariables(){

return $data;
}

private function getLogLevels(){
return array(
\WalleeHelper::LOG_ERROR => $this->language->get('log_level_error'),
\WalleeHelper::LOG_DEBUG => $this->language->get('log_level_debug')
\WalleeHelper::LOG_DEBUG => $this->language->get('log_level_debug')
);
}

private function getOrderStatusTemplateVariables(){
$data = array();
$statuses = array(
Expand All @@ -302,20 +309,20 @@ private function getOrderStatusTemplateVariables(){
'failed_status',
'voided_status',
'decline_status',
'refund_status'
'refund_status'
);

foreach ($statuses as $status) {
$data[] = array(
'entry' => $this->language->get('entry_' . $status),
'description' => $this->language->get('description_' . $status),
'key' => 'wallee_' . $status . '_id'
'key' => 'wallee_' . $status . '_id'
);
}

return $data;
}

private function getAlertTemplateVariables(){
$data = array();
if (isset($this->session->data['success'])) {
Expand All @@ -335,38 +342,38 @@ private function getAlertTemplateVariables(){

return $data;
}

private function getSettingsPageBreadcrumbs(){
return array(
'breadcrumbs' => array(
array(
"href" => $this->createUrl("common/home",
array(
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
)),
"text" => $this->language->get("text_home"),
"separator" => false
"separator" => false
),
array(
"href" => $this->createUrl("extension/payment",
array(
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
)),
"text" => $this->language->get("text_payment"),
"separator" => ' :: '
"separator" => ' :: '
),
array(
"href" => $this->createUrl("payment/wallee",
array(
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
\WalleeVersionHelper::TOKEN => $this->session->data[\WalleeVersionHelper::TOKEN]
)),
"text" => $this->language->get("heading_title"),
"separator" => " :: "
)
)
"separator" => " :: "
)
)
);
}

private function getSettingPageStoreVariables($shops){
$this->load->model('setting/setting');
$data = array();
Expand Down Expand Up @@ -410,7 +417,7 @@ private function getSettingPageStoreVariables($shops){

return $data;
}

/**
* Returns all settings, and their respective default values.
* Global settings are returned in 'global', multistore settings returned in 'multistore'
Expand Down Expand Up @@ -441,22 +448,22 @@ private function getSettingsDefaults(){

"wallee_download_packaging" => 1,
"wallee_download_invoice" => 1,
\Wallee\Service\ManualTask::CONFIG_KEY => 0
\Wallee\Service\ManualTask::CONFIG_KEY => 0
);

$globalSettings = array(
"wallee_application_key" => null,
"wallee_user_id" => null,
"wallee_migration_name" => 'uninitialized',
"wallee_migration_version" => "0.0.0"
"wallee_migration_version" => "0.0.0"
);

return array(
'multistore' => $multiStoreSettings,
'global' => $globalSettings
'global' => $globalSettings
);
}

/**
* Check the post and check if the user has permission to edit the module settings
*
Expand All @@ -470,7 +477,7 @@ private function validateStore($store){

return (count($this->error) == 0);
}

/**
* Retrieve additional store id's from store table.
* Will not include default store. Only the additional stores. So we inject the default store here.
Expand All @@ -483,14 +490,14 @@ protected function getMultiStores(){
$default = array(
array(
'id' => 0,
'name' => $this->config->get('config_name')
)
'name' => $this->config->get('config_name')
)
);
$allStores = array_merge($default, $rows);

return $allStores;
}

protected function retrieveMultiStoreConfigs($shops){
$data = array();
foreach ($shops as $store) {
Expand All @@ -504,7 +511,7 @@ protected function retrieveMultiStoreConfigs($shops){
}
return $data;
}

protected function getRequiredPermission(){
return 'payment/wallee';
}
Expand Down
5 changes: 5 additions & 0 deletions upload/admin/language/en-gb/payment/wallee.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
$_['description_refund_status'] = "Status the order enters when the transaction has been fully refunded.";
$_['description_none_status'] = "Standard OpenCart behaviour specificies that an order confirmation email is sent when an order is moved from the 'None' state into any other state. For this reason you may want to treat 'Processing' and 'Failed' as 'None' so no emails are sent.";

// Version
$_['title_version'] = 'Plugin Version';
$_['entry_version'] = 'Version Number';
$_['entry_date'] = 'Release Date';

// Modifications
$_['title_modifications'] = "Modifications";
$_['entry_core'] = "Core";
Expand Down
18 changes: 18 additions & 0 deletions upload/admin/view/template/payment/wallee.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,24 @@
<i class="fa fa-pencil"></i> <?php echo $text_information; ?></h3>
</div>
<div class="panel-body">
<fieldset>
<legend><?php echo $title_version; ?></legend>

<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_version; ?></label>
<div class="col-sm-10">
<p class="form-control-static">1.0.41</p>
</div>
</div>

<div class="form-group">
<label class="col-sm-2 control-label"><?php echo $entry_date; ?></label>
<div class="col-sm-10">
<p class="form-control-static">2020/12/09 10:51:11</p>
</div>
</div>
</fieldset>

<fieldset>
<legend><?php echo $title_modifications; ?></legend>

Expand Down
6 changes: 5 additions & 1 deletion upload/system/library/wallee/service/transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public function getPaymentMethods(array $order_info){
if (!$sessionId || !array_key_exists($sessionId, self::$possible_payment_method_cache)) {
$transaction = $this->update($order_info, false);
try {
$payment_methods = $this->getTransactionService()->fetchPossiblePaymentMethods($transaction->getLinkedSpaceId(), $transaction->getId());
$payment_methods = $this->getTransactionService()->fetchPaymentMethods(
$transaction->getLinkedSpaceId(),
$transaction->getId(),
'iframe'
);
foreach ($payment_methods as $payment_method) {
MethodConfiguration::instance($this->registry)->updateData($payment_method);
}
Expand Down
2 changes: 1 addition & 1 deletion upload/system/library/wallee/wallee-sdk/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020 customweb GmbH
Copyright 2020 wallee AG

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit f5c604b

Please sign in to comment.