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

New Version 1.4.7 #26

Merged
merged 2 commits into from
Nov 26, 2024
Merged
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
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.4.7] - 2024-10-08
### Added
- Introduced a new 'Merchant Information' section in the plugin settings for admins to easily update merchant information.
- Eliminated the intermediate page in the 'Redirect to Payment Page' process for Hosted Checkout.

### Enhancement
- Compatibility with WooCommerce 9.3.

### Changed
- Updated the API version to 84.

### Fixed
- Resolved an issue where line items were not correctly transmitted to the payment gateway.

## [1.4.6] - 2024-08-30
### Added
- Implemented the ability to process void transactions.
Expand All @@ -10,6 +24,9 @@ All notable changes to this project will be documented in this file.
### Enhancement
- Compatibility with WordPress 6.6 and WooCommerce 9.1.

### Changed
- Updated the API version to 81.

## [1.4.4] - 2024-04-12
### Feature
- Implemented a notification feature to alert the WordPress administrator whenever a new version is launched on GitHub.
Expand Down Expand Up @@ -82,4 +99,4 @@ All notable changes to this project will be documented in this file.
- Partial refunds
- AVS
- 3DS1
- Tokenisation
- Tokenisation
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,23 @@

Payments through this module are processed securely via the Mastercard Payment Gateway. This ensures that card data is managed in compliance with all legal requirements. The gateway monitors every transaction and handles sensitive payment data on PCI Level 1 certified servers, simplifying PCI compliance for your business.

## Installation

**Minimum Requirements**

* WooCommerce 8.5 or greater
* PHP version 7.4 or greater
* cURL

## Compatibility
The module has been tested with the WooCommerce versions:
- 7.6.1
- 7.7.2
- 7.8.0
- 7.9.0
- 8.0.1
- 8.1.1
- 8.2.1
- 8.3.0
- 8.4.1

- 8.5.2
- 8.7.1
- 8.0.0
- 9.0.2
- 9.1.4

The module has been tested with the WordPress versions:
- 5.6.0
- 5.7.2
- 5.9.1
- 6.0.3
- 6.1.2
- 6.2.2
- 6.3.1
- 6.4.2
- 6.5.2
- 6.6.1

## Customer Information Shared with Gateway

### This module shares the following customer information with the gateway:
Expand Down Expand Up @@ -74,13 +62,13 @@ Ability to refund the partial transaction amount into the cardholder’s account
11. **Tokenization**
Tokenization makes the card payment experience secure by converting your 16-digit card numbers to encrypted tokens.
## Documentation
The official documentation for this module is available on: [https://mpgs.fingent.wiki/target/woocommerce-mastercard-payment-gateway-services/installation](https://mpgs.fingent.wiki/target/woocommerce-mastercard-payment-gateway-services/installation/)
The official documentation for this module is available on: [https://mpgs.fingent.wiki/target/woocommerce-mastercard-payment-gateway-services/installation](https://mpgs.fingent.wiki/enterprise/woocommerce-mastercard-payment-gateway-services/overview-and-feature-support)

## Support
For customer support: [https://mpgsfgs.atlassian.net/servicedesk/customer/portals](https://mpgsfgs.atlassian.net/servicedesk/customer/portals/)

## Obtain the module
You can obtain the module by downloading a release from: /~https://github.com/Mastercard-Gateway/gateway-woocommerce-module/releases
You can obtain the module by downloading a release from: /~https://github.com/fingent-corp/gateway-woocommerce-mastercard-module/releases
## Installation of Module
To use WooCommerce MPGS for WordPress, you need to install both the MasterCard Payment Gateway Services module and the WooCommerce module.
### Steps to install WooCommerce for WordPress:
Expand All @@ -95,7 +83,7 @@ Follow the below steps:
### Steps to install MasterCard Payment Gateway Services for WordPress
Follow the below steps:
1. There are two ways to install the plugin into WordPress, either:
1.1 Download the gateway-woocommerce-module plugin zip file from /~https://github.com/Mastercard-Gateway/gateway-woocommerce-module/releases and extract to the /wp-content/plugins/ directory,
1.1 Download the gateway-woocommerce-module plugin zip file from /~https://github.com/fingent-corp/gateway-woocommerce-mastercard-module/releases and extract to the /wp-content/plugins/ directory,
**or**
1.2. Connect to Backoffice of your shop with the available admin credentials and install the plugin through the WordPress plugins screen directly.
Goto: Admin => Plugins => Installed Plugins => Click on 'Add New' => Then in the Top click on "Upload Plugin" button.
Expand Down
10 changes: 9 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
== Mastercard Payment Gateway Services Changelog ==

2024-10-08 - version 1.4.7

* Add - Introduced a new 'Merchant Information' section in the plugin settings for admins to easily update merchant information.
* Add - Eliminated the intermediate page in the 'Redirect to Payment Page' process for Hosted Checkout.
* Enhancement - Compatibility with WooCommerce 9.3.
* Update - Updated the API version to 84.
* Fix - Resolved an issue where line items were not correctly transmitted to the payment gateway.

2024-08-30 - version 1.4.6

* Add - Implemented the ability to process void transactions.
Expand Down Expand Up @@ -68,4 +76,4 @@
* Feature - Partial refunds
* Feature - AVS
* Feature - 3DS1
* Feature - Tokenisation
* Feature - Tokenisation
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.4.6",
"version": "1.4.7",
"type": "woocommerce-plugin",
"require": {
"php-http/curl-client": "^2.3",
Expand Down
86 changes: 72 additions & 14 deletions includes/assets/js/mastercard-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ jQuery(function ($) {
init: function () {
var sandbox_username = $('#woocommerce_mpgs_gateway_sandbox_username').parents('tr').eq(0),
sandbox_password = $('#woocommerce_mpgs_gateway_sandbox_password').parents('tr').eq(0),
username = $('#woocommerce_mpgs_gateway_username').parents('tr').eq(0),
password = $('#woocommerce_mpgs_gateway_password').parents('tr').eq(0),
threedsecure = $('#woocommerce_mpgs_gateway_threedsecure').parents('tr').eq(0),
gateway_url = $('#woocommerce_mpgs_gateway_custom_gateway_url').parents('tr').eq(0),
hc_interaction = $('#woocommerce_mpgs_gateway_hc_interaction').parents('tr').eq(0),
hc_type = $('#woocommerce_mpgs_gateway_hc_type').parents('tr').eq(0),
saved_cards = $('#woocommerce_mpgs_gateway_saved_cards').parents('tr').eq(0);
username = $('#woocommerce_mpgs_gateway_username').parents('tr').eq(0),
password = $('#woocommerce_mpgs_gateway_password').parents('tr').eq(0),
threedsecure = $('#woocommerce_mpgs_gateway_threedsecure').parents('tr').eq(0),
gateway_url = $('#woocommerce_mpgs_gateway_custom_gateway_url').parents('tr').eq(0),
hc_interaction = $('#woocommerce_mpgs_gateway_hc_interaction').parents('tr').eq(0),
hc_type = $('#woocommerce_mpgs_gateway_hc_type').parents('tr').eq(0),
saved_cards = $('#woocommerce_mpgs_gateway_saved_cards').parents('tr').eq(0),
merchant_info = $('#woocommerce_mpgs_gateway_merchant_info');

$('#woocommerce_mpgs_gateway_sandbox').on('change', function () {
if ($(this).is(':checked')) {
Expand Down Expand Up @@ -66,29 +67,53 @@ jQuery(function ($) {
}
}).change();

$('#woocommerce_mpgs_gateway_method').on('change', function () {
if ($(this).val() === 'hosted-checkout' && $('#woocommerce_mpgs_gateway_hc_interaction').val() === 'redirect') {
merchant_info.show();
merchant_info.next().show();
merchant_info.next().next().show();
} else {
merchant_info.hide();
merchant_info.next().hide();
merchant_info.next().next().hide();
}
}).change();

$('#woocommerce_mpgs_gateway_hc_interaction').on('change', function () {
if ($(this).val() === 'redirect') {
merchant_info.show();
merchant_info.next().show();
merchant_info.next().next().show();
} else {
merchant_info.hide();
merchant_info.next().hide();
merchant_info.next().next().hide();
}
}).change();

$( '#woocommerce_mpgs_gateway_handling_fee_amount' ).before( '<span id="handling_fee_amount_label"></span>' );
$( '#handling_fee_amount_label' ).css({ "width": "35px", "height": "31px", "line-height": "30px", "background-color": "#eaeaea", "text-align": "center", "position": "absolute", "left": "1px", "top": "1px", "border-radius": "3px 0 0 3px" }).parent().css( "position", "relative" );
$( '#woocommerce_mpgs_gateway_handling_fee_amount' ).css( "padding-left", "45px" );
if( $( '#woocommerce_mpgs_gateway_hf_amount_type' ).val() == 'fixed' ) {
if( $( '#woocommerce_mpgs_gateway_hf_amount_type' ).val() === 'fixed' ) {
$( '#handling_fee_amount_label' ).html( wcSettings.currency.symbol );
} else {
$( '#handling_fee_amount_label' ).html( '%' );
}

$('#woocommerce_mpgs_gateway_hf_amount_type').on('change', function () {
if( $( this ).val() == 'fixed' ) {
if( $( this ).val() === 'fixed' ) {
$( '#handling_fee_amount_label' ).html( wcSettings.currency.symbol );
} else {
$( '#handling_fee_amount_label' ).html( '%' );
}
}).change();
$( '#woocommerce_mpgs_gateway_handling_fee_amount' ).on( 'keypress', function(e) {
var charCode = ( e.which ) ? e.which : e.keyCode;
if ( charCode == 46 || charCode == 8 || charCode == 9 || charCode == 27 || charCode == 13 ||
( charCode == 65 && ( e.ctrlKey === true || e.metaKey === true ) ) ||
( charCode == 67 && ( e.ctrlKey === true || e.metaKey === true ) ) ||
( charCode == 86 && ( e.ctrlKey === true || e.metaKey === true ) ) ||
( charCode == 88 && ( e.ctrlKey === true || e.metaKey === true ) ) ||
if ( charCode === 46 || charCode === 8 || charCode === 9 || charCode === 27 || charCode === 13 ||
( charCode === 65 && ( e.ctrlKey === true || e.metaKey === true ) ) ||
( charCode === 67 && ( e.ctrlKey === true || e.metaKey === true ) ) ||
( charCode === 86 && ( e.ctrlKey === true || e.metaKey === true ) ) ||
( charCode === 88 && ( e.ctrlKey === true || e.metaKey === true ) ) ||
// Allow: home, end, left, right
( charCode >= 35 && charCode <= 39 ) ) {
return;
Expand All @@ -108,6 +133,39 @@ jQuery(function ($) {
this.value = value.substring( 0, value.length - 1 );
}
});

$( '#woocommerce_mpgs_gateway_merchant_logo' ).after( '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="mpgs_gateway_merchant_logo" class="button">Upload</a>' );

var customUploader = '';
$( '#mpgs_gateway_merchant_logo' ).on( 'click', function(e) {
e.preventDefault();
if ( customUploader) {
customUploader.open();
return;
}
customUploader = wp.media.frames.file_frame = wp.media({
title: 'Upload logo',
button: {
text: 'Choose logo'
},
multiple: false,
library: {
type: [ 'image/jpeg', 'image/png', 'image/svg+xml' ]
},
});
customUploader.on('select', function() {
var attachment = customUploader.state().get('selection').first().toJSON();
var previousElement = e.target.previousElementSibling;

if( previousElement ) {
$( previousElement ).val( attachment.url );
if( $( previousElement ).parents( '#mainform' ).find( '.woocommerce-save-button' ).attr( 'disabled' ) === 'disabled' ) {
$( previousElement ).parents( '#mainform' ).find( '.woocommerce-save-button' ).removeAttr( 'disabled' );
}
}
});
customUploader.open();
});
}
};
wc_mastercard_admin.init();
Expand Down
Loading