2018-09-28 13:00:12 +00:00
|
|
|
import ngModule from '../module';
|
2018-12-10 14:34:48 +00:00
|
|
|
import './style.scss';
|
2018-09-28 13:00:12 +00:00
|
|
|
|
|
|
|
class Controller {
|
|
|
|
constructor($scope, $http, $stateParams) {
|
|
|
|
this.$scope = $scope;
|
|
|
|
this.$http = $http;
|
|
|
|
this.$stateParams = $stateParams;
|
|
|
|
}
|
|
|
|
|
|
|
|
confirm(transaction) {
|
2019-10-24 22:53:53 +00:00
|
|
|
const path = 'Clients/confirmTransaction';
|
2018-09-28 13:00:12 +00:00
|
|
|
let data = {id: transaction.id};
|
|
|
|
this.$http.post(path, data).then(res => {
|
|
|
|
this.$scope.model.refresh();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
getFormattedMessage(transaction) {
|
|
|
|
const errorMessage = transaction.errorMessage ? transaction.errorMessage : '';
|
|
|
|
const separator = transaction.errorMessage && transaction.responseMessage ? '<br/>' : '';
|
|
|
|
const responseMessage = transaction.responseMessage ? transaction.responseMessage : '';
|
|
|
|
return `<strong style="font-size:13px">${errorMessage}</strong>`
|
|
|
|
+ separator
|
|
|
|
+ `<span style="font-size:13px">${responseMessage}</span>`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Controller.$inject = ['$scope', '$http', '$stateParams'];
|
|
|
|
|
|
|
|
ngModule.component('vnClientWebPayment', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|