Stripe Get Charge
Overview
This node interact with the Stripe payment gateway to retrieve information about a specific charge based on its unique identifier. This functionality is critical for businesses and developers who need to access payment data for reporting, customer inquiries, or debugging purposes. The node utilizes a connection instance to Stripe and handles error management effectively to provide a robust experience.
Settings
inputs
- Setting Name:
chargeId- Input Type: String
- Description: This setting holds the unique identifier of the charge that needs to be retrieved from Stripe. It is essential for the functionality of the component, as it tells the system which specific charge record to query.
- Impact of Changes: If this setting is changed to a different charge ID, the output will reflect the information related to the new charge. If it is not provided, the logic will throw an error.
- Default Value: None (this is a required parameter).
config
- Setting Name:
chargeId- Input Type: String
- Description: An alternative way to provide the charge ID if it is not supplied through
inputs. If bothinputs.chargeIdandconfig.chargeIdare provided, the logic will prioritize theinputs.chargeIdvalue. - Impact of Changes: Changing this value will affect which charge record is retrieved if the
inputs.chargeIdis not specified. If both settings are used, the component's behavior is contingent upon theinputssetting. - Default Value: None (this will only serve as a fallback).
context
- Setting Name:
context- Input Type: Object (array of objects)
- Description: This parameter typically provides contextual information required for establishing a connection with the Stripe API. This could include authentication tokens, account details, or environment specifications.
- Impact of Changes: Altering the
contextcan affect the ability to connect with Stripe and retrieve charge data. If the context does not contain necessary authentication data, the request will fail. - Default Value:
{}(an empty object, which means that no additional context will be provided unless specified).
How It Works
- The node is executed with inputs, configuration, and context.
- It attempts to create a connection to the Stripe API using a secure connection.
- The charge ID is populated either from the
inputsor theconfig. If neither is provided, an error is thrown. - Using the established integration, the function calls the
getOneChargemethod, passing the charge ID to query the Stripe service. - The retrieved charge data is returned as
output1. In case of an error during the process, a structured error message is returned.
Data Expectations
- Charge ID: A valid string that corresponds to a charge existing within the Stripe system. This ID must adhere to the format expected by Stripe.
- Context: Contains required authentication information for Stripe. It must be populated with the necessary credentials for successful API interaction.
Use Cases & Examples
Use Cases
-
Customer Support: A customer service representative needs to retrieve specific charge details to assist a customer with a billing dispute. Using this node, they can pull the relevant transaction details quickly to address the customer's concerns.
-
Revenue Reporting: A finance department requires a detailed report of certain charges in order to reconcile monthly income. This logic can help extract specific charge records needed for comprehensive financial reporting.
-
Charge Monitoring: An e-commerce application monitors transactions to ensure everything is processed correctly. The nodeality can be used in a tracking mechanism to verify whether particular charges have completed successfully or have issues.
Example Configuration
Use Case: Customer Support Query
Suppose a customer service representative needs to look up a charge with the ID ch_1IYcxm2eZvKYlo2C1oM3Qp0d due to a dispute regarding the service provided.
-
Inputs Configuration:
json{ "chargeId": "ch_1IYcxm2eZvKYlo2C1oM3Qp0d" } -
Config Configuration (if applicable):
json{ "chargeId": null // Not used since we are supplying chargeId in inputs } -
Context Configuration:
json{ "apiKey": "your-stripe-api-key" }
In this configuration, the component would retrieve the charge data corresponding to the specified charge ID. If successful, the system would return detailed information regarding the charge, which the representative can then relay to the customer. If an invalid charge ID or context is provided, appropriate errors will be raised, ensuring a smooth operation.