diff --git a/README.md b/README.md
index 1d73500..871e7f1 100755
--- a/README.md
+++ b/README.md
@@ -3,9 +3,9 @@
* **Description:** Cybersource, a Visa solution, is the only global, modular payment management platform built on secure Visa infrastructure with the payment reach and fraud insights of a massive $500B+ global processing network. You can find out more about what Cybersource does [here](https://www.cybersource.com/en-gb.html)
* **Categories:** Payment Processing, Fraud Detection, Address Validation, Tax Computation
-* **Version:** 24.2.1
-* **Last Certification Date:** May 2024
-* **Supports SFRA v6.3.0**
+* **Version:** 24.3.0
+* **Last Certification Date:** August 2024
+* **Supports SFRA v7.0**
* **JavaScript Controllers Friendly:** **YES**
### Contact ###
diff --git a/cartridges/int_cybs_sfra/cartridge/client/default/custom/js/flexMicroform.js b/cartridges/int_cybs_sfra/cartridge/client/default/custom/flexMicroform.js
similarity index 76%
rename from cartridges/int_cybs_sfra/cartridge/client/default/custom/js/flexMicroform.js
rename to cartridges/int_cybs_sfra/cartridge/client/default/custom/flexMicroform.js
index 2a57724..3fd6658 100644
--- a/cartridges/int_cybs_sfra/cartridge/client/default/custom/js/flexMicroform.js
+++ b/cartridges/int_cybs_sfra/cartridge/client/default/custom/flexMicroform.js
@@ -31,12 +31,28 @@ $(document).ready(function () {
var number = microform.createField('number');
var securityCode = microform.createField('securityCode');
securityCode.load('#securityCode-container');
+
number.load('#cardNumber-container');
number.on('change', function (data) {
+ if (data.couldBeValid) {
+ $('.card-number-wrapper .invalid-feedback').css('display', 'none');
+ }
var cardType = data.card[0].name;
$('.card-number-wrapper').attr('data-type', cardType);
$('#cardType').val(cardType);
});
+
+
+ $('#expirationMonth').on('change', function (event) {
+ $('#expirationMonthMissingMessage').css('display', 'none');
+ $('#expiredCardMessage').css('display', 'none');
+ })
+ $('#expirationYear').on('change', function (event) {
+ $('#expirationYearMissingMessage').css('display', 'none');
+ $('#expiredCardMessage').css('display', 'none');
+ })
+
+
/**
* *
* @param {*} token *
@@ -60,9 +76,6 @@ $(document).ready(function () {
var expMonth = $('#expirationMonth').val();
var expYear = $('#expirationYear').val();
- if (expMonth === '' || expYear === '') {
- return false;
- }
// Send in optional parameters from other parts of your payment form
var options = {
expirationMonth: expMonth.length === 1 ? '0' + expMonth : expMonth,
@@ -76,11 +89,21 @@ $(document).ready(function () {
microform.createToken(options, function (err, response) {
// At this point the token may be added to the form
// as hidden fields and the submission continued
+ let flag = false;
if (err) {
$('.card-number-wrapper .invalid-feedback').text(err.message).css('display', 'block');
+ flag = true;
+ }
+
+ if (!cardExpiryValidate()) {
+ flag = true;
+ }
+
+ if (flag == true) {
return true;
}
+
var decodedJwt = parseJwt(response);
document.getElementById('cardNumber').valid = true;
$('#flex-response').val(response);
@@ -128,6 +151,34 @@ $(document).ready(function () {
}
}
+ function cardExpiryValidate() {
+ var expMonth = $('#expirationMonth').val();
+ var expYear = $('#expirationYear').val();
+
+ if (expMonth == '' || expYear == '') {
+ if (expMonth == '') {
+ $('#expirationMonthMissingMessage').css('display', 'block');
+ }
+ if (expYear == '') {
+ $('#expirationYearMissingMessage').css('display', 'block');
+ }
+ return false;
+ }
+ else {
+ let currentDate = new Date();
+ let currentMonth = currentDate.getMonth() + 1;
+ let currentYear = currentDate.getFullYear();
+
+ // Check if the card is expired
+ if (expYear < currentYear || (expYear == currentYear && expMonth < currentMonth)) {
+ $('#expiredCardMessage').css('display', 'block');
+ return false;
+ }
+ }
+ return true;
+ }
+
+
$('.payment-summary .edit-button').on('click', function () {
$('#flex-response').val('');
});
diff --git a/cartridges/int_cybs_sfra/cartridge/client/default/js/checkout/checkout.js b/cartridges/int_cybs_sfra/cartridge/client/default/js/checkout/checkout.js
index bc988be..d084ef7 100644
--- a/cartridges/int_cybs_sfra/cartridge/client/default/js/checkout/checkout.js
+++ b/cartridges/int_cybs_sfra/cartridge/client/default/js/checkout/checkout.js
@@ -104,5 +104,19 @@ $('#checkout-main').on('click', '.next-step-button button', function (event) {
});
}
});
-
+$('#applePayPaymentOptionLink').on('click', function (event) {
+ $('#placeOrderButton').hide();
+});
+
+$('#gPaypaymentOptionLink').on('click', function (event) {
+ $('#placeOrderButton').hide();
+});
+
+$('#visaCheckoutPaymentOptionLink').on('click', function (event) {
+ $('#placeOrderButton').hide();
+});
+
+$('#creditCardPaymentOptionLink').on('click', function (event) {
+ $('#placeOrderButton').show();
+});
module.exports = base;
diff --git a/cartridges/int_cybs_sfra/cartridge/templates/default/account/payment/paymentForm.isml b/cartridges/int_cybs_sfra/cartridge/templates/default/account/payment/paymentForm.isml
index b230d50..5a15f16 100644
--- a/cartridges/int_cybs_sfra/cartridge/templates/default/account/payment/paymentForm.isml
+++ b/cartridges/int_cybs_sfra/cartridge/templates/default/account/payment/paymentForm.isml
@@ -3,7 +3,7 @@