Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Compatibility: Compatible with PHP 8.1 & PrestaShop 8.0.x #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.4.0] - 2023-08-02
### Changed
- Enhanced Compatibility: Compatible with PHP 8.1 & Prestashop 8.0.x (tested with v8.0.4).
- The module has been updated to API version 73.
- Added the Checkout Interaction Model feature to the admin settings.
- Hosted session payment method is no longer supported.

## [1.3.8] - 2022-04-20
### Fixed
- The products are removed from the customer's shopping cart if the payment fails
Expand Down
Empty file modified LICENSE.txt
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ all :
zip -rq ./prestashop-mastercard.zip ./mastercard &&\
mv ./mastercard/vendor . &&\
rm -rf ./mastercard &&\
echo "\nCreated prestashop-mastercard.zip\n"
echo "\nCreated prestashop-mastercard.zip\n"
170 changes: 90 additions & 80 deletions README.md
100644 → 100755

Large diffs are not rendered by default.

Empty file modified RELEASE.md
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions composer.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ontap/mastercard",
"version": "1.3.8",
"name": "mastercard/mastercard",
"version": "1.4.0",
"description": "Mastercard Payment Gateway Services module for Prestashop",
"type": "prestashop-module",
"require": {
Expand Down
Empty file modified composer.lock
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion controllers/admin/AdminMpgsController.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2022 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/index.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/abstract.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions controllers/front/hostedcheckout.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,13 +32,13 @@ protected function createSessionAndRedirect()
$orderId = $this->module->getNewOrderRef();

$deltaAmount = $this->getDeltaAmount();

$order = array(
'id' => $orderId,
'reference' => $orderId,
'currency' => Context::getContext()->currency->iso_code,
'amount' => GatewayService::numeric(
Context::getContext()->cart->getOrderTotal()
Context::getContext()->cart->getOrderTotal()
),
'item' => $this->module->getOrderItems($deltaAmount),
'itemAmount' => $this->module->getItemAmount($deltaAmount),
Expand All @@ -51,12 +51,12 @@ protected function createSessionAndRedirect()
'shipping' => 'HIDE',
'billingAddress' => GatewayService::safe(Configuration::get('mpgs_hc_show_billing')),
'customerEmail' => GatewayService::safe(Configuration::get('mpgs_hc_show_email')),
'orderSummary' => GatewayService::safe(Configuration::get('mpgs_hc_show_summary')),
),
'merchant' => array(
'name' => GatewayService::safe(Context::getContext()->shop->name, 40),
),
'operation' => Configuration::get('mpgs_hc_payment_action')

);

/** @var ContextCore $context */
Expand All @@ -80,7 +80,7 @@ protected function createSessionAndRedirect()
$this->getContactForGateway($customer),
$this->getAddressForGateway($billingAddress),
$this->getAddressForGateway($shippingAddress),
$this->getContactForGateway($shippingAddress)
$this->getContactForGateway($shippingAddress),
);

$responseData = array(
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/index.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/threedsresponse.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/webhook.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion controllers/index.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Binary file added docs/images/advance-configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/configure-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/general-setting-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/hosted-checkout-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/incorrect-credentails.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/images/index.php
100644 → 100755
Empty file.
Binary file added docs/images/order-detail-payment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/partial-refund.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/refund.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/void-transaction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
10 changes: 6 additions & 4 deletions gateway.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2022 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -248,7 +248,7 @@ public function __construct(
*/
protected function getSolutionId()
{
return 'PRESTASHOP_'._PS_VERSION_.'_ONTAP_'.MPGS_VERSION;
return 'PRESTASHOP_'._PS_VERSION_.'_MASTERCARD_'.MPGS_VERSION;
}

/**
Expand Down Expand Up @@ -627,10 +627,12 @@ public function createCheckoutSession(
$uri = $this->apiUrl.'session';

$request = $this->messageFactory->createRequest('POST', $uri, array(), json_encode(array(
'apiOperation' => 'CREATE_CHECKOUT_SESSION',
'apiOperation' => 'INITIATE_CHECKOUT',
'partnerSolutionId' => $this->getSolutionId(),
'order' => array_merge($order, array(
'notificationUrl' => $this->webhookUrl,
'description' => 'Customer Order',
'amount' => $order['amount'],
)),
'billing' => array(
'address' => $billing,
Expand Down Expand Up @@ -1037,7 +1039,7 @@ public function paymentOptionsInquiry()
{
$uri = $this->apiUrl.'paymentOptionsInquiry';

$request = $this->messageFactory->createRequest('GET', $uri);
$request = $this->messageFactory->createRequest('POST', $uri);
$response = $this->client->sendRequest($request);

$response = json_decode($response->getBody(), true);
Expand Down
2 changes: 1 addition & 1 deletion handlers.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2022 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion index.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2019-2021 Mastercard
* Copyright (c) 2019-2023 Mastercard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Empty file modified iso3.php
100644 → 100755
Empty file.
Empty file modified logo.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading