/** * Copyright (c) 2020 The Nuinalp Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ import { Model } from '@nuinalp/api-core/browser'; import Customer from './customers'; import Invoices from './invoices'; import Subscriptions from './subscriptions'; import { IPayLinkProcess } from '../types'; import Payments from './payments'; export default class PaymentLinks extends Model { protected static adapter: any; id: string; display_confirmation_page?: boolean; name: string; amount: number; redirect_url?: string; custom_message?: string; id_customer: string; metadata: Record; payment_methods: Array<'boleto' | 'pix' | 'credit_card' | 'debit_card' | 'ask_customer'>; type: 'one_time' | 'subscription'; due_date: string; subscription: Subscriptions; one_time_items: { id: string; name: string; amount: number; quantity: number; }[]; invoice: Invoices; checkout_url: string; customer: Customer; postback_url?: string; status: 'active' | 'disabled'; merchant: { name: string; legal_name: string; public_key: string; avatar?: string; brand?: string; }; created_at: Date; updated_at: Date; deleted_at: Date; /** * Get public info of a Payment link to show in checkout page * @param {String} id - The Payment link ID * @returns */ static getPublicInfo(id: string): Promise; static process(id: string, body: IPayLinkProcess): Promise; }