2020-08-25 01:50:39 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const paymentOperations : INodeProperties [ ] = [
2020-08-25 01:50:39 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-08-25 01:50:39 -07:00
displayOptions : {
show : {
resource : [
'payment' ,
] ,
} ,
} ,
options : [
{
name : 'Get All' ,
value : 'getAll' ,
2022-05-06 14:01:25 -07:00
description : 'Get all payment' ,
2022-07-10 13:50:51 -07:00
action : 'Get all payments' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'Reschedule' ,
value : 'reschedule' ,
2022-05-06 14:01:25 -07:00
description : 'Reschedule payment' ,
2022-07-10 13:50:51 -07:00
action : 'Reschedule a payment' ,
2020-10-22 06:46:03 -07:00
} ,
2020-08-25 01:50:39 -07:00
] ,
default : 'getAll' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-08-25 01:50:39 -07:00
2021-12-03 00:44:16 -08:00
export const paymentFields : INodeProperties [ ] = [
2020-08-25 01:51:16 -07:00
/* -------------------------------------------------------------------------- */
/* payment:getAll */
/* -------------------------------------------------------------------------- */
2020-08-25 01:50:39 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
operation : [
'getAll' ,
] ,
resource : [
'payment' ,
] ,
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
operation : [
'getAll' ,
] ,
resource : [
'payment' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 500 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'JSON Parameters' ,
name : 'jsonParameters' ,
type : 'boolean' ,
default : false ,
displayOptions : {
show : {
resource : [
'payment' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
} ,
{
2020-08-25 01:51:16 -07:00
displayName : 'Additional Fields' ,
2020-08-25 01:50:39 -07:00
name : 'additionalFieldsJson' ,
type : 'json' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'payment' ,
] ,
operation : [
'getAll' ,
] ,
jsonParameters : [
true ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Attributes in JSON form' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
displayOptions : {
show : {
resource : [
'payment' ,
] ,
operation : [
'getAll' ,
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
false ,
] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Date From' ,
name : 'from' ,
type : 'dateTime' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'Payment starting from date' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Date To' ,
name : 'to' ,
type : 'dateTime' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'Payment up until date' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Is Paid' ,
name : 'isPaid' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether payment is paid' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Plan ID' ,
name : 'plan' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Filter: The product/plan ID (single or comma-separated values)' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Subscription ID' ,
name : 'subscriptionId' ,
type : 'number' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'A specific user subscription ID' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'State' ,
name : 'state' ,
type : 'options' ,
default : 'active' ,
description : 'Filter: The user subscription status. Returns all active, past_due, trialing and paused subscription plans if not specified.' ,
options : [
{
name : 'Active' ,
2020-10-22 06:46:03 -07:00
value : 'active' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'Past Due' ,
2020-10-22 06:46:03 -07:00
value : 'past_due' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'Paused' ,
2020-10-22 06:46:03 -07:00
value : 'paused' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'Trialing' ,
2020-10-22 06:46:03 -07:00
value : 'trialing' ,
2020-08-25 01:50:39 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-08-25 01:50:39 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'One Off Charge' ,
2020-08-25 01:50:39 -07:00
name : 'isOneOffCharge' ,
type : 'boolean' ,
default : false ,
} ,
] ,
} ,
2020-08-25 01:51:16 -07:00
/* -------------------------------------------------------------------------- */
/* payment:reschedule */
/* -------------------------------------------------------------------------- */
2020-08-25 01:50:39 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Payment Name or ID' ,
2020-08-25 01:50:39 -07:00
name : 'paymentId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getpayment' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'payment' ,
] ,
operation : [
'reschedule' ,
] ,
} ,
} ,
2022-07-14 13:05:11 -07:00
description : 'The upcoming subscription payment ID. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Date' ,
name : 'date' ,
type : 'dateTime' ,
default : '' ,
displayOptions : {
show : {
resource : [
'payment' ,
] ,
operation : [
'reschedule' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Date you want to move the payment to' ,
2020-08-25 01:50:39 -07:00
} ,
2021-12-03 00:44:16 -08:00
] ;