Skip to content

Commit

Permalink
Payment Method Condition Update
Browse files Browse the repository at this point in the history
  • Loading branch information
DependraSethiya committed Mar 20, 2023
1 parent b3ae375 commit 63ef463
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,11 @@ function returnToForm(cart, params) {
Object.keys(currentPaymentMethod).forEach(function (paymentMethodKey) {
var method = {};
var object = currentPaymentMethod[paymentMethodKey];
method.ID = object.id;
method.subTypes = object.subTypes;
method.displayName = object.displayValue[locale];
method.enabled = object.enabled;
if (method.enabled !== undefined && method.enabled === true && method.ID !== 'credit_card') {
allPaymentMethod.push(method);
} else if (method.enabled !== undefined && method.enabled === true && method.ID === 'credit_card' && object.currency === currency) {
if (object.enabled !== undefined && object.enabled === true && object.currency === currency) {
method.ID = object.id;
method.subTypes = object.subTypes;
method.displayName = object.displayValue[locale];
method.enabled = object.enabled;
allPaymentMethod.push(method);
}
});
Expand Down
12 changes: 6 additions & 6 deletions cartridges/int_komoju_sfra/cartridge/controllers/Checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ server.prepend(
Object.keys(currentPaymentMethod).forEach(function (paymentMethodKey) {
var method = {};
var object = currentPaymentMethod[paymentMethodKey];
method.ID = object.id;
method.subTypes = object.subTypes;
method.displayName = object.displayValue[locale];
method.enabled = object.enabled;
if (object.enabled !== undefined && object.enabled === true && object.id !== 'credit_card') {
if (object.enabled !== undefined && object.enabled === true && object.currency === currency) {
method.ID = object.id;
method.subTypes = object.subTypes;
method.displayName = object.displayValue[locale];
method.enabled = object.enabled;
allPaymentMethods.push(method);
} else if (object.enabled !== undefined && object.enabled === true && object.id === 'credit_card' && object.currency === currency) { allPaymentMethods.push(method); }
}
});
});
}
Expand Down

0 comments on commit 63ef463

Please sign in to comment.