From cd7309282e021c8dca0f83c5a96a648b96397932 Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Tue, 29 Aug 2017 16:10:08 +0200 Subject: [PATCH] [enh] API: Make replacements in the cancel_url - fix #548 --- www/js/api/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/js/api/app.js b/www/js/api/app.js index 3dcfd370e..5cdf523a0 100644 --- a/www/js/api/app.js +++ b/www/js/api/app.js @@ -375,7 +375,6 @@ angular.module('cesium-api', ['ionic', 'ionic-material', 'ngMessages', 'pascalpr $scope.onCancel = function() { if (!$scope.transferData.cancel_url) { - // TODO: clean form ? $scope.formData.salt = undefined; $scope.formData.password = undefined; return; // nothing to do @@ -386,7 +385,12 @@ angular.module('cesium-api', ['ionic', 'ionic-material', 'ngMessages', 'pascalpr return UIUtils.loading.show({template: message}); }) .then(function() { - return $scope.redirectToUrl($scope.transferData.cancel_url, 1500); + var url = $scope.transferData.cancel_url; + // Make replacements - fix #548 + url = url.replace(/\{comment\}/g, $scope.transferData.comment||''); + url = url.replace(/\{amount\}/g, $scope.transferData.amount.toString()); + + return $scope.redirectToUrl(url, 1500); }); }; -- GitLab