Skip to content

Commit

Permalink
Release 1.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
edgaraswallee committed Jan 18, 2023
1 parent f5e0d14 commit f2eb624
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 26 deletions.

This file was deleted.

4 changes: 4 additions & 0 deletions cartridges/int_wallee/cartridge/client/default/js/wallee.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jQuery(function ($) {
$('#dwfrm_billing div.form-nav.billing-nav.payment-information > ul > li > a').first().trigger('click');
$(".tab-pane.wallee-content").removeAttr("style");
});
$(window).on("load", function () {
$('#dwfrm_billing div.form-nav.billing-nav.payment-information > ul > li > a').first().trigger('click');
$(".tab-pane.wallee-content").removeAttr("style");
});
window.WalleeCheckout = this;
},
/**
Expand Down
2 changes: 2 additions & 0 deletions cartridges/int_wallee/cartridge/controllers/Order.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ server.get('WalleeFail', consentTracking.consent, server.middleware.https, csrfP
res.render('/error', {
message: Resource.msg('Payment failed. Please try another payment method', 'confirmation', null)
});
req.session.raw.custom.orderID = null;
req.session.raw.custom.WalleeTransactionId = null;
return next();
});
module.exports = server.exports();
9 changes: 7 additions & 2 deletions cartridges/int_wallee/cartridge/controllers/Wallee.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ server.post("TransactionUpdate", server.middleware.https, function (req, res, ne
var shippingAddress = server.forms.getForm("shipping");
var shippingFormErrors = COHelpers.validateShippingForm(shippingAddress.shippingAddress.addressFields);
var billingFormErrors = COHelpers.validateBillingForm(billingAddress.addressFields);
var transaction = null;
if ((Object.keys(shippingFormErrors).length < 1) && TransactionHelper.ajaxAddressValid(shippingAddress.shippingAddress.addressFields)) {
viewData.wallee = TransactionHelper.updateShippingAddress(shippingAddress.shippingAddress);
transaction = TransactionHelper.updateShippingAddress(shippingAddress.shippingAddress);
}
if ((Object.keys(billingFormErrors).length < 1) && TransactionHelper.ajaxAddressValid(billingAddress.addressFields)) {
viewData.wallee = TransactionHelper.updateBillingAddress(billingAddress);
transaction = TransactionHelper.updateBillingAddress(billingAddress);
}
if (transaction !== null) {
TransactionHelper.updateTransaction(transaction);
viewData.wallee = TransactionHelper.getPaymentVariableData(transaction);
}
res.json(viewData);
// @ts-ignore
Expand Down
5 changes: 5 additions & 0 deletions cartridges/int_wallee/cartridge/scripts/wallee/auth/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ var Auth = /** @class */ (function () {
}
resourcePath = "/api" + resourcePath;
var timestamp = Math.floor(+new Date / 1000);
var versionString = dw.system.System.getCompatibilityMode().toString();
var version = versionString.substr(0, 2) + "." + versionString.substr(2, 2);
return {
"x-meta-shop-system": "salesforce",
"x-meta-shop-system-version": version,
"x-meta-shop-system-and-version": "salesforce-" + version,
"x-mac-userid": this.config.userId,
"x-mac-version": this.config.macVersion,
"x-mac-timestamp": timestamp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ var Transaction = /** @class */ (function () {
if (this.isOldSession()) {
var transaction = this.getTransactionById(this.spaceId, session.custom.WalleeTransactionId);
transaction.billingAddress = address;
var transactionUpdate = this.TransactionService.update(this.spaceId, transaction);
return this.getPaymentVariableData(transactionUpdate);
return transaction;
}
return {
error: true,
Expand Down Expand Up @@ -244,8 +243,7 @@ var Transaction = /** @class */ (function () {
var transaction = this.getTransactionById(this.spaceId, session.custom.WalleeTransactionId);
transaction.shippingAddress = address;
transaction.billingAddress = address;
var transactionUpdate = this.TransactionService.update(this.spaceId, transaction);
return this.getPaymentVariableData(transactionUpdate);
return transaction;
}
return {
error: true,
Expand Down Expand Up @@ -312,14 +310,11 @@ var Transaction = /** @class */ (function () {
};
};
/**
* Get WebHook Listener
* TODO This should be called only once in a shop
* @return { Wallee.model.WebhookListener }
*
* @param { Wallee.model.Transaction } transaction
*/
Transaction.prototype.getWebHook = function () {
var WebHookHelper = new (require("~/cartridge/scripts/wallee/helpers/WebHook"));
WebHookHelper.getTransactionListener();
WebHookHelper.getRefundListener();
Transaction.prototype.updateTransaction = function (transaction) {
this.TransactionService.update(this.spaceId, transaction);
};
/**
* Get Wallee.model.Transaction by id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ var WalleeModule = {
UserAccountRole: require("./src/models/UserAccountRole"),
UserSpaceRole: require("./src/models/UserSpaceRole"),
UserType: require("./src/models/UserType"),
WalletType: require("./src/models/WalletType"),
WebAppConfirmationRequest: require("./src/models/WebAppConfirmationRequest"),
WebAppConfirmationResponse: require("./src/models/WebAppConfirmationResponse"),
WebhookIdentity: require("./src/models/WebhookIdentity"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ var ChargeAttempt = /** @class */ (function (_super) {
"name": "version",
"baseName": "version",
"type": "number"
},
{
"name": "walletType",
"baseName": "walletType",
"type": "WalletType"
}
];
return ChargeAttempt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@ var PaymentInitiationAdviceFile = /** @class */ (function () {
"baseName": "createdOn",
"type": "Date"
},
{
"name": "failureMessage",
"baseName": "failureMessage",
"type": "string"
},
{
"name": "fileGeneratedOn",
"baseName": "fileGeneratedOn",
"type": "Date"
},
{
"name": "forwardedOn",
"baseName": "forwardedOn",
"type": "Date"
},
{
"name": "id",
"baseName": "id",
Expand All @@ -38,6 +48,11 @@ var PaymentInitiationAdviceFile = /** @class */ (function () {
"baseName": "processedOn",
"type": "Date"
},
{
"name": "processor",
"baseName": "processor",
"type": "PaymentProcessor"
},
{
"name": "state",
"baseName": "state",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

var PaymentInitiationAdviceFileState;
(function (PaymentInitiationAdviceFileState) {
PaymentInitiationAdviceFileState["PENDING"] = "PENDING";
PaymentInitiationAdviceFileState["CREATING"] = "CREATING";
PaymentInitiationAdviceFileState["FAILED"] = "FAILED";
PaymentInitiationAdviceFileState["CREATED"] = "CREATED";
PaymentInitiationAdviceFileState["OVERDUE"] = "OVERDUE";
PaymentInitiationAdviceFileState["UPLOADED"] = "UPLOADED";
PaymentInitiationAdviceFileState["DOWNLOADED"] = "DOWNLOADED";
PaymentInitiationAdviceFileState["PROCESSED"] = "PROCESSED";
})(PaymentInitiationAdviceFileState = exports.PaymentInitiationAdviceFileState || (exports.PaymentInitiationAdviceFileState = {}));
module.exports = PaymentInitiationAdviceFileState;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";

var WalletType;
(function (WalletType) {
WalletType["APPLE_PAY"] = "APPLE_PAY";
})(WalletType = exports.WalletType || (exports.WalletType = {}));
module.exports = WalletType;
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ var User = require("../models/User");
var UserAccountRole = require("../models/UserAccountRole");
var UserSpaceRole = require("../models/UserSpaceRole");
var UserType = require("../models/UserType");
var WalletType = require("../models/WalletType");
var WebAppConfirmationRequest = require("../models/WebAppConfirmationRequest");
var WebAppConfirmationResponse = require("../models/WebAppConfirmationResponse");
var WebhookIdentity = require("../models/WebhookIdentity");
Expand Down Expand Up @@ -670,7 +671,8 @@ var ObjectSerializer = /** @class */ (function () {
"TransactionUserInterfaceType": TransactionUserInterfaceType,
"TransactionVoidMode": TransactionVoidMode,
"TransactionVoidState": TransactionVoidState,
"UserType": UserType
"UserType": UserType,
"WalletType": WalletType
};
ObjectSerializer.typeMap = {
"AbstractAccountUpdate": AbstractAccountUpdate,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"eslint-plugin-prettier": "^3.1.2",
"istanbul": "^0.4.5",
"mocha": "^10.0.0",
"node-sass": "^7.0.3",
"node-sass": "^8.0.0",
"postcss-loader": "^3.0.0",
"prettier": "1.19.1",
"proxyquire": "1.7.4",
Expand Down

0 comments on commit f2eb624

Please sign in to comment.