import ngModule from '../module'; import './style.scss'; class Controller { constructor($scope, $http, $stateParams) { this.$scope = $scope; this.$http = $http; this.$stateParams = $stateParams; } confirm(transaction) { const path = '/client/api/Clients/confirmTransaction'; 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 ? '
' : ''; const responseMessage = transaction.responseMessage ? transaction.responseMessage : ''; return `${errorMessage}` + separator + `${responseMessage}`; } } Controller.$inject = ['$scope', '$http', '$stateParams']; ngModule.component('vnClientWebPayment', { template: require('./index.html'), controller: Controller });