salix/modules/client/front/web-payment/index.js

28 lines
976 B
JavaScript
Raw Normal View History

2018-09-28 13:00:12 +00:00
import ngModule from '../module';
2020-03-17 10:17:50 +00:00
import Section from 'salix/components/section';
import './style.scss';
2018-09-28 13:00:12 +00:00
2020-03-17 10:17:50 +00:00
class Controller extends Section {
2018-09-28 13:00:12 +00:00
confirm(transaction) {
const path = 'Clients/confirmTransaction';
2018-09-28 13:00:12 +00:00
let data = {id: transaction.id};
this.$http.post(path, data).then(res => {
2020-03-17 10:17:50 +00:00
this.$.model.refresh();
2018-09-28 13:00:12 +00:00
});
}
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>`;
}
}
ngModule.component('vnClientWebPayment', {
template: require('./index.html'),
controller: Controller
});