View Source ExOAPI.Stripe.SDK.Charges (exoapi_stripe v0.1.4)

Link to this section Summary

Functions

description: <p>Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.</p>

description: <p>Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.</p>

description: <p>Retrieve a dispute for a specified charge.</p>

description: <p>You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the <code>limit</code> and <code>starting_after</code> parameters to page through additional refunds.</p>

description: <p>Retrieves the details of an existing refund.</p>

description: <p>Search for charges you’ve previously created using Stripe’s <a href="/docs/search#search-query-language">Search Query Language</a>. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.</p>

description: <p>To charge a credit card or other payment source, you create a <code>Charge</code> object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).</p>

description: <p>Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p>

description: <p>Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you <a href="#create_charge">created a charge</a> with the capture option set to false.</p>

description: <p>When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.</p>

description: <p>Create a refund.</p>

description: <p>Update a specified refund.</p>

Link to this section Types

Link to this type

get_charges_charge_dispute_opts()

View Source
@type get_charges_charge_dispute_opts() :: {:expand, String.t()}
Link to this type

get_charges_charge_opts()

View Source
@type get_charges_charge_opts() :: {:expand, String.t()}
Link to this type

get_charges_charge_refunds_opts()

View Source
@type get_charges_charge_refunds_opts() ::
  {:starting_after, String.t()}
  | {:limit, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
Link to this type

get_charges_charge_refunds_refund_opts()

View Source
@type get_charges_charge_refunds_refund_opts() :: {:expand, String.t()}
@type get_charges_opts() ::
  {:transfer_group, String.t()}
  | {:starting_after, String.t()}
  | {:payment_intent, String.t()}
  | {:limit, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
  | {:customer, String.t()}
  | {:created, String.t()}
Link to this type

get_charges_search_opts()

View Source
@type get_charges_search_opts() ::
  {:page, String.t()} | {:limit, String.t()} | {:expand, String.t()}

Link to this section Functions

Link to this function

get_charges(client, opts \\ [])

View Source
@spec get_charges(client :: ExOAPI.Client.t(), [get_charges_opts()]) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.Charge.t()]
     }
   | map()}
  | {:error, any()}

description: <p>Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.</p>

Link to this function

get_charges_charge(client, charge, opts \\ [])

View Source
@spec get_charges_charge(
  client :: ExOAPI.Client.t(),
  charge :: String.t(),
  [get_charges_charge_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Charge.t() | map()}
  | {:error, any()}

description: <p>Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.</p>

Link to this function

get_charges_charge_dispute(client, charge, opts \\ [])

View Source
@spec get_charges_charge_dispute(
  client :: ExOAPI.Client.t(),
  charge :: String.t(),
  [get_charges_charge_dispute_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Dispute.t() | map()}
  | {:error, any()}

description: <p>Retrieve a dispute for a specified charge.</p>

Link to this function

get_charges_charge_refunds(client, charge, opts \\ [])

View Source
@spec get_charges_charge_refunds(
  client :: ExOAPI.Client.t(),
  charge :: String.t(),
  [get_charges_charge_refunds_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.Refund.t()]
     }
   | map()}
  | {:error, any()}

description: <p>You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the <code>limit</code> and <code>starting_after</code> parameters to page through additional refunds.</p>

Link to this function

get_charges_charge_refunds_refund(client, refund, charge, opts \\ [])

View Source
@spec get_charges_charge_refunds_refund(
  client :: ExOAPI.Client.t(),
  refund :: String.t(),
  charge :: String.t(),
  [get_charges_charge_refunds_refund_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Refund.t() | map()}
  | {:error, any()}

description: <p>Retrieves the details of an existing refund.</p>

Link to this function

get_charges_search(client, query, opts \\ [])

View Source
@spec get_charges_search(
  client :: ExOAPI.Client.t(),
  query :: String.t(),
  [get_charges_search_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       total_count: integer(),
       object: String.t() | :search_result,
       next_page: String.t(),
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.Charge.t()]
     }
   | map()}
  | {:error, any()}

description: <p>Search for charges you’ve previously created using Stripe’s <a href="/docs/search#search-query-language">Search Query Language</a>. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.</p>

Link to this function

post_charges(client, body)

View Source
@spec post_charges(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      transfer_group: String.t(),
      transfer_data: %{destination: String.t(), amount: integer()},
      statement_descriptor_suffix: String.t(),
      statement_descriptor: String.t(),
      source: String.t(),
      shipping: %{
        tracking_number: String.t(),
        phone: String.t(),
        name: String.t(),
        carrier: String.t(),
        address: %{
          state: String.t(),
          postal_code: String.t(),
          line2: String.t(),
          line1: String.t(),
          country: String.t(),
          city: String.t()
        }
      },
      receipt_email: String.t(),
      on_behalf_of: String.t(),
      metadata: String.t() | map(),
      expand: [String.t()],
      destination: String.t() | %{amount: integer(), account: String.t()},
      description: String.t(),
      customer: String.t(),
      currency: String.t(),
      card:
        String.t()
        | %{
            object: String.t() | :card,
            number: String.t(),
            name: String.t(),
            metadata: map(),
            exp_year: integer(),
            exp_month: integer(),
            cvc: String.t(),
            address_zip: String.t(),
            address_state: String.t(),
            address_line2: String.t(),
            address_line1: String.t(),
            address_country: String.t(),
            address_city: String.t()
          },
      capture: boolean(),
      application_fee_amount: integer(),
      application_fee: integer(),
      amount: integer()
    }
    | map()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Charge.t() | map()}
  | {:error, any()}

description: <p>To charge a credit card or other payment source, you create a <code>Charge</code> object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).</p>

Link to this function

post_charges_charge(client, body, charge)

View Source
@spec post_charges_charge(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      transfer_group: String.t(),
      shipping: %{
        tracking_number: String.t(),
        phone: String.t(),
        name: String.t(),
        carrier: String.t(),
        address: %{
          state: String.t(),
          postal_code: String.t(),
          line2: String.t(),
          line1: String.t(),
          country: String.t(),
          city: String.t()
        }
      },
      receipt_email: String.t(),
      metadata: String.t() | map(),
      fraud_details: %{user_report: String.t() | :fraudulent | :safe},
      expand: [String.t()],
      description: String.t(),
      customer: String.t()
    }
    | map(),
  charge :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Charge.t() | map()}
  | {:error, any()}

description: <p>Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p>

Link to this function

post_charges_charge_capture(client, body, charge)

View Source
@spec post_charges_charge_capture(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      transfer_group: String.t(),
      transfer_data: %{amount: integer()},
      statement_descriptor_suffix: String.t(),
      statement_descriptor: String.t(),
      receipt_email: String.t(),
      expand: [String.t()],
      application_fee_amount: integer(),
      application_fee: integer(),
      amount: integer()
    }
    | map(),
  charge :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Charge.t() | map()}
  | {:error, any()}

description: <p>Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you <a href="#create_charge">created a charge</a> with the capture option set to false.</p>

Uncaptured payments expire a set number of days after they are created (7 by default). If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.

Link to this function

post_charges_charge_dispute(client, body, charge)

View Source
@spec post_charges_charge_dispute(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      submit: boolean(),
      metadata: String.t() | map(),
      expand: [String.t()],
      evidence: %{
        uncategorized_text: String.t(),
        uncategorized_file: String.t(),
        shipping_tracking_number: String.t(),
        shipping_documentation: String.t(),
        shipping_date: String.t(),
        shipping_carrier: String.t(),
        shipping_address: String.t(),
        service_documentation: String.t(),
        service_date: String.t(),
        refund_refusal_explanation: String.t(),
        refund_policy_disclosure: String.t(),
        refund_policy: String.t(),
        receipt: String.t(),
        product_description: String.t(),
        duplicate_charge_id: String.t(),
        duplicate_charge_explanation: String.t(),
        duplicate_charge_documentation: String.t(),
        customer_signature: String.t(),
        customer_purchase_ip: String.t(),
        customer_name: String.t(),
        customer_email_address: String.t(),
        customer_communication: String.t(),
        cancellation_rebuttal: String.t(),
        cancellation_policy_disclosure: String.t(),
        cancellation_policy: String.t(),
        billing_address: String.t(),
        access_activity_log: String.t()
      }
    }
    | map(),
  charge :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Dispute.t() | map()}
  | {:error, any()}
Link to this function

post_charges_charge_dispute_close(client, body, charge)

View Source
@spec post_charges_charge_dispute_close(
  client :: ExOAPI.Client.t(),
  body :: %{expand: [String.t()]} | map(),
  charge :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Dispute.t() | map()}
  | {:error, any()}
Link to this function

post_charges_charge_refund(client, body, charge)

View Source
@spec post_charges_charge_refund(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      reverse_transfer: boolean(),
      refund_application_fee: boolean(),
      reason: String.t() | :duplicate | :fraudulent | :requested_by_customer,
      payment_intent: String.t(),
      metadata: String.t() | map(),
      expand: [String.t()],
      amount: integer()
    }
    | map(),
  charge :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Charge.t() | map()}
  | {:error, any()}

description: <p>When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.</p>

Creating a new refund will refund a charge that has previously been created but not yet refunded.Funds will be refunded to the credit or debit card that was originally charged.

You can optionally refund only part of a charge.You can do so multiple times, until the entire charge has been refunded.

Once entirely refunded, a charge can’t be refunded again.This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge.

Link to this function

post_charges_charge_refunds(client, body, charge)

View Source
@spec post_charges_charge_refunds(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      reverse_transfer: boolean(),
      refund_application_fee: boolean(),
      reason: String.t() | :duplicate | :fraudulent | :requested_by_customer,
      payment_intent: String.t(),
      metadata: String.t() | map(),
      expand: [String.t()],
      amount: integer()
    }
    | map(),
  charge :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Refund.t() | map()}
  | {:error, any()}

description: <p>Create a refund.</p>

Link to this function

post_charges_charge_refunds_refund(client, body, refund, charge)

View Source
@spec post_charges_charge_refunds_refund(
  client :: ExOAPI.Client.t(),
  body :: %{metadata: String.t() | map(), expand: [String.t()]} | map(),
  refund :: String.t(),
  charge :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Refund.t() | map()}
  | {:error, any()}

description: <p>Update a specified refund.</p>