@@ -164,6 +164,115 @@ export default {
164164 description : "Identifies a contact should be blocked due to destination VAT" ,
165165 optional : true ,
166166 } ,
167+ // Contact Payment propDefinitions
168+ transactionTypeId : {
169+ type : "string" ,
170+ label : "Transaction Type ID" ,
171+ description : "The transaction type of the payment" ,
172+ async options ( ) {
173+ const transactionTypes = await this . listTransactionTypes ( ) ;
174+ return transactionTypes . map ( ( transactionType ) => ( {
175+ label : transactionType . displayed_as ,
176+ value : transactionType . id ,
177+ } ) ) ;
178+ } ,
179+ } ,
180+ bankAccountId : {
181+ type : "string" ,
182+ label : "Bank Account ID" ,
183+ description : "The bank account of the payment" ,
184+ async options ( ) {
185+ const bankAccounts = await this . listBankAccounts ( ) ;
186+ return bankAccounts . map ( ( bankAccount ) => ( {
187+ label : bankAccount . displayed_as ,
188+ value : bankAccount . id ,
189+ } ) ) ;
190+ } ,
191+ } ,
192+ paymentMethodId : {
193+ type : "string" ,
194+ label : "Payment Method ID" ,
195+ description : "The ID of the Payment Method" ,
196+ async options ( ) {
197+ const paymentMethods = await this . listPaymentMethods ( ) ;
198+ return paymentMethods . map ( ( paymentMethod ) => ( {
199+ label : paymentMethod . displayed_as ,
200+ value : paymentMethod . id ,
201+ } ) ) ;
202+ } ,
203+ optional : true ,
204+ } ,
205+ taxRateId : {
206+ type : "string" ,
207+ label : "Tax Rate ID" ,
208+ description : "The ID of the Tax Rate" ,
209+ async options ( ) {
210+ const taxRates = await this . listTaxRates ( ) ;
211+ return taxRates . map ( ( taxRate ) => ( {
212+ label : taxRate . displayed_as ,
213+ value : taxRate . id ,
214+ } ) ) ;
215+ } ,
216+ optional : true ,
217+ } ,
218+ date : {
219+ type : "string" ,
220+ label : "Date" ,
221+ description : "The date the payment was made (YYYY-MM-DD format)" ,
222+ } ,
223+ totalAmount : {
224+ type : "string" ,
225+ label : "Total Amount" ,
226+ description : "The total amount of the payment" ,
227+ } ,
228+ netAmount : {
229+ type : "string" ,
230+ label : "Net Amount" ,
231+ description : "The net amount of the payment" ,
232+ optional : true ,
233+ } ,
234+ taxAmount : {
235+ type : "string" ,
236+ label : "Tax Amount" ,
237+ description : "The tax amount of the payment" ,
238+ optional : true ,
239+ } ,
240+ exchangeRate : {
241+ type : "string" ,
242+ label : "Exchange Rate" ,
243+ description : "The exchange rate of the payment" ,
244+ optional : true ,
245+ } ,
246+ baseCurrencyNetAmount : {
247+ type : "string" ,
248+ label : "Base Currency Net Amount" ,
249+ description : "The net amount of the payment in base currency" ,
250+ optional : true ,
251+ } ,
252+ baseCurrencyTaxAmount : {
253+ type : "string" ,
254+ label : "Base Currency Tax Amount" ,
255+ description : "The tax amount of the payment in base currency" ,
256+ optional : true ,
257+ } ,
258+ baseCurrencyTotalAmount : {
259+ type : "string" ,
260+ label : "Base Currency Total Amount" ,
261+ description : "The total amount of the payment in base currency" ,
262+ optional : true ,
263+ } ,
264+ baseCurrencyCurrencyCharge : {
265+ type : "string" ,
266+ label : "Base Currency Currency Charge" ,
267+ description : "The currency conversion charges in base currency" ,
268+ optional : true ,
269+ } ,
270+ paymentReference : {
271+ type : "string" ,
272+ label : "Payment Reference" ,
273+ description : "A reference for the payment" ,
274+ optional : true ,
275+ } ,
167276 } ,
168277 methods : {
169278 // this.$auth contains connected account data
@@ -245,5 +354,41 @@ export default {
245354 ...opts ,
246355 } ) ;
247356 } ,
357+ // Contact Payment API methods
358+ async listTransactionTypes ( opts = { } ) {
359+ const response = await this . _makeRequest ( {
360+ path : "/transaction_types" ,
361+ ...opts ,
362+ } ) ;
363+ return response . $items || response . items || [ ] ;
364+ } ,
365+ async listBankAccounts ( opts = { } ) {
366+ const response = await this . _makeRequest ( {
367+ path : "/bank_accounts" ,
368+ ...opts ,
369+ } ) ;
370+ return response . $items || response . items || [ ] ;
371+ } ,
372+ async listPaymentMethods ( opts = { } ) {
373+ const response = await this . _makeRequest ( {
374+ path : "/payment_methods" ,
375+ ...opts ,
376+ } ) ;
377+ return response . $items || response . items || [ ] ;
378+ } ,
379+ async listTaxRates ( opts = { } ) {
380+ const response = await this . _makeRequest ( {
381+ path : "/tax_rates" ,
382+ ...opts ,
383+ } ) ;
384+ return response . $items || response . items || [ ] ;
385+ } ,
386+ async createContactPayment ( opts = { } ) {
387+ return this . _makeRequest ( {
388+ method : "POST" ,
389+ path : "/contact_payments" ,
390+ ...opts ,
391+ } ) ;
392+ } ,
248393 } ,
249394} ;
0 commit comments