4 min read

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

  1. 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

  1. Setting Name: chargeId
    • Input Type: String
    • Description: An alternative way to provide the charge ID if it is not supplied through inputs. If both inputs.chargeId and config.chargeId are provided, the logic will prioritize the inputs.chargeId value.
    • Impact of Changes: Changing this value will affect which charge record is retrieved if the inputs.chargeId is not specified. If both settings are used, the component's behavior is contingent upon the inputs setting.
    • Default Value: None (this will only serve as a fallback).

context

  1. 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 context can 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

  1. The node is executed with inputs, configuration, and context.
  2. It attempts to create a connection to the Stripe API using a secure connection.
  3. The charge ID is populated either from the inputs or the config. If neither is provided, an error is thrown.
  4. Using the established integration, the function calls the getOneCharge method, passing the charge ID to query the Stripe service.
  5. The retrieved charge data is returned as output1. In case of an error during the process, a structured error message is returned.

Data Expectations

Use Cases & Examples

Use Cases

  1. 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.

  2. 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.

  3. 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.

  1. Inputs Configuration:

    json
    {
      "chargeId": "ch_1IYcxm2eZvKYlo2C1oM3Qp0d"
    }
  2. Config Configuration (if applicable):

    json
    {
      "chargeId": null  // Not used since we are supplying chargeId in inputs
    }
  3. 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.