mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
🚧 Tests / changes
This commit is contained in:
parent
4a968ee8ea
commit
0b46f5d63a
|
@ -51,6 +51,9 @@ export const couponFields = [
|
||||||
],
|
],
|
||||||
operation: [
|
operation: [
|
||||||
`create`
|
`create`
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -82,6 +85,9 @@ export const couponFields = [
|
||||||
couponType: [
|
couponType: [
|
||||||
'product',
|
'product',
|
||||||
],
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -100,6 +106,9 @@ export const couponFields = [
|
||||||
operation: [
|
operation: [
|
||||||
`create`
|
`create`
|
||||||
],
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: 'flat',
|
default: 'flat',
|
||||||
|
@ -122,7 +131,7 @@ export const couponFields = [
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Discount amount in currency.',
|
description: 'Discount amount in currency.',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
minValue: 0
|
minValue: 1
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
@ -134,6 +143,9 @@ export const couponFields = [
|
||||||
],
|
],
|
||||||
discountType: [
|
discountType: [
|
||||||
'flat',
|
'flat',
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -145,7 +157,7 @@ export const couponFields = [
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Discount amount in percentage.',
|
description: 'Discount amount in percentage.',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
minValue: 0,
|
minValue: 1,
|
||||||
maxValue: 100
|
maxValue: 100
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -158,6 +170,9 @@ export const couponFields = [
|
||||||
],
|
],
|
||||||
discountType: [
|
discountType: [
|
||||||
'percentage',
|
'percentage',
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -166,20 +181,20 @@ export const couponFields = [
|
||||||
displayName: 'Currency',
|
displayName: 'Currency',
|
||||||
name: 'currency',
|
name: 'currency',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
default: 'eur',
|
default: 'EUR',
|
||||||
description: 'The currency must match the balance currency specified in your account.',
|
description: 'The currency must match the balance currency specified in your account.',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'EUR',
|
name: 'EUR',
|
||||||
value: 'eur'
|
value: 'EUR'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'GBP',
|
name: 'GBP',
|
||||||
value: 'gbp'
|
value: 'GBP'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'USD',
|
name: 'USD',
|
||||||
value: 'usd'
|
value: 'USD'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
|
@ -192,10 +207,53 @@ export const couponFields = [
|
||||||
],
|
],
|
||||||
discountType: [
|
discountType: [
|
||||||
'flat',
|
'flat',
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'JSON Parameters',
|
||||||
|
name: 'jsonParameters',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'coupon',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'create',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: ' Additional Fields',
|
||||||
|
name: 'additionalFieldsJson',
|
||||||
|
type: 'json',
|
||||||
|
typeOptions: {
|
||||||
|
alwaysOpenEditWindow: true,
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'coupon',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'create',
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: `Attributes in JSON form.`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Additional Fields',
|
displayName: 'Additional Fields',
|
||||||
name: 'additionalFields',
|
name: 'additionalFields',
|
||||||
|
@ -209,6 +267,9 @@ export const couponFields = [
|
||||||
operation: [
|
operation: [
|
||||||
'create',
|
'create',
|
||||||
],
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: {},
|
default: {},
|
||||||
|
@ -237,7 +298,7 @@ export const couponFields = [
|
||||||
{
|
{
|
||||||
displayName: 'Expires',
|
displayName: 'Expires',
|
||||||
name: 'expires',
|
name: 'expires',
|
||||||
type: 'DateTime',
|
type: 'dateTime',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The coupon will expire on the date at 00:00:00 UTC.',
|
description: 'The coupon will expire on the date at 00:00:00 UTC.',
|
||||||
},
|
},
|
||||||
|
@ -310,6 +371,9 @@ export const couponFields = [
|
||||||
operation: [
|
operation: [
|
||||||
`update`
|
`update`
|
||||||
],
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: 'couponCode',
|
default: 'couponCode',
|
||||||
|
@ -339,7 +403,10 @@ export const couponFields = [
|
||||||
],
|
],
|
||||||
updateBy: [
|
updateBy: [
|
||||||
'couponCode'
|
'couponCode'
|
||||||
]
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -359,12 +426,55 @@ export const couponFields = [
|
||||||
],
|
],
|
||||||
updateBy: [
|
updateBy: [
|
||||||
'group'
|
'group'
|
||||||
]
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The name of the group of coupons you want to update.',
|
description: 'The name of the group of coupons you want to update.',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'JSON Parameters',
|
||||||
|
name: 'jsonParameters',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'coupon',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'update',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: ' Additional Fields',
|
||||||
|
name: 'additionalFieldsJson',
|
||||||
|
type: 'json',
|
||||||
|
typeOptions: {
|
||||||
|
alwaysOpenEditWindow: true,
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'coupon',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'update',
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: `Attributes in JSON form.`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Additional Fields',
|
displayName: 'Additional Fields',
|
||||||
name: 'additionalFields',
|
name: 'additionalFields',
|
||||||
|
@ -378,6 +488,9 @@ export const couponFields = [
|
||||||
operation: [
|
operation: [
|
||||||
'update',
|
'update',
|
||||||
],
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: {},
|
default: {},
|
||||||
|
@ -393,20 +506,20 @@ export const couponFields = [
|
||||||
displayName: 'Currency',
|
displayName: 'Currency',
|
||||||
name: 'currency',
|
name: 'currency',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
default: 'eur',
|
default: 'EUR',
|
||||||
description: 'The currency must match the balance currency specified in your account.',
|
description: 'The currency must match the balance currency specified in your account.',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'EUR',
|
name: 'EUR',
|
||||||
value: 'eur'
|
value: 'EUR'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'GBP',
|
name: 'GBP',
|
||||||
value: 'gbp'
|
value: 'GBP'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'USD',
|
name: 'USD',
|
||||||
value: 'usd'
|
value: 'USD'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -423,7 +536,7 @@ export const couponFields = [
|
||||||
{
|
{
|
||||||
displayName: 'Expires',
|
displayName: 'Expires',
|
||||||
name: 'expires',
|
name: 'expires',
|
||||||
type: 'DateTime',
|
type: 'dateTime',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The coupon will expire on the date at 00:00:00 UTC.',
|
description: 'The coupon will expire on the date at 00:00:00 UTC.',
|
||||||
},
|
},
|
||||||
|
@ -450,7 +563,7 @@ export const couponFields = [
|
||||||
name: 'productIds',
|
name: 'productIds',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Comma-separated list of product IDs. Required if coupon_type is product.',
|
description: 'Comma-separated list of products e.g. 499531,1234,123546. If blank then remove associated products.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Recurring',
|
displayName: 'Recurring',
|
||||||
|
|
|
@ -22,18 +22,41 @@ export async function paddleApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||||
|
|
||||||
const options : OptionsWithUri = {
|
const options : OptionsWithUri = {
|
||||||
method,
|
method,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
uri: `https://vendors.paddle.com/api${endpoint}` ,
|
uri: `https://vendors.paddle.com/api${endpoint}` ,
|
||||||
body,
|
body,
|
||||||
json: true
|
json: true
|
||||||
};
|
};
|
||||||
|
|
||||||
body.vendor_id = credentials.vendorId;
|
body['vendor_id'] = credentials.vendorId;
|
||||||
body.vendor_auth_code = credentials.vendorAuthCode;
|
body['vendor_auth_code'] = credentials.vendorAuthCode;
|
||||||
|
|
||||||
|
console.log(options.body);
|
||||||
|
console.log(options);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await this.helpers.request!(options);
|
const response = await this.helpers.request!(options);
|
||||||
|
console.log(response);
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
throw new Error(`Code: ${response.error.code}. Message: ${response.error.message}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function validateJSON(json: string | undefined): any { // tslint:disable-line:no-any
|
||||||
|
let result;
|
||||||
|
try {
|
||||||
|
result = JSON.parse(json!);
|
||||||
|
} catch (exception) {
|
||||||
|
result = undefined;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
import { IExecuteFunctions } from 'n8n-core';
|
import { IExecuteFunctions } from 'n8n-core';
|
||||||
import {
|
import {
|
||||||
IDataObject,
|
IDataObject,
|
||||||
|
|
||||||
INodeExecutionData,
|
INodeExecutionData,
|
||||||
|
|
||||||
INodeType,
|
INodeType,
|
||||||
INodeTypeDescription
|
INodeTypeDescription
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
import { couponFields, couponOperations } from './CouponDescription';
|
import { couponFields, couponOperations } from './CouponDescription';
|
||||||
import { paddleApiRequest } from './GenericFunctions';
|
import { paddleApiRequest, validateJSON } from './GenericFunctions';
|
||||||
import { paymentFields, paymentOperations } from './PaymentDescription';
|
import { paymentsFields, paymentsOperations } from './PaymentDescription';
|
||||||
import { planFields, planOperations } from './PlanDescription';
|
import { planFields, planOperations } from './PlanDescription';
|
||||||
import { productFields, productOperations } from './ProductDescription';
|
import { productFields, productOperations } from './ProductDescription';
|
||||||
import { userFields, userOperations } from './UserDescription';
|
import { userFields, userOperations } from './UserDescription';
|
||||||
|
|
||||||
import moment = require('moment');
|
import moment = require('moment');
|
||||||
import { response } from 'express';
|
import { orderOperations, orderFields } from './OrderDescription';
|
||||||
|
|
||||||
export class Paddle implements INodeType {
|
export class Paddle implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
|
@ -72,23 +71,24 @@ export class Paddle implements INodeType {
|
||||||
default: 'coupon',
|
default: 'coupon',
|
||||||
description: 'Resource to consume.',
|
description: 'Resource to consume.',
|
||||||
},
|
},
|
||||||
|
|
||||||
// COUPON
|
// COUPON
|
||||||
couponFields,
|
...couponOperations,
|
||||||
couponOperations,
|
...couponFields,
|
||||||
// PAYMENT
|
// PAYMENT
|
||||||
paymentFields,
|
...paymentsOperations,
|
||||||
paymentOperations,
|
...paymentsFields,
|
||||||
// PLAN
|
// PLAN
|
||||||
planFields,
|
...planOperations,
|
||||||
planOperations,
|
...planFields,
|
||||||
// PRODUCT
|
// PRODUCT
|
||||||
productFields,
|
...productOperations,
|
||||||
productOperations,
|
...productFields,
|
||||||
|
// ORDER
|
||||||
|
...orderOperations,
|
||||||
|
...orderFields,
|
||||||
// USER
|
// USER
|
||||||
userFields,
|
...userOperations,
|
||||||
userOperations
|
...userFields
|
||||||
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -103,12 +103,31 @@ export class Paddle implements INodeType {
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
if (resource === 'coupon') {
|
if (resource === 'coupon') {
|
||||||
if (operation === 'create') {
|
if (operation === 'create') {
|
||||||
const productIds = this.getNodeParameter('productIds', i) as string;
|
const jsonParameters = this.getNodeParameter('jsonParameters', i) as boolean;
|
||||||
|
|
||||||
|
if (jsonParameters) {
|
||||||
|
const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i) as string;
|
||||||
|
|
||||||
|
if (additionalFieldsJson !== '') {
|
||||||
|
if (validateJSON(additionalFieldsJson) !== undefined) {
|
||||||
|
Object.assign(body, JSON.parse(additionalFieldsJson));
|
||||||
|
} else {
|
||||||
|
throw new Error('Additional fields must be a valid JSON');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
const discountType = this.getNodeParameter('discountType', i) as string;
|
const discountType = this.getNodeParameter('discountType', i) as string;
|
||||||
|
const couponType = this.getNodeParameter('couponType', i) as string;
|
||||||
const discountAmount = this.getNodeParameter('discountAmount', i) as number;
|
const discountAmount = this.getNodeParameter('discountAmount', i) as number;
|
||||||
const currency = this.getNodeParameter('currency', i) as string;
|
const currency = this.getNodeParameter('currency', i) as string;
|
||||||
|
|
||||||
body.product_ids = productIds;
|
if (couponType === 'product') {
|
||||||
|
body.product_ids = this.getNodeParameter('productIds', i) as string;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.coupon_type = couponType;
|
||||||
body.discount_type = discountType;
|
body.discount_type = discountType;
|
||||||
body.discount_amount = discountAmount;
|
body.discount_amount = discountAmount;
|
||||||
body.currency = currency;
|
body.currency = currency;
|
||||||
|
@ -125,18 +144,16 @@ export class Paddle implements INodeType {
|
||||||
body.coupon_prefix = additionalFields.couponPrefix as string;
|
body.coupon_prefix = additionalFields.couponPrefix as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.expires) {
|
if (additionalFields.expires) {
|
||||||
body.expires = moment(additionalFields.expires as Date).format('YYYY/MM/DD') as string;
|
body.expires = moment(additionalFields.expires as Date).format('YYYY-MM-DD') as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.group) {
|
if (additionalFields.group) {
|
||||||
body.group = additionalFields.group as string;
|
body.group = additionalFields.group as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.recurring) {
|
if (additionalFields.recurring) {
|
||||||
if (additionalFields.recurring === true) {
|
|
||||||
body.recurring = 1;
|
body.recurring = 1;
|
||||||
} else {
|
} else {
|
||||||
body.recurring = 0;
|
body.recurring = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (additionalFields.numberOfCoupons) {
|
if (additionalFields.numberOfCoupons) {
|
||||||
body.num_coupons = additionalFields.numberOfCoupons as number;
|
body.num_coupons = additionalFields.numberOfCoupons as number;
|
||||||
}
|
}
|
||||||
|
@ -146,19 +163,35 @@ export class Paddle implements INodeType {
|
||||||
|
|
||||||
const endpoint = '/2.1/product/create_coupon';
|
const endpoint = '/2.1/product/create_coupon';
|
||||||
|
|
||||||
responseData = paddleApiRequest.call(this, endpoint, 'POST', body);
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (operation === 'getAll') {
|
if (operation === 'getAll') {
|
||||||
const productIds = this.getNodeParameter('productId', i) as string;
|
const productIds = this.getNodeParameter('productId', i) as string;
|
||||||
const endpoint = '/2.0/product/list_coupons';
|
const endpoint = '/2.0/product/list_coupons';
|
||||||
|
|
||||||
body.product_ids = productIds as string;
|
body.product_id = productIds as string;
|
||||||
|
|
||||||
responseData = paddleApiRequest.call(this, endpoint, 'POST', body);
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (operation === 'update') {
|
if (operation === 'update') {
|
||||||
|
|
||||||
|
const jsonParameters = this.getNodeParameter('jsonParameters', i) as boolean;
|
||||||
|
|
||||||
|
if (jsonParameters) {
|
||||||
|
const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i) as string;
|
||||||
|
|
||||||
|
if (additionalFieldsJson !== '') {
|
||||||
|
if (validateJSON(additionalFieldsJson) !== undefined) {
|
||||||
|
Object.assign(body, JSON.parse(additionalFieldsJson));
|
||||||
|
} else {
|
||||||
|
throw new Error('Additional fields must be a valid JSON');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
const updateBy = this.getNodeParameter('updateBy', i) as string;
|
const updateBy = this.getNodeParameter('updateBy', i) as string;
|
||||||
|
|
||||||
if (updateBy === 'group') {
|
if (updateBy === 'group') {
|
||||||
|
@ -179,116 +212,165 @@ export class Paddle implements INodeType {
|
||||||
body.new_coupon_code = additionalFields.newCouponCode as string;
|
body.new_coupon_code = additionalFields.newCouponCode as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.expires) {
|
if (additionalFields.expires) {
|
||||||
body.expires = moment(additionalFields.expires as Date).format('YYYY/MM/DD') as string;
|
body.expires = moment(additionalFields.expires as Date).format('YYYY-MM-DD') as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.newGroup) {
|
if (additionalFields.newGroup) {
|
||||||
body.new_group = additionalFields.newGroup as string;
|
body.new_group = additionalFields.newGroup as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.recurring) {
|
if (additionalFields.recurring) {
|
||||||
if (additionalFields.recurring === true) {
|
|
||||||
body.recurring = 1;
|
body.recurring = 1;
|
||||||
} else {
|
} else {
|
||||||
body.recurring = 0;
|
body.recurring = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (additionalFields.productIds) {
|
if (additionalFields.productIds) {
|
||||||
body.product_ids = additionalFields.productIds as number;
|
body.product_ids = additionalFields.productIds as number;
|
||||||
}
|
}
|
||||||
if (additionalFields.discountAmount) {
|
if (additionalFields.discountAmount) {
|
||||||
body.discount_amount = additionalFields.discountAmount as number;
|
body.discount_amount = additionalFields.discountAmount as number;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const endpoint = '/2.1/product/update_coupon';
|
const endpoint = '/2.1/product/update_coupon';
|
||||||
|
|
||||||
responseData = paddleApiRequest.call(this, endpoint, 'POST', body);
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (resource === 'payment') {
|
if (resource === 'payment') {
|
||||||
if (operation === 'getAll') {
|
if (operation === 'getAll') {
|
||||||
const subscriptionId = this.getNodeParameter('subscription', i) as string;
|
const jsonParameters = this.getNodeParameter('jsonParameters', i) as boolean;
|
||||||
const planId = this.getNodeParameter('planId', i) as string;
|
|
||||||
|
|
||||||
body.subscription_id = subscriptionId;
|
if (jsonParameters) {
|
||||||
body.plan_id = planId;
|
const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i) as string;
|
||||||
|
|
||||||
|
if (additionalFieldsJson !== '') {
|
||||||
|
if (validateJSON(additionalFieldsJson) !== undefined) {
|
||||||
|
Object.assign(body, JSON.parse(additionalFieldsJson));
|
||||||
|
} else {
|
||||||
|
throw new Error('Additional fields must be a valid JSON');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
|
|
||||||
|
if (additionalFields.subscriptionId) {
|
||||||
|
body.subscription_id = additionalFields.subscriptionId as number;
|
||||||
|
}
|
||||||
|
if (additionalFields.plan) {
|
||||||
|
body.plan = additionalFields.plan as string;
|
||||||
|
}
|
||||||
if (additionalFields.state) {
|
if (additionalFields.state) {
|
||||||
body.state = additionalFields.state as string;
|
body.state = additionalFields.state as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.isPaid) {
|
if (additionalFields.recurring) {
|
||||||
if (additionalFields.isPaid === true) {
|
body.recurring = 1;
|
||||||
body.is_paid = 0;
|
|
||||||
} else {
|
} else {
|
||||||
body.is_paid = 1;
|
body.recurring = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (additionalFields.from) {
|
if (additionalFields.from) {
|
||||||
body.from = moment(additionalFields.from as Date).format('YYYY/MM/DD') as string;
|
body.from = moment(additionalFields.from as Date).format('YYYY-MM-DD') as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.to) {
|
if (additionalFields.to) {
|
||||||
body.to = moment(additionalFields.to as Date).format('YYYY/MM/DD') as string;
|
body.to = moment(additionalFields.to as Date).format('YYYY-MM-DD') as string;
|
||||||
}
|
}
|
||||||
if (additionalFields.isOneOffCharge) {
|
if (additionalFields.isOneOffCharge) {
|
||||||
body.is_one_off_charge = additionalFields.isOneOffCharge as boolean;
|
body.is_one_off_charge = additionalFields.isOneOffCharge as boolean;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const endpoint = '/2.0/subscription/payments';
|
const endpoint = '/2.0/subscription/payments';
|
||||||
responseData = paddleApiRequest.call(this, endpoint, 'POST', body);
|
|
||||||
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
}
|
}
|
||||||
if (operation === 'reschedule') {
|
if (operation === 'reschedule') {
|
||||||
const paymentId = this.getNodeParameter('paymentId', i) as number;
|
const paymentId = this.getNodeParameter('paymentId', i) as number;
|
||||||
const date = this.getNodeParameter('date', i) as Date;
|
const date = this.getNodeParameter('date', i) as Date;
|
||||||
|
|
||||||
body.payment_id = paymentId;
|
body.payment_id = paymentId;
|
||||||
body.date = body.to = moment(date as Date).format('YYYY/MM/DD') as string;
|
body.date = body.to = moment(date as Date).format('YYYY-MM-DD') as string;
|
||||||
|
|
||||||
const endpoint = '/2.0/subscription/payments_reschedule';
|
const endpoint = '/2.0/subscription/payments_reschedule';
|
||||||
|
|
||||||
responseData = paddleApiRequest.call(this, endpoint, 'POST', body);
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (resource === 'plan') {
|
if (resource === 'plan') {
|
||||||
if (operation === 'getAll') {
|
if (operation === 'getAll') {
|
||||||
|
const endpoint = '/2.0/subscription/plans';
|
||||||
|
|
||||||
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
|
}
|
||||||
|
if (operation === 'get') {
|
||||||
const planId = this.getNodeParameter('planId', i) as string;
|
const planId = this.getNodeParameter('planId', i) as string;
|
||||||
|
|
||||||
body.plan = planId;
|
body.plan = planId;
|
||||||
|
|
||||||
const endpoint = '/2.0/subscription/plans';
|
const endpoint = '/2.0/subscription/plans';
|
||||||
|
|
||||||
responseData = paddleApiRequest.call(this, endpoint, 'POST', body);
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (resource === 'product') {
|
if (resource === 'product') {
|
||||||
if (operation === 'getAll') {
|
if (operation === 'getAll') {
|
||||||
const endpoint = '/2.0/product/get_products';
|
const endpoint = '/2.0/product/get_products';
|
||||||
|
|
||||||
responseData = paddleApiRequest.call(this, endpoint, 'POST', body);
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (resource === 'order') {
|
||||||
|
if (operation === 'get') {
|
||||||
|
const endpoint = '/1.0/order';
|
||||||
|
const checkoutId = this.getNodeParameter('checkoutId', i) as string;
|
||||||
|
|
||||||
|
body.checkout_id = checkoutId;
|
||||||
|
|
||||||
|
responseData = await paddleApiRequest.call(this, endpoint, 'GET', body);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (resource === 'user') {
|
if (resource === 'user') {
|
||||||
if (operation === 'getAll') {
|
if (operation === 'getAll') {
|
||||||
const subscriptionId = this.getNodeParameter('subscriptionId', i) as string;
|
|
||||||
const planId = this.getNodeParameter('planId', i) as string;
|
|
||||||
const limit = this.getNodeParameter('limit', i) as number;
|
|
||||||
|
|
||||||
body.subscription_id = subscriptionId;
|
const jsonParameters = this.getNodeParameter('jsonParameters', i) as boolean;
|
||||||
body.plan_id = planId;
|
|
||||||
body.results_per_page = limit;
|
if (jsonParameters) {
|
||||||
|
const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i) as string;
|
||||||
|
|
||||||
|
if (additionalFieldsJson !== '') {
|
||||||
|
if (validateJSON(additionalFieldsJson) !== undefined) {
|
||||||
|
Object.assign(body, JSON.parse(additionalFieldsJson));
|
||||||
|
} else {
|
||||||
|
throw new Error('Additional fields must be a valid JSON');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||||
|
|
||||||
|
if (!returnAll) {
|
||||||
|
body.results_per_page = this.getNodeParameter('limit', i) as number;
|
||||||
|
}
|
||||||
|
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
|
|
||||||
if (additionalFields.state) {
|
if (additionalFields.state) {
|
||||||
body.state = additionalFields.state as string;
|
body.state = additionalFields.state as string;
|
||||||
}
|
}
|
||||||
|
if (additionalFields.planId) {
|
||||||
|
body.plan_id = additionalFields.planId as string;
|
||||||
|
}
|
||||||
|
if (additionalFields.subscriptionId) {
|
||||||
|
body.subscription_id = additionalFields.subscriptionId as string;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
const endpoint = '/2.0/subscription/users';
|
const endpoint = '/2.0/subscription/users';
|
||||||
|
|
||||||
responseData = paddleApiRequest.call(this, endpoint, 'POST', body);
|
responseData = await paddleApiRequest.call(this, endpoint, 'POST', body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(responseData);
|
||||||
|
|
||||||
if (Array.isArray(responseData)) {
|
if (Array.isArray(responseData)) {
|
||||||
returnData.push.apply(returnData, responseData as IDataObject[]);
|
returnData.push.apply(returnData, responseData as IDataObject[]);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {
|
||||||
INodeProperties,
|
INodeProperties,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
export const paymentOperations = [
|
export const paymentsOperations = [
|
||||||
{
|
{
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
name: 'operation',
|
name: 'operation',
|
||||||
|
@ -10,7 +10,7 @@ export const paymentOperations = [
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
'payment',
|
'payments',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -31,45 +31,49 @@ export const paymentOperations = [
|
||||||
},
|
},
|
||||||
] as INodeProperties[];
|
] as INodeProperties[];
|
||||||
|
|
||||||
export const paymentFields = [
|
export const paymentsFields = [
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* payment:getAll */
|
/* payments:getAll */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Subscription ID',
|
displayName: 'JSON Parameters',
|
||||||
name: 'subscriptionId',
|
name: 'jsonParameters',
|
||||||
type: 'number',
|
type: 'boolean',
|
||||||
default: '',
|
default: false,
|
||||||
required: true,
|
description: '',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
'user',
|
'payments',
|
||||||
],
|
],
|
||||||
operation: [
|
operation: [
|
||||||
'getAll',
|
'getAll',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'A specific user subscription ID.',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Plan',
|
displayName: ' Additional Fields',
|
||||||
name: 'planId',
|
name: 'additionalFieldsJson',
|
||||||
type: 'string',
|
type: 'json',
|
||||||
|
typeOptions: {
|
||||||
|
alwaysOpenEditWindow: true,
|
||||||
|
},
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
'user',
|
'payments',
|
||||||
],
|
],
|
||||||
operation: [
|
operation: [
|
||||||
'getAll',
|
'getAll',
|
||||||
],
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
true,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'Filter: The product/plan ID (single or comma-separated values).',
|
description: `Attributes in JSON form.`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Additional Fields',
|
displayName: 'Additional Fields',
|
||||||
|
@ -78,16 +82,54 @@ export const paymentFields = [
|
||||||
placeholder: 'Add Field',
|
placeholder: 'Add Field',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
resource: [
|
||||||
|
'payments',
|
||||||
|
],
|
||||||
operation: [
|
operation: [
|
||||||
'getAll',
|
'getAll',
|
||||||
],
|
],
|
||||||
resource: [
|
jsonParameters: [
|
||||||
'user',
|
false
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: {},
|
default: {},
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
displayName: 'Date From',
|
||||||
|
name: 'from',
|
||||||
|
type: 'dateTime',
|
||||||
|
default: '',
|
||||||
|
description: 'payments starting from date.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Date To',
|
||||||
|
name: 'to',
|
||||||
|
type: 'dateTime',
|
||||||
|
default: '',
|
||||||
|
description: 'payments up until date.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Is Paid',
|
||||||
|
name: 'isPaid',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: 'payment is paid.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Plan',
|
||||||
|
name: 'plan',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
description: 'Filter: The product/plan ID (single or comma-separated values).',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Subscription ID',
|
||||||
|
name: 'subscriptionId',
|
||||||
|
type: 'number',
|
||||||
|
default: '',
|
||||||
|
description: 'A specific user subscription ID.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'State',
|
displayName: 'State',
|
||||||
name: 'state',
|
name: 'state',
|
||||||
|
@ -113,62 +155,50 @@ export const paymentFields = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
displayName: 'Is Paid',
|
|
||||||
name: 'isPaid',
|
|
||||||
type: 'boolean',
|
|
||||||
default: false,
|
|
||||||
description: 'Payment is paid.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'From',
|
|
||||||
name: 'from',
|
|
||||||
type: 'DateTime',
|
|
||||||
default: '',
|
|
||||||
description: 'Payments starting from date.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'To',
|
|
||||||
name: 'to',
|
|
||||||
type: 'DateTime',
|
|
||||||
default: '',
|
|
||||||
description: 'Payments up until date.',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
displayName: 'One off charge',
|
displayName: 'One off charge',
|
||||||
name: 'isOneOffCharge',
|
name: 'isOneOffCharge',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
description: 'Payment is paid.',
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* payment:reschedule */
|
/* payments:reschedule */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Payment ID',
|
displayName: 'payments ID',
|
||||||
name: 'paymentId',
|
name: 'paymentsId',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
required: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
'user',
|
'payments',
|
||||||
],
|
],
|
||||||
operation: [
|
operation: [
|
||||||
'getAll',
|
'reschedule',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'The upcoming subscription payment ID.', // Use loadoptions to select payment
|
description: 'The upcoming subscription payments ID.', // Use loadoptions to select payments
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Date',
|
displayName: 'Date',
|
||||||
name: 'date',
|
name: 'date',
|
||||||
type: 'DateTime',
|
type: 'dateTime',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Date you want to move the payment to.',
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'payments',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'reschedule',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: 'Date you want to move the payments to.',
|
||||||
},
|
},
|
||||||
] as INodeProperties[];
|
] as INodeProperties[];
|
||||||
|
|
|
@ -15,6 +15,11 @@ export const planOperations = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
name: 'Get',
|
||||||
|
value: 'get',
|
||||||
|
description: 'Get a plan.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Get All',
|
name: 'Get All',
|
||||||
value: 'getAll',
|
value: 'getAll',
|
||||||
|
@ -29,7 +34,7 @@ export const planOperations = [
|
||||||
export const planFields = [
|
export const planFields = [
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* plan:getAll */
|
/* plan:get */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Plan ID',
|
displayName: 'Plan ID',
|
||||||
|
@ -43,7 +48,7 @@ export const planFields = [
|
||||||
'plan',
|
'plan',
|
||||||
],
|
],
|
||||||
operation: [
|
operation: [
|
||||||
'getAll',
|
'get',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,16 +27,13 @@ export const userOperations = [
|
||||||
] as INodeProperties[];
|
] as INodeProperties[];
|
||||||
|
|
||||||
export const userFields = [
|
export const userFields = [
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* user:getAll */
|
/* user:getAll */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Subscription ID',
|
displayName: 'Return All',
|
||||||
name: 'subscriptionId',
|
name: 'returnAll',
|
||||||
type: 'string',
|
type: 'boolean',
|
||||||
default: '',
|
|
||||||
required: true,
|
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
|
@ -47,25 +44,8 @@ export const userFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'A specific user subscription ID.',
|
default: false,
|
||||||
},
|
description: 'If all results should be returned or only up to a given limit.',
|
||||||
{
|
|
||||||
displayName: 'Plan ID',
|
|
||||||
name: 'planId',
|
|
||||||
type: 'string',
|
|
||||||
default: '',
|
|
||||||
required: true,
|
|
||||||
displayOptions: {
|
|
||||||
show: {
|
|
||||||
resource: [
|
|
||||||
'user',
|
|
||||||
],
|
|
||||||
operation: [
|
|
||||||
'getAll',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
description: 'Filter: The subscription plan ID.',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Limit',
|
displayName: 'Limit',
|
||||||
|
@ -85,10 +65,53 @@ export const userFields = [
|
||||||
operation: [
|
operation: [
|
||||||
'getAll',
|
'getAll',
|
||||||
],
|
],
|
||||||
|
returnAll: [
|
||||||
|
false
|
||||||
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'Number of subscription records to return per page.',
|
description: 'Number of subscription records to return per page.',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'JSON Parameters',
|
||||||
|
name: 'jsonParameters',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'user',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'getAll',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: ' Additional Fields',
|
||||||
|
name: 'additionalFieldsJson',
|
||||||
|
type: 'json',
|
||||||
|
typeOptions: {
|
||||||
|
alwaysOpenEditWindow: true,
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'user',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'getAll',
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: `Attributes in JSON form.`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Additional Fields',
|
displayName: 'Additional Fields',
|
||||||
name: 'additionalFields',
|
name: 'additionalFields',
|
||||||
|
@ -96,16 +119,33 @@ export const userFields = [
|
||||||
placeholder: 'Add Field',
|
placeholder: 'Add Field',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
operation: [
|
|
||||||
'getAll',
|
|
||||||
],
|
|
||||||
resource: [
|
resource: [
|
||||||
'user',
|
'user',
|
||||||
],
|
],
|
||||||
|
operation: [
|
||||||
|
'getAll',
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false
|
||||||
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: {},
|
default: {},
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
displayName: 'Plan ID',
|
||||||
|
name: 'planId',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
description: 'Filter: The subscription plan ID.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Subscription ID',
|
||||||
|
name: 'subscriptionId',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
description: 'A specific user subscription ID.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'State',
|
displayName: 'State',
|
||||||
name: 'state',
|
name: 'state',
|
||||||
|
|
Loading…
Reference in a new issue