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

28 lines
978 B
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
import './style.scss';
class Controller extends Section {
confirm(transaction) {
const path = 'Clients/confirmTransaction';
let data = {id: transaction.id};
this.$http.post(path, data).then(res => {
this.$.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>`;
}
}
ngModule.vnComponent('vnClientWebPayment', {
template: require('./index.html'),
controller: Controller
});