The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::API::Stripe::Payment::Source - A Stripe Payment Source Object

SYNOPSIS

    my $source = $stripe->source({
        account => $account_object,
        account_holder_name => 'John Doe',
        account_holder_type => 'individual',
        active => $stripe->true,
        # Or maybe more simply you 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_state => undef,
        address_zip => '123-4567',
        address_country => 'jp',
        amount => 2000,
        brand => 'Visa',
        card => $card_object,
        country => 'jp',
        currency => 'jpy',
        description => 'Primary source for customer',
        email => 'john.doe@example.com',
        exp_month => 4,
        exp_year => 2030,
        funding => 'debit',
        metadata => { transaction_id => 123, customer_id => 456 },
        name => 'John Doe',
        statement_descriptor => 'Big Corp Services',
        type => 'card',
    });

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

VERSION

    v0.100.0

DESCRIPTION

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Stripe states this approach for card is deprecated in favour or PaymentIntent: https://stripe.com/docs/sources/cards

CONSTRUCTOR

new( %ARG )

Creates a new Net::API::Stripe::Payment::Source object.

METHODS

id string

Unique identifier for the object.

object string, value is "source"

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

account_holder_name string

The name of the person or business that owns the bank account.

account_holder_type string

The type of entity that holds the account. This can be either individual or company.

ach_credit_transfer

If type is set to ach_credit_transfer, this is a Net::API::Stripe::Payment::Source::ACHCreditTransfer object.

It is not very clear in the Stripe API, but in the type property, they mention "An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method (https://stripe.com/docs/sources) used." :/

ach_debit

If type is set to ach_debit, this is a Net::API::Stripe::Payment::Source::ACHDebit object.

It is not very clear in the Stripe API, but in the type property, they mention "An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method (https://stripe.com/docs/sources) used." :/

active boolean

True when this bitcoin receiver has received a non-zero amount of bitcoin.

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 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.

alipay

If type is set to alipay, this is a Net::API::Stripe::Payment::Method::Details::Alipay object.

amount integer

A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources.

amount_received positive integer or zero

The amount of currency to which bitcoin_amount_received has been converted.

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.

bancontact

If type is set to bancontact, this is a Net::API::Stripe::Payment::Method::Details::BanContact object.

bank_name string

Name of the bank associated with the routing number (e.g., WELLS FARGO).

bitcoin_amount positive integer

The amount of bitcoin that the customer should send to fill the receiver. The bitcoin_amount is denominated in Satoshi: there are 10^8 Satoshi in one bitcoin.

bitcoin_amount_received positive integer or zero

The amount of bitcoin that has been sent by the customer to this receiver.

bitcoin_uri string

This URI can be displayed to the customer as a clickable link (to activate their bitcoin client) or as a QR code (for mobile wallets).

brand string

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

card object

If type is set to card, this is a Net::API::Stripe::Payment::Card object. See also https://stripe.com/docs/sources/cards.

card_present

If type is set to card_present, this is a Net::API::Stripe::Payment::Method::Details::CardPresent object.

client_secret string

The client secret of the source. Used for client-side retrieval using a publishable key.

code_verification hash

Information related to the code verification flow. Present if the source is authenticated by a verification code (flow is code_verification).

This is a Net::API::Stripe::Payment::Source::CodeVerification object.

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.

created timestamp

Time at which the object was created. Measured in seconds since the Unix epoch.

currency currency

Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources.

customer string

The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. If it is expanded, this would be a Net::API::Stripe::Customer object.

cvc_check string

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

description string

An arbitrary string attached to the object. Often useful for displaying to users.

dynamic_last4 string

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

email string

The customer’s email address, set by the API call that creates the receiver.

eps

If type is set to eps, this is a Net::API::Stripe::Payment::Method::Details::EPS object.

exp_month integer

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

exp_year integer

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

filled boolean

This flag is initially false and updates to true when the customer sends the bitcoin_amount to this receiver.

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.

flow string

The authentication flow of the source. flow is one of redirect, receiver, code_verification, none.

livemode boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

funding string

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

giropay

If type is set to giropay, this is a Net::API::Stripe::Payment::Method::Details::Giropay object.

ideal

If type is set to ideal, this is a Net::API::Stripe::Payment::Method::Details::Ideal object.

inbound_address string

A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver.

klarna

If type is set to klarna, this is a Net::API::Stripe::Payment::Method::Details::Klarna object.

last4 string

The last four digits of the card.

livemode boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

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.

multibanco

If type is set to multibanco, this is a Net::API::Stripe::Payment::Method::Details::MultiBanco object.

name string

Cardholder name.

p24

If type is set to p24, this is a Net::API::Stripe::Payment::Method::Details::P24 object.

payment string

The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key.

owner hash

Information about the owner of the payment instrument that may be used or required by particular source types.

This is a Net::API::Stripe::Payment::Source::Owner object.

payment_amount positive integer

If the Alipay account object is not reusable, the exact amount that you can create a charge for.

payment_currency currency

If the Alipay account object is not reusable, the exact currency that you can create a charge for.

receiver hash

Information related to the receiver flow. Present if the source is a receiver (flow is receiver).

This is a Net::API::Stripe::Payment::Source::Receiver object.

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.

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

redirect hash

Information related to the redirect flow. Present if the source is authenticated by a redirect (flow is redirect).

This is a Net::API::Stripe::Payment::Source::Redirect object.

reusable boolean

True if you can create multiple payments using this account. If the account is reusable, then you can freely choose the amount of each payment.

refund_address string

The refund address of this bitcoin receiver.

routing_number string

The routing transit number for the bank account.

sofort hash

If type is set to sofort, this is a Net::API::Stripe::Payment::Details::Sofort virtual object, ie it is created dynamically by "set_get_hash_as_object" in Nodule::Generic

source_order hash

Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. This is a Net::API::Stripe::Order object.

amount integer

A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.

currency currency

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

email string

The email address of the customer placing the order.

items array of hashes

List of items constituting the order. This is an array of Net::API::Stripe::Order::Item objects.

shipping hash

The shipping address for the order. Present if the order is for goods to be shipped. This is a Net::API::Stripe::Shipping object

statement_descriptor string

Extra information about a source. This will appear on your customer’s statement every time you charge the source.

status string

The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge.

stripe_account

If type is set to stripe_account, this is a Net::API::Stripe::Payment::Method::Details::StripeAccount object.

tokenization_method string

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

transactions

A list (Net::API::Stripe::List) of Net::API::Stripe::Bitcoin::Transaction object

type string

The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method (https://stripe.com/docs/sources) used.

uncaptured_funds boolean

This receiver contains uncaptured funds that can be used for a payment or refunded.

usage string

Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.

used boolean

Whether this Alipay account object has ever been used for a payment.

used_for_payment boolean

Indicate if this source is used for payment.

username string

The username for the Alipay account.

wechat

If "type" is set to wechat, this is a Net::API::Stripe::Payment::Method::Details::WeChat object.

API SAMPLE

    {
      "id": "src_fake123456789",
      "object": "source",
      "ach_credit_transfer": {
        "account_number": "test_52796e3294dc",
        "routing_number": "110000000",
        "fingerprint": "anvbmbvmnbvmab",
        "bank_name": "TEST BANK",
        "swift_code": "TSTEZ122"
      },
      "amount": null,
      "client_secret": "src_client_secret_fake123456789",
      "created": 1571314413,
      "currency": "jpy",
      "flow": "receiver",
      "livemode": false,
      "metadata": {},
      "owner": {
        "address": null,
        "email": "jenny.rosen@example.com",
        "name": null,
        "phone": null,
        "verified_address": null,
        "verified_email": null,
        "verified_name": null,
        "verified_phone": null
      },
      "receiver": {
        "address": "121042882-38381234567890123",
        "amount_charged": 0,
        "amount_received": 0,
        "amount_returned": 0,
        "refund_attributes_method": "email",
        "refund_attributes_status": "missing"
      },
      "statement_descriptor": null,
      "status": "pending",
      "type": "ach_credit_transfer",
      "usage": "reusable"
    }

HISTORY

v0.1

Initial version

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/sources, https://stripe.com/docs/sources, https://stripe.com/docs/sources/customers

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.