mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
feat: Control the payment method from invoice form
This commit is contained in:
@@ -260,8 +260,8 @@ export default class SaleInvoicesController extends BaseController {
|
||||
check('pdf_template_id').optional({ nullable: true }).isNumeric().toInt(),
|
||||
|
||||
// Payment methods.
|
||||
check('payment_methods').optional({ nullable: true }).isArray({ min: 1 }),
|
||||
check('payment_methods.*.payment_integration_id').exists(),
|
||||
check('payment_methods').optional({ nullable: true }).isArray(),
|
||||
check('payment_methods.*.payment_integration_id').exists().toInt(),
|
||||
check('payment_methods.*.enable').exists().isBoolean(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export class GetPaymentServicesSpecificInvoice {
|
||||
const { PaymentIntegration } = this.tenancy.models(tenantId);
|
||||
|
||||
const paymentGateways = await PaymentIntegration.query()
|
||||
.where('enable', true)
|
||||
.where('active', true)
|
||||
.orderBy('name', 'ASC');
|
||||
|
||||
return this.transform.transform(
|
||||
|
||||
@@ -8,4 +8,12 @@ export class GetPaymentServicesSpecificInvoiceTransformer extends Transformer {
|
||||
public excludeAttributes = (): string[] => {
|
||||
return ['accountId'];
|
||||
};
|
||||
|
||||
public includeAttributes = (): string[] => {
|
||||
return ['serviceFormatted'];
|
||||
};
|
||||
|
||||
public serviceFormatted(method) {
|
||||
return 'Stripe';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user