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::Connect::ExternalAccount::Card - A Stripe Card Account Object

SYNOPSIS

    my $card = $stripe->card({
        account => 'acct_fake123456789',
        # Or you can also simply pass a Net::API::Stripe::Address object
        # address => $address_object
        address_line1 => '1-2-3 Kudan-Minami, Chiyoda-ku',
        address_line2 => 'Big bldg. 12F',
        address_city => 'Tokyo',
        address_zip => '123-4567',
        address_country => 'jp',
        brand => 'visa',
        country => 'jp',
        currency => 'jpy',
        customer => $customer_object,
        cvc => 123,
        # Boolean
        default_for_currency => 1,
        exp_month => 12,
        exp_year => 2030,
        funding => 'debit',
        metadata => { transaction_id => 123, customer_id => 456 },
        name => 'John Doe',
    });

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

    my $stripe = Net::API::Stripe->new( conf_file => 'settings.json' ) | die( Net::API::Stripe->error );
    my $stripe_card = $stripe->cards( create =>
    {
    account => 'acct_fake123456789',
    external_account =>
        {
        object => 'card',
        exp_month => 12,
        exp_year => 2030,
        number => '012345678',
        },
    default_for_currency => $stripe->true,
    metadata => { transaction_id => 123, customer_id => 456 },
    }) || die( $stripe->error );

VERSION

    v0.203.0

DESCRIPTION

These External Accounts are transfer destinations on Account objects for Custom accounts (https://stripe.com/docs/connect/custom-accounts). They can be bank accounts or debit cards.

Bank accounts (https://stripe.com/docs/api#customer_bank_account_object) and debit cards (https://stripe.com/docs/api#card_object) can also be used as payment sources on regular charges, and are documented in the links above.

CONSTRUCTOR

new( %ARG )

Creates a new Net::API::Stripe::Connect::ExternalAccount::Card 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 "card"

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

account custom only string (expandable)

The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead.

When expanded, this is a Net::API::Stripe::Connect::Account object.

address Net::API::Stripe::Address object or hash

This is a helper method. Provided with either a Net::API::Stripe::Address object or a hash with same properties, this will assign all the address_* properties by calling its method.

address_city string

City/District/Suburb/Town/Village.

address_country string

Billing address country, if provided when creating card.

address_line1 string

Address line 1 (Street address/PO Box/Company name).

address_line1_check string

If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked.

address_line2 string

Address line 2 (Apartment/Suite/Unit/Building).

address_state string

State/County/Province/Region.

address_zip string

ZIP or postal code.

address_zip_check string

If address_zip was provided, results of the check: pass, fail, unavailable, or unchecked.

amount_authorized integer

The authorized amount

available_payout_methods array

A set of available payout methods for this card. Will be either ["standard"] or ["standard", "instant"]. Only values from this set should be passed as the method when creating a transfer.

brand string

Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown.

capture_before timestamp

When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.

cardholder_name string

The cardholder name as read from the card, in ISO 7813 format. May include alphanumeric characters, special characters and first/last name separator (/).

checks

address_line1_check string

If a address line1 was provided, results of the check, one of ‘pass’, ‘failed’, ‘unavailable’ or ‘unchecked’.

address_postal_code_check string

If a address postal code was provided, results of the check, one of ‘pass’, ‘failed’, ‘unavailable’ or ‘unchecked’.

cvc_check string

If a CVC was provided, results of the check, one of ‘pass’, ‘failed’, ‘unavailable’ or ‘unchecked’.

country string

Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected.

currency custom only currency

Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency.

customer string (expandable)

The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.

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

cvc string

Card security code. Highly recommended to always include this value, but it's required only for accounts based in European countries.

This is used when creating a card object on Stripe API. See here: https://stripe.com/docs/api/cards/create

cvc_check string

If a CVC was provided, results of the check: pass, fail, unavailable, or unchecked.

default_for_currency custom only boolean

Whether this card is the default external account for its currency.

description string

A high-level description of the type of cards issued in this range

dynamic_last4 string

(For tokenized numbers only.) The last four digits of the device account number.

emv_auth_data string

Authorization response cryptogram.

exp_month integer

Two-digit number representing the card’s expiration month.

exp_year integer

Four-digit number representing the card’s expiration year.

fingerprint string

Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example.

funding string

Card funding type. Can be credit, debit, prepaid, or unknown.

generated_card string

ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.

generated_from hash

Details of the original PaymentMethod that created this object.

iin string

Issuer identification number of the card

incremental_authorization_supported boolean

Whether this PaymentIntent is eligible for incremental authorizations. Request support using requestincrementalauthorization_support.

installments hash

If present, this is a Net::API::Stripe::Payment::Installment object. As of 2019-02-19, this is only used in Mexico though. See here for more information: https://stripe.com/docs/payments/installments

issuer string

The name of the card's issuing bank

last4 string

The last four digits of the card.

mandate string

ID of the mandate used to make this payment.

mandate_options

Additional fields for Mandate creation

This is just a property with an empty hash. There are a few instances of this on Stripe api documentation.

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.

name string

Cardholder name.

network string preview feature

Identifies which network this charge was processed on. Can be amex, diners, discover, interac, jcb, mastercard, unionpay, visa, or unknown.

networks hash

Contains information about card networks that can be used to process the payment.

available array containing strings

All available networks for the card.

preferred string

The preferred network for the card.

overcapture_supported boolean

Defines whether the authorized amount can be over-captured or not

preferred_locales string_array

EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.

read_method string

How were card details read in this transaction. Can be contact_emv, contactless_emv, magnetic_stripe_fallback, magnetic_stripe_track2, or contactless_magstripe_mode

receipt hash

A collection of fields required to be displayed on receipts. Only required for EMV transactions.

account_type string

The type of account being debited or credited

application_cryptogram string

EMV tag 9F26, cryptogram generated by the integrated circuit chip.

application_preferred_name string

Mnenomic of the Application Identifier.

authorization_code string

Identifier for this transaction.

authorization_response_code string

EMV tag 8A. A code returned by the card issuer.

cardholder_verification_method string

How the cardholder verified ownership of the card.

dedicated_file_name string

EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.

terminal_verification_results string

The outcome of a series of EMV functions performed by the card reader.

transaction_status_information string

An indication of various EMV functions performed during the transaction.

recipient string (expandable)

The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead.

Since 2017, Stripe recipients have been replaced by Stripe accounts: https://stripe.com/docs/connect/recipient-account-migrations

So this is a Stripe account id, or if expanded, a Net::API::Stripe::Connect::Account object.

reference string

The unique reference of the mandate.

request_extended_authorization

Request ability to capture this payment beyond the standard authorization validity window

request_incremental_authorization_support

Request ability to increment this PaymentIntent if the combination of MCC and card brand is eligible. Check incremental_authorization_supported in the Confirm response to verify support.

request_three_d_secure string

We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and other requirements. However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: automatic or any. If not provided, defaults to automatic. Read our guide on manually requesting 3D Secure for more information on how this configuration interacts with Radar and our SCA Engine.

status string

For external accounts, possible values are new and errored. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated.

three_d_secure hash

Populated if this transaction used 3D Secure authentication.

This is an objectified hash reference, ie its key / value pairs can be accessed as virtual methods. It uses the virtal package Net::API::Stripe::Payment::3DSecure

authenticated boolean

Whether or not authentication was performed. 3D Secure will succeed without authentication when the card is not enrolled.

authentication_flow string

For authenticated transactions: how the customer was authenticated by the issuing bank.

result string

Indicates the outcome of 3D Secure authentication.

result_reason string

Additional information about why 3D Secure succeeded or failed based on the result.

succeeded boolean

Whether or not 3D Secure succeeded.

version string

The version of 3D Secure that was used for this payment.

three_d_secure_usage hash

Contains details on how this Card maybe be used for 3D Secure authentication.

This is a virtual Net::API::Stripe::Payment::3DUsage object ie whereby each key can be accessed as methods.

supported boolean

Whether 3D Secure is supported on this card.

tokenization_method string

If the card number is tokenized, this is the method that was used. Can be apple_pay or google_pay.

url string

The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively.

wallet hash

If this Card is part of a card wallet, this contains the details of the card wallet.

It has the following properties:

amex_express_checkout hash

If this is a amex_express_checkout card wallet, this hash contains details about the wallet.

amex_express_checkout

This is an empty hash.

apple_pay hash

If this is a apple_pay card wallet, this hash contains details about the wallet.

apple_pay

This is an empty hash.

dynamic_last4 string

(For tokenized numbers only.) The last four digits of the device account number.

google_pay hash

If this is a google_pay card wallet, this hash contains details about the wallet.

google_pay

This is an empty hash.

masterpass hash

If this is a masterpass card wallet, this hash contains details about the wallet.

billing_address hash

Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.

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

email string

Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.

name string

Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.

shipping_address hash

Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.

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

samsung_pay hash

If this is a samsung_pay card wallet, this hash contains details about the wallet.

samsung_pay

This is an empty hash.

type string

The type of the card wallet, one of amex_express_checkout, apple_pay, google_pay, masterpass, samsung_pay, or visa_checkout. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.

visa_checkout hash

If this is a visa_checkout card wallet, this hash contains details about the wallet.

billing_address hash

Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.

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

email string

Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.

name string

Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.

shipping_address hash

Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.

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

API SAMPLE

    {
      "id": "card_fake123456789",
      "object": "card",
      "address_city": null,
      "address_country": null,
      "address_line1": null,
      "address_line1_check": null,
      "address_line2": null,
      "address_state": null,
      "address_zip": null,
      "address_zip_check": null,
      "brand": "Visa",
      "country": "US",
      "customer": null,
      "cvc_check": null,
      "dynamic_last4": null,
      "exp_month": 8,
      "exp_year": 2020,
      "fingerprint": "lkavkajndvkdvnj",
      "funding": "credit",
      "last4": "4242",
      "metadata": {},
      "name": null,
      "tokenization_method": null
    }

HISTORY

v0.1

Initial version

v0.2

Added the method address to make it easy to pass a Net::API::Stripe::Address object or an hash reference to populate automatically the properties address_line1, address_line2, address_city, address_zip and address_country

STRIPE HISTORY

2018-01-23

When being viewed by a platform, cards and bank accounts created on behalf of connected accounts will have a fingerprint that is universal across all connected accounts. For accounts that are not connect platforms, there will be no change.

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/external_account_cards/object, https://stripe.com/docs/connect/payouts

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.