The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::API::Stripe::Error - A Stripe Error Object

SYNOPSIS

    my $err = $stripe->payment_intent->last_payment_error({
        type => 'card_error',
        charge => 'ch_fake1234567890',
        code => 402,
        doc_url => 'https://stripe.com/docs/api/errors',
        message => 'Some human readable message',
        payment_intent => $payment_intent_object,
        source => $source_object,
    });

VERSION

    0.1

DESCRIPTION

This is a Stripe Error object instantiated by method last_setup_error in module Net::API::Stripe::Payment::Intent::Setup, and method last_payment_error in module Net::API::Stripe::Payment::Intent

This is different from the error generated elsewhere in Net::API::Stripe

CONSTRUCTOR

new( %ARG )

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

METHODS

type string

The type of error returned. One of api_connection_error, api_error, authentication_error, card_error, idempotency_error, invalid_request_error, or rate_limit_error

charge string

For card errors, the ID of the failed charge. Not always present. Exists in Net::API::Stripe::Payment::Intent, but not in Net::API::Stripe::Payment::Intent::Setup

code string

For some errors that could be handled programmatically, a short string indicating the error code reported.

decline_code string

For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one.

doc_url string

A URL to more information about the error code reported. This is a URI object.

message string

A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.

param string

If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.

payment_intent hash

The PaymentIntent object for errors returned on a request involving a PaymentIntent.

When set, this is a Net::API::Stripe::Payment::Intent object.

payment_method hash

The PaymentMethod object for errors returned on a request involving a PaymentMethod.

When set, this is a Net::API::Stripe::Payment::Method object.

setup_intent hash

The SetupIntent object for errors returned on a request involving a SetupIntent.

When set, this is a Net::API::Stripe::Payment::Intent::Setup object.

source hash

The source object for errors returned on a request involving a source.

When set this is a Net::API::Stripe::Payment::Source object.

HISTORY

v0.1

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/errors

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.