@malga-checkout/core
Version:
Core components for Malga Checkout
17 lines (16 loc) • 730 B
JavaScript
import { BaseProvider } from '../base-provider';
import settings from '../../stores/settings';
import { getItems, normalizeBoletoFees } from './boleto.utils';
export class Boleto extends BaseProvider {
constructor({ boleto }) {
super({
customer: settings.transactionConfig.customer,
customerId: settings.transactionConfig.customerId,
});
this.boleto = boleto;
}
getPaymentMethod() {
const items = getItems(this.boleto);
return Object.assign(Object.assign(Object.assign({ paymentType: 'boleto', expiresDate: this.boleto.expiresDate, instructions: this.boleto.instructions }, normalizeBoletoFees('interest', this.boleto.interest)), normalizeBoletoFees('fine', this.boleto.fine)), items);
}
}