Stripe Customer Card
This component allows you to manage payment cards linked to specific customers in your Stripe account. It serves as a bridge between your automation workflow and Stripe’s payment system, enabling you to view existing cards, add new ones, or remove old ones. This is essential for keeping customer payment profiles up to date and ensuring smooth billing processes.
How it Works
This component connects directly to the Stripe API. When you use this node in Nappai, it sends secure requests to Stripe to perform actions on customer accounts.
Depending on the Mode you select, the component will either look for one specific card using its unique ID, or it will list all available cards for that customer. If you are adding a new card, it requires a secure token from a previous step (generated by a payment element) to ensure sensitive card details are handled safely. If you are removing a card, it uses the specific card ID to delete that payment method from the customer’s profile.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type specified for this component and fill in the required fields (API Keys, tokens, etc.).
- In your workflow, select the saved credential in the Credential input field of this node.
Inputs
The following fields are available to configure this component. Each field may be visible in different operations:
-
Mode: Specifies how the component interacts with Stripe. You can choose ‘By ID’ to retrieve a specific record or ‘All’ to list multiple records.
- Visible in: All operations
-
Customer ID: The unique Stripe identifier for the customer (e.g., cus_…). This is required for all operations to ensure you are managing the correct customer’s data.
- Visible in: All operations
-
Card ID: The unique identifier for a specific card (e.g., card_…). This is required when you need to get details of a specific card or remove it.
- Visible in: All operations
-
Source Token: A secure token representing the card details (e.g., tok_visa). This is required only when you are adding a new card to the system.
- Visible in: All operations
Outputs
When this component runs successfully, it produces data that you can use in subsequent steps of your automation.
Output Data Example (JSON)json
{ “id”: “card_1Mq4…”, “object”: “card”, “brand”: “Visa”, “last4”: “4242”, “exp_month”: 12, “exp_year”: 2025, “funding”: “credit”, “customer”: “cus_1234…” }
Connectivity
This component is typically connected to other data retrieval or customer management components.
- Upstream: It often receives data from a Customer component (to get the Customer ID) or a Payment Element component (to get the Source Token for adding cards).
- Downstream: The output can be connected to Email components to notify customers, Database nodes to save card details, or Logic components to handle different actions based on whether a card was found or created successfully.
Usage Example
Scenario: Adding a New Payment Method
- Use a Payment Element component to capture the customer’s payment info and generate a Source Token.
- Connect this token to the Source Token field of this Stripe Customer Card component.
- Provide the Customer ID for the user who needs the new card.
- Set the Mode to retrieve or confirm the action.
- The component adds the card to the customer’s Stripe profile, and the output can be used to confirm the successful addition.
Scenario: Removing an Old Card
- Identify the Card ID of the card you wish to remove.
- Connect this ID to the Card ID field of this component.
- Provide the Customer ID.
- The component will remove that specific card from the customer’s profile, preventing future charges with that card.
Tips and Best Practices
- Always use the Source Token for adding cards rather than raw card numbers to ensure security and compliance.
- When retrieving data, decide if you need one specific card (By ID) or a full list (All) to optimize performance.
- Keep your Customer IDs handy, as they are required for almost every operation.
- Test your workflow in a sandbox environment before running it with real customer data.
Security Considerations
- Never store raw credit card numbers in your workflow or logs. Always use the secure tokens provided by Stripe.
- Ensure your Stripe API credentials are kept secret and are not exposed in public repositories or shared workflows.
- Use the Credential configuration to manage your API keys securely within Nappai.