n8n/packages/nodes-base/nodes/Stripe/descriptions/CustomerCardDescription.ts
Iván Ovejero b4f4ecc77e
Add Stripe regular node (#1470)
* 🎉 Register node

* 🎨 Add SVG icon

*  Add preliminary node stub

*  Add resource description stubs

* 🎨 Fix SVG size and position

*  Implement charge operations

*  Implement customer operations

* 🎨 Apply cosmetic changes

*  Fix customer address fields

*  Add stub and fields for invoice

*  Add invoice item stubs

*  Implement source operations

*  Reduce scope per feedback

*  Add continueOnFail functionality

* 🎨 Prettify error thrown

* 🔥 Remove unused resource

*  Replace source in card with token

* 🔨 Remove logging

* 🔧 Fix shipping address in charge:create

* 🔧 Load update fields for charge:update

*  Implement token:create to ease testing

*  Simplify card token fields

*  Update description parameters

* 🔧 Fix field adjusters

*  Remove unused source options

* 🔧 Fix shipping fields adjuster

* 🔥 Remove PNG icon

* 🔥 Remove logging

* 🔨 Reorder address fields

* 🐛 Fix shipping field in charge:update

* 💄 Apply cosmetic change

*  Small improvements

*  Fix lintings in main file

*  Lint all descriptions

*  Add target="_blank" attribute

*  Fix various lintings for charge

*  Fix lintings for coupon

*  Fix lintings for customer

*  Fix lintings for source

*  Fix lintings for token

*  Reorder address fields

*  Fix casing in credentials

* 🔨 Place recipient name above address in shipping

*  Remove references to string in descriptions

*  Apply minor renamings

* 🔥 Remove logging

* 🔨 Simplify error handling

*  Fix indentation

*  Move cardFields to root level for Token creation

Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-10 13:15:14 +02:00

161 lines
2.7 KiB
TypeScript

import {
INodeProperties,
} from 'n8n-workflow';
export const customerCardOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
default: 'get',
description: 'Operation to perform',
options: [
{
name: 'Add',
value: 'add',
description: 'Add a customer card',
},
{
name: 'Get',
value: 'get',
description: 'Get a customer card',
},
{
name: 'Remove',
value: 'remove',
description: 'Remove a customer card',
},
],
displayOptions: {
show: {
resource: [
'customerCard',
],
},
},
},
] as INodeProperties[];
export const customerCardFields = [
// ----------------------------------
// customerCard: add
// ----------------------------------
{
displayName: 'Customer ID',
name: 'customerId',
type: 'string',
required: true,
default: '',
description: 'ID of the customer to be associated with this card',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'add',
],
},
},
},
{
displayName: 'Card Token',
name: 'token',
type: 'string',
required: true,
default: '',
placeholder: 'tok_1IMfKdJhRTnqS5TKQVG1LI9o',
description: 'Token representing sensitive card information',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'add',
],
},
},
},
// ----------------------------------
// customerCard: remove
// ----------------------------------
{
displayName: 'Customer ID',
name: 'customerId',
type: 'string',
required: true,
default: '',
description: 'ID of the customer whose card to remove',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'remove',
],
},
},
},
{
displayName: 'Card ID',
name: 'cardId',
type: 'string',
required: true,
default: '',
description: 'ID of the card to remove',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'remove',
],
},
},
},
// ----------------------------------
// customerCard: get
// ----------------------------------
{
displayName: 'Customer ID',
name: 'customerId',
type: 'string',
required: true,
default: '',
description: 'ID of the customer whose card to retrieve',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'get',
],
},
},
},
{
displayName: 'Source ID',
name: 'sourceId',
type: 'string',
required: true,
default: '',
description: 'ID of the source to retrieve',
displayOptions: {
show: {
resource: [
'customerCard',
],
operation: [
'get',
],
},
},
},
] as INodeProperties[];