NAME

Net::API::Stripe::Refund - A Stripe Refund Object

SYNOPSIS

my $refund = $stripe->refund({
    amount => 2000,
    charge => $charge_object,
    currency => 'jpy',
    description => 'Cancelled service order',
    metadata => { transaction_id => 123, customer_id => 456 },
    reason => 'requested_by_customer',
});

See documentation in Net::API::Stripe for example to make api calls to Stripe to create those objects.

VERSION

v0.101.0

DESCRIPTION

Refund objects allow you to 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.

CONSTRUCTOR

new( %ARG )

Creates a new Net::API::Stripe::Refund object. It may also take an hash like arguments, that also are method of the same name.

METHODS

id string

Unique identifier for the object.

object string, value is "refund"

String representing the object’s type. Objects of the same type share the same value.

amount integer

Amount, in JPY.

balance_transaction string (expandable)

Balance transaction that describes the impact on your account balance.

When expanded, this is a Net::API::Stripe::Balance::Transaction object.

charge string (expandable)

ID of the charge that was refunded. When expanded, this is a Net::API::Stripe::Charge object.

created timestamp

Time at which the object was created. Measured in seconds since the Unix epoch. This is a DateTime object.

currency currency

Three-letter ISO currency code, in lowercase. Must be a supported currency.

description string

An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only)

failure_balance_transaction string (expandable)

If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. This is a Net::API::Stripe::Balance::Transaction

failure_reason string

If the refund failed, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, or unknown.

instructions_email string

Email to which refund instructions, if required, are sent to.

metadata hash

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

next_action hash

If the refund has a status of requires_action, this property will describe what the refund needs in order to continue processing.

It has the following properties:

display_details hash

Contains the refund details.

email_sent hash

Contains information about the email sent to the customer.

email_sent_at timestamp

The timestamp when the email was sent.

email_sent_to string

The recipient's email address.

expires_at timestamp

The expiry timestamp.

type string

Type of the next action to perform.

payment_intent expandable

ID of the PaymentIntent that was refunded.

When expanded this is an Net::API::Stripe::PaymentIntent object.

reason string

Reason for the refund. If set, possible values are duplicate, fraudulent, and requested_by_customer.

receipt_number string

This is the transaction number that appears on email receipts sent for this refund.

source_transfer_reversal string (expandable)

The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. This is a Net::API::Stripe::Connect::Transfer::Reversal

status string

Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, succeeded, failed, or canceled. Refer to Stripe refunds documentation for more details.

transfer_reversal string (expandable)

If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. This is a Net::API::Stripe::Connect::Transfer::Reversal object.

API SAMPLE

{
  "id": "re_fake123456789",
  "object": "refund",
  "amount": 30200,
  "balance_transaction": "txn_fake123456789",
  "charge": "ch_fake123456789",
  "created": 1540736617,
  "currency": "jpy",
  "metadata": {},
  "reason": null,
  "receipt_number": null,
  "source_transfer_reversal": null,
  "status": "succeeded",
  "transfer_reversal": null
}

HISTORY

v0.1

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/refunds, https://stripe.com/docs/refunds

COPYRIGHT & LICENSE

Copyright (c) 2019-2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.