Skip to content

Commit

Permalink
Release of 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper-MultiSafepay authored Apr 1, 2020
2 parents b5293be + 47e943c commit 2546cdf
Show file tree
Hide file tree
Showing 12 changed files with 228 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.gitattributes export-ignore
/.gitignore export-ignore
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 1.5.0
Release date - April 1st, 2020

### Added
+ PLGCSCS-117: Add Apple Pay

### Changed
+ PLGCSCS-113: Rename MultiSafepay Wallet to MultiSafepay

***

## 1.4.0
Release date - February 26th, 2020

Expand Down
4 changes: 2 additions & 2 deletions app/payments/multisafepay.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@
$msp->transaction['items'] = $cart_items;
$msp->transaction['gateway'] = getGateway($processor_data['processor_params']['gateway']);
$msp->plugin_name = 'CS-Cart 4.x';
$msp->version = '1.4.0';
$msp->version = '1.5.0';
$msp->plugin['shop'] = 'CS-Cart';
$msp->plugin['shop_version'] = PRODUCT_VERSION;
$msp->plugin['plugin_version'] = '1.4.0';
$msp->plugin['plugin_version'] = '1.5.0';
$msp->plugin['partner'] = '';
$msp->plugin['shop_root_url'] = Registry::get('config.current_location');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ function fn_multisafepay_set_fastcheckout($payment_id, $order_id = 0, $order_inf
$msp->transaction['description'] = 'Order #' . $msp->transaction['id'];
$msp->transaction['items'] = $cart_items;
$msp->plugin_name = 'CS-Cart 4.x';
$msp->version = '1.4.0';
$msp->version = '1.5.0';

$msp->plugin['shop'] = 'CS-Cart';
$msp->plugin['shop_version'] = PRODUCT_VERSION;
$msp->plugin['plugin_version'] = '1.4.0';
$msp->plugin['plugin_version'] = '1.5.0';
$msp->plugin['partner'] = '';
$msp->plugin['shop_root_url'] = Registry::get('config.current_location');

Expand Down
24 changes: 24 additions & 0 deletions app/payments/multisafepay_applepay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade the MultiSafepay plugin
* to newer versions in the future. If you wish to customize the plugin for your
* needs please document your changes and make backups before you update.
*
* @category MultiSafepay
* @package Connect
* @author TechSupport <integration@multisafepay.com>
* @copyright Copyright (c) 2020 MultiSafepay, Inc. (https://www.multisafepay.com)
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
require_once('multisafepay.php');
?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{* $Id: cc_multisafepay.tpl,v 1.0 2008/04/20 letun Exp $ *}
{assign var="r_url" value="`$config.http_location`/`$config.customer_index`?dispatch=payment_notification.notify&payment=multisafepay_applepay"}
{assign var="e_url" value="`$config.http_location`/`$config.customer_index`?dispatch=payment_notification&payment_notification.result=multisafepay_applepay"}
<h3>MultiSafepay</h3>
<p />

{* Test/Live mode *}
<div class="form-field">
<label for="mode">Type account:</label>
<select name="payment_data[processor_params][mode]" id="mode">
<option value="P" {if $processor_params.mode == "P"}selected="selected"{/if}>Live account</option>
<option value="T" {if $processor_params.mode == "T"}selected="selected"{/if}>Test account</option>
</select>
</div>

<input type="hidden" name="payment_data[processor_params][gateway]" maxlength="20" id="store_id" value="APPLEPAY" class="input-text" />

{* account id *}
<div class="form-field">
<label for="store_id">Account ID:</label>
<input type="text" name="payment_data[processor_params][account]" maxlength="20" id="store_id" value="{$processor_params.account|escape}" class="input-text" />
</div>

{* site id *}
<div class="form-field">
<label for="store_id">Site ID:</label>
<input type="text" name="payment_data[processor_params][site_id]" maxlength="16" id="store_id" value="{$processor_params.site_id|escape}" class="input-text" />
</div>

{* Security Code *}
<div class="form-field">
<label for="securitycode">Site Code:</label>
<input type="text" name="payment_data[processor_params][securitycode]" maxlength="16" id="securitycode" value="{$processor_params.securitycode|escape}" class="input-text" />
</div>

{* Notificatie URL *}
<div class="form-field">
<label for="notificationurl">Notificatie URL:</label>
{$r_url}
<input type="hidden" name="payment_data[processor_params][notificationurl]" id="securitycode" value="{$r_url|escape}"/>
</div>


{* Currency *}
<div class="form-field">
<label for="currency">{__("currency")}:</label>
<select name="payment_data[processor_params][currency]" id="currency">
<option value="EUR" {if $processor_params.currency == "EUR"}selected="selected"{/if}>Euro (Europe)</option>
</select>
</div>


<div class="form-field">
<label for="minamount">Minimal amount:</label>
<input type="text" name="payment_data[processor_params][minamount]" maxlength="20" id="minamount" value="{$processor_params.minamount|escape}" class="input-text" />
</div>

<div class="form-field">
<label for="maxamount">Maximal amount:</label>
<input type="text" name="payment_data[processor_params][maxamount]" maxlength="20" id="maxamount" value="{$processor_params.maxamount|escape}" class="input-text" />
</div>


{assign var="statuses" value=$smarty.const.STATUSES_ORDER|fn_get_simple_statuses}

<div class="form-field">
<label for="elm_multisafepay_initialized">Initialized status:</label>
<select name="payment_data[processor_params][statuses][initialized]" id="elm_multisafepay_initialized">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.initialized) && $processor_params.statuses.initialized == $k) || (!isset($processor_params.statuses.initialized) && $k == 'O')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>

<div class="form-field">
<label for="elm_multisafepay_completed">Complete status:</label>
<select name="payment_data[processor_params][statuses][completed]" id="elm_multisafepay_completed">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.completed) && $processor_params.statuses.completed == $k) || (!isset($processor_params.statuses.completed) && $k == 'P')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>

<div class="form-field">
<label for="elm_multisafepay_pending">Pending status:</label>
<select name="payment_data[processor_params][statuses][pending]" id="elm_multisafepay_pending">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.pending) && $processor_params.statuses.pending == $k) || (!isset($processor_params.statuses.pending) && $k == 'O')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>

<div class="form-field">
<label for="elm_multisafepay_uncleared">Uncleared status:</label>
<select name="payment_data[processor_params][statuses][uncleared]" id="elm_multisafepay_uncleared">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.uncleared) && $processor_params.statuses.uncleared == $k) || (!isset($processor_params.statuses.uncleared) && $k == 'O')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>

<div class="form-field">
<label for="elm_multisafepay_cancelled">Cancelled status:</label>
<select name="payment_data[processor_params][statuses][cancelled]" id="elm_multisafepay_cancelled">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.cancelled) && $processor_params.statuses.cancelled == $k) || (!isset($processor_params.statuses.cancelled) && $k == 'I')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>

<div class="form-field">
<label for="elm_multisafepay_refunded">Refunded status:</label>
<select name="payment_data[processor_params][statuses][refunded]" id="elm_multisafepay_refunded">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.refunded) && $processor_params.statuses.refunded == $k) || (!isset($processor_params.statuses.refunded) && $k == 'I')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>
<div class="form-field">
<label for="elm_multisafepay_partial_refunded">Partial refunded status:</label>
<select name="payment_data[processor_params][statuses][partial_refunded]" id="elm_multisafepay_partial_refunded">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.partial_refunded) && $processor_params.statuses.partial_refunded == $k) || (!isset($processor_params.statuses.partial_refunded) && $k == 'I')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>

<div class="form-field">
<label for="elm_multisafepay_declined">Declined status:</label>
<select name="payment_data[processor_params][statuses][declined]" id="elm_multisafepay_declined">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.declined) && $processor_params.statuses.declined == $k) || (!isset($processor_params.statuses.declined) && $k == 'D')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>

<div class="form-field">
<label for="elm_multisafepay_voided">Voided status:</label>
<select name="payment_data[processor_params][statuses][voided]" id="elm_multisafepay_voided">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.voided) && $processor_params.statuses.voided == $k) || (!isset($processor_params.statuses.voided) && $k == 'D')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>

<div class="form-field">
<label for="elm_multisafepay_expired">Expired status:</label>
<select name="payment_data[processor_params][statuses][expired]" id="elm_multisafepay_expired">
{foreach from=$statuses item="s" key="k"}
<option value="{$k}" {if (isset($processor_params.statuses.expired) && $processor_params.statuses.expired == $k) || (!isset($processor_params.statuses.expired) && $k == 'F')}selected="selected"{/if}>{$s}</option>
{/foreach}
</select>
</div>
Empty file.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{msp_issuers}{/msp_issuers}
{msp_issuers}{/msp_issuers}
Empty file.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{msp_issuers}{/msp_issuers}
{msp_issuers}{/msp_issuers}
Binary file added images/msp/applepay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 32 additions & 2 deletions msp_installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@

require_once(dirname(__FILE__) . '/config.php');

/**
* If this is an update of the plugin,
* we first have to rename some deprecated payment names.
*/

const PAYMENTS_TO_RENAME = [
'Multisafepay Wallet' => 'MultiSafepay',
];

foreach (PAYMENTS_TO_RENAME as $oldName => $newName) {
renamePaymentNames($oldName, $newName, $config);
}

$payments = array(
"BANKTRANS" => "Bank transfer",
"DIRDEB" => "Direct Debit",
Expand All @@ -40,7 +53,7 @@
"MAESTRO" => "Maestro",
"MASTERCARD" => "Mastercard",
"BANCONTACT" => "Bancontact",
"WALLET" => "Multisafepay Wallet",
"WALLET" => "MultiSafepay",
"VISA" => "Visa",
"PAYPAL" => "PayPal",
"FERBUY" => "Ferbuy",
Expand All @@ -60,13 +73,15 @@
"EPS" => "EPS",
"IDEALQR" => "iDEAL QR",
"AFTERPAY" => "AfterPay",
"APPLEPAY" => "Apple Pay",
);


foreach ($payments as $paymentcode => $naam) {
upd($naam, "`" . $config['table_prefix'] . "payment_processors` SET `processor` = 'MultiSafepay " . $naam . "', `processor_script` = 'multisafepay_" . strtolower($paymentcode) . ".php', `admin_template` = 'msp_" . strtolower($paymentcode) . ".tpl', `processor_template` = 'views/orders/components/payments/msp_" . strtolower($paymentcode) . ".tpl', `callback` = 'Y', `type` = 'P'", $config);
}


$html = '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl-nl" lang="nl-nl">';
$html .= '<head>';
$html .= '<meta charset="utf-8">';
Expand Down Expand Up @@ -111,4 +126,19 @@ function upd($naam, $query, $config)
}
}

?>

function renamePaymentNames($oldName, $newName, $config)
{
$mysqli = new mysqli($config['db_host'], $config['db_user'], $config['db_password'], $config['db_name']);

if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}

$query = 'UPDATE ' . $config['table_prefix'] . 'payment_processors' .
" SET processor = 'MultiSafepay " . $newName . "' " .
" WHERE processor = 'MultiSafepay " . $oldName . "'";

$mysqli->query($query);
}

0 comments on commit 2546cdf

Please sign in to comment.