2021-01-13 22:20:30 +03:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2020-03-04 20:05:54 +03:00
|
|
|
|
2021-12-03 11:44:16 +03:00
|
|
|
export const paymentOperations: INodeProperties[] = [
|
2020-03-04 20:05:54 +03:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-21 00:47:24 +03:00
|
|
|
noDataExpression: true,
|
2020-03-04 20:05:54 +03:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a new payment',
|
2022-07-10 23:50:51 +03:00
|
|
|
action: 'Create a payment',
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
2020-03-17 01:26:27 +03:00
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete a payment',
|
2022-07-10 23:50:51 +03:00
|
|
|
action: 'Delete a payment',
|
2020-03-17 01:26:27 +03:00
|
|
|
},
|
2020-03-04 20:05:54 +03:00
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get data of a payment',
|
2022-07-10 23:50:51 +03:00
|
|
|
action: 'Get a payment',
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get data of all payments',
|
2022-07-10 23:50:51 +03:00
|
|
|
action: 'Get all payments',
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 11:44:16 +03:00
|
|
|
];
|
2020-03-04 20:05:54 +03:00
|
|
|
|
2021-12-03 11:44:16 +03:00
|
|
|
export const paymentFields: INodeProperties[] = [
|
2020-03-04 20:05:54 +03:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* payment:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
displayName: 'Invoice Name or ID',
|
2020-03-04 20:05:54 +03:00
|
|
|
name: 'invoice',
|
|
|
|
type: 'options',
|
2022-07-14 23:05:11 +03:00
|
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-03-04 20:05:54 +03:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getInvoices',
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Amount',
|
|
|
|
name: 'amount',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 0,
|
|
|
|
},
|
|
|
|
default: 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Payment Type',
|
|
|
|
name: 'paymentType',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
2022-06-03 20:23:49 +03:00
|
|
|
{
|
|
|
|
name: 'ACH',
|
|
|
|
value: 5,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Alipay',
|
|
|
|
value: 28,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'American Express',
|
|
|
|
value: 8,
|
|
|
|
},
|
2020-03-04 20:05:54 +03:00
|
|
|
{
|
|
|
|
name: 'Apply Credit',
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Bank Transfer',
|
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Bitcoin',
|
|
|
|
value: 32,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Carte Blanche',
|
|
|
|
value: 17,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Cash',
|
|
|
|
value: 3,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Check',
|
|
|
|
value: 16,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Credit Card Other',
|
|
|
|
value: 13,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Debit',
|
|
|
|
value: 4,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Diners Card',
|
|
|
|
value: 10,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Discover Card',
|
|
|
|
value: 9,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'EuroCard',
|
|
|
|
value: 11,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'GoCardless',
|
|
|
|
value: 31,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Google Wallet',
|
|
|
|
value: 15,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'iZettle',
|
|
|
|
value: 24,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'JCB',
|
|
|
|
value: 19,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Laser',
|
|
|
|
value: 20,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Maestro',
|
|
|
|
value: 21,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'MasterCard',
|
|
|
|
value: 7,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Money Order',
|
|
|
|
value: 27,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Nova',
|
|
|
|
value: 12,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Paypal',
|
|
|
|
value: 14,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'SEPA',
|
|
|
|
value: 30,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Sofort',
|
|
|
|
value: 29,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Solo',
|
|
|
|
value: 22,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Swich',
|
|
|
|
value: 23,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Swish',
|
|
|
|
value: 25,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'UnionPay',
|
|
|
|
value: 18,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 20:23:49 +03:00
|
|
|
name: 'Venmo',
|
|
|
|
value: 26,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Visa Card',
|
|
|
|
value: 6,
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Transfer Reference',
|
|
|
|
name: 'transferReference',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Private Notes',
|
|
|
|
name: 'privateNotes',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* payment:delete */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Payment ID',
|
|
|
|
name: 'paymentId',
|
|
|
|
type: 'string',
|
2021-12-03 11:44:16 +03:00
|
|
|
default: '',
|
2020-03-04 20:05:54 +03:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* payment:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Payment ID',
|
|
|
|
name: 'paymentId',
|
|
|
|
type: 'string',
|
2021-12-03 11:44:16 +03:00
|
|
|
default: '',
|
2020-03-04 20:05:54 +03:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Options',
|
|
|
|
name: 'options',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include',
|
|
|
|
name: 'include',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Client',
|
|
|
|
value: 'client',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'client',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* payment:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-07 00:01:25 +03:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 60,
|
|
|
|
},
|
|
|
|
default: 50,
|
2022-05-07 00:01:25 +03:00
|
|
|
description: 'Max number of results to return',
|
2020-03-04 20:05:54 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Options',
|
|
|
|
name: 'options',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'payment',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include',
|
|
|
|
name: 'include',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Client',
|
|
|
|
value: 'client',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'client',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2021-12-03 11:44:16 +03:00
|
|
|
];
|