Files
Agent-n8n/n8n-n8n-1.109.2/packages/nodes-base/credentials/StripeApi.credentials.ts
2025-09-08 04:48:28 +08:00

42 lines
725 B
TypeScript
Executable File

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class StripeApi implements ICredentialType {
name = 'stripeApi';
displayName = 'Stripe API';
documentationUrl = 'stripe';
properties: INodeProperties[] = [
{
displayName: 'Secret Key',
name: 'secretKey',
type: 'string',
typeOptions: { password: true },
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.secretKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.stripe.com/v1',
url: '/charges',
json: true,
},
};
}