stripity_stripe v2.2.1 Stripe.Charge View Source
Work with Stripe charge
objects.
You can:
Link to this section Summary
Functions
[DEPRECATED] Capture a charge
Capture a charge
Create a charge
List all charges
Retrieve a charge
Update a charge
Link to this section Types
card_info() :: %{ exp_month: number(), exp_year: number(), number: String.t(), object: String.t(), cvc: String.t(), address_city: String.t() | nil, address_country: String.t() | nil, address_line1: String.t() | nil, address_line2: String.t() | nil, name: String.t() | nil, address_state: String.t() | nil, address_zip: String.t() | nil }
stripe_fraud_report() :: %{stripe_report: String.t()}
t() :: %Stripe.Charge{ fraud_details: user_fraud_report() | stripe_fraud_report() | %{}, refunded: boolean(), amount: non_neg_integer(), customer: Stripe.id() | Stripe.Customer.t() | nil, receipt_number: String.t() | nil, dispute: Stripe.id() | Stripe.Dispute.t() | nil, failure_message: String.t() | nil, description: String.t() | nil, transfer_group: String.t() | nil, destination: Stripe.id() | Stripe.Account.t() | nil, on_behalf_of: Stripe.id() | Stripe.Account.t() | nil, id: Stripe.id(), amount_refunded: non_neg_integer(), object: String.t(), currency: String.t(), outcome: charge_outcome() | nil, source: Stripe.Card.t() | map(), shipping: Stripe.Types.shipping() | nil, invoice: Stripe.id() | Stripe.Invoice.t() | nil, failure_code: Stripe.Error.card_error_code() | nil, transfer: Stripe.id() | Stripe.Transfer.t() | nil, captured: boolean(), source_transfer: Stripe.id() | Stripe.Transfer.t() | nil, statement_descriptor: String.t() | nil, status: String.t(), refunds: Stripe.List.t(Stripe.Refund.t()), application_fee: Stripe.id() | Stripe.ApplicationFee.t() | nil, application: Stripe.id() | nil, order: Stripe.id() | Stripe.Order.t() | nil, metadata: Stripe.Types.metadata(), livemode: boolean(), paid: boolean(), balance_transaction: Stripe.id() | Stripe.BalanceTransaction.t() | nil, created: Stripe.timestamp(), review: Stripe.id() | Stripe.Review.t() | nil, receipt_email: String.t() | nil }
Link to this section Functions
capture(Stripe.id() | t()) :: {:ok, t()} | {:error, Stripe.Error.t()}
capture(Stripe.id() | t(), Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()}
capture(Stripe.id() | t(), map()) :: {:ok, t()} | {:error, Stripe.Error.t()}
[DEPRECATED] Capture a charge.
This version of the function is deprecated. Please use capture/3
instead.
capture(Stripe.id() | t(), params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ optional(:amount) => non_neg_integer(), optional(:application_fee) => non_neg_integer(), optional(:destination) => %{optional(:amount) => non_neg_integer()}, optional(:receipt_email) => String.t(), optional(:statement_descriptor) => String.t() }
Capture a charge.
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.
Uncaptured payments expire exactly seven days after they are created. If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.
See the Stripe docs.
create(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ :amount => pos_integer(), :currency => String.t(), optional(:application_fee) => non_neg_integer(), optional(:capture) => boolean(), optional(:description) => String.t(), optional(:destination) => %{ :account => Stripe.id() | Stripe.Account.t(), optional(:amount) => non_neg_integer() }, optional(:transfer_group) => String.t(), optional(:on_behalf_of) => Stripe.id() | Stripe.Account.t(), optional(:metadata) => map(), optional(:receipt_email) => String.t(), optional(:shipping) => Stripe.Types.shipping(), optional(:customer) => Stripe.id() | Stripe.Customer.t(), optional(:source) => Stripe.id() | Stripe.Card.t() | card_info(), optional(:statement_descriptor) => String.t() } | %{}
Create a charge.
If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, though everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).
See the Stripe docs.
list(params, Stripe.options()) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()} when params: %{ optional(:created) => Stripe.date_query(), optional(:customer) => Stripe.Customer.t() | Stripe.id(), optional(:ending_before) => t() | Stripe.id(), optional(:limit) => 1..100, optional(:source) => %{optional(:object) => String.t()}, optional(:starting_after) => t() | Stripe.id(), optional(:transfer_group) => String.t() }
List all charges.
Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.
See the Stripe docs.
retrieve(Stripe.id() | t(), Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()}
Retrieve a charge.
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.
See the Stripe docs.
update(Stripe.id() | t(), params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ optional(:customer) => Stripe.id() | Stripe.Customer.t(), optional(:description) => String.t(), optional(:fraud_details) => user_fraud_report(), optional(:metadata) => Stripe.Types.metadata(), optional(:receipt_email) => String.t(), optional(:shipping) => Stripe.Types.shipping(), optional(:transfer_group) => String.t() } | %{}
Update a charge.
Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
This request accepts only the :description
, :metadata
, :receipt_email
, :fraud_details
,
and :shipping
as arguments, as well as :transfer_group
in some cases.
The charge to be updated may either be passed in as a struct or an ID.
See the Stripe docs.