We work on extending the Stripe Node with more functionality in regards of their newer APIs. In particular the PaymentIntent API. This API is quite nasty as it gets very complex in terms of the possible input in the request objects. The request data is also highly variable based on certain inputs.
To be more precise: There are
payment_method_options for each and every
payment_method. Each option can be a multi dimensional object.
You can see what I mean here: Stripe API reference – The PaymentIntent object – curl
Just expand some of the child attributes levels.
Or take a look at their Typings … stripe-node/PaymentIntents.d.ts at master · stripe/stripe-node · GitHub
We considered implementing a “simple” PaymentIntent functionality but the complexity / mass of the required n8n UI definition is pure crazy.
The cURL request on the other hand is quite trivial and would look like this for example for one particular payment_method and usecase. Please note the dependent options based on values of previous array levels:
payment_method_data[type]: "customer_balance" payment_method_types: "customer_balance" payment_method_options[customer_balance][funding_type]: "bank_transfer" payment_method_options[customer_balance][bank_transfer][type]: "eu_bank_transfer" payment_method_options[customer_balance][bank_transfer][eu_bank_transfer][country]: "DE"
Is there any tooling / suggestion / pattern to solve this with n8n better than implementing each and every level of possible options, enums, etc.?
We could - for example - just start and implement the payment_methods we require and leave this as a starting point. Still this will result in a massive n8n node declaration file. I am not sure about maintainability.
We also considered just adding a simple key => value fixedCollection allowing to adding the object structure manually and then crafting a request body from it to avoid the complete specification. Still this feels dirty…
- n8n version: 0.178.0
- Database you’re using (default: SQLite): local dev
- Running n8n with the execution process [own(default), main]: npm run dev
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: npm local dev
Happy for any suggestions
Thank you very much,