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::Payment::Link - A Stripe Payment Link Object

SYNOPSIS

    my $link = $stripe->payment_link({
        active => $stripe->true,
        after_completion => 
        {
            hosted_confirmation => 
            {
            custom_message => $some_message,
            },
            redirect => 
            {
            url => 'https://example.org/some/where',
            },
            type => 'hosted_confirmation',
        },
        allow_promotion_codes => $stripe->true,
        application_fee_amount => 1000,
        application_fee_percent => 20,
        automatic_tax => { enabled => $stripe->true },
        billing_address_collection => {},
        line_items => {},
        livemode => $stripe->false,
        metadata => { tax_id => 123, customer_id => 456 },
        object => $object,
        on_behalf_of => $account,
        payment_method_types => 'card',
        phone_number_collection => { enabled => $stripe->true },
        shipping_address_collection => 
        {
        allowed_countries => [qw( JP US FR DE UK )],
        },
        subscription_data => { trial_period_days => 30 },
        transfer_data => 
        {
        amount => 10000,
        destination => 'acct_1234567890qwertyuiop',
        },
        url => 'https://buy.stripe.com/test_123456789qwertyuiop',
    });

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

VERSION

    v0.2.0

DESCRIPTION

A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times.

When a customer opens a payment link it will open a new checkout session to render the payment page. You can use checkout session events to track payments through payment links.

Related guide: Payment Links API.

CONSTRUCTOR

new

Creates a new Net::API::Stripe::Tax::Rate 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 "payment_link"

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

active boolean

Whether the payment link’s url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated.

after_completion hash

Behavior after the purchase is complete.

hosted_confirmation hash

Configuration when type=hosted_confirmation.

custom_message string

The custom message that is displayed to the customer after the purchase is complete.

redirect hash

Configuration when type=redirect.

url string

The URL the customer will be redirected to after the purchase is complete.

type enum

The specified behavior after the purchase is complete.

Possible enum values

redirect

Redirects the customer to the specified url after the purchase is complete.

hosted_confirmation

Displays a message on the hosted surface after the purchase is complete.

allow_promotion_codes boolean

Whether user redeemable promotion codes are enabled.

application_fee_amount integer

The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account.

application_fee_percent decimal

This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account.

automatic_tax hash

Configuration details for automatic tax collection.

enabled boolean

If true, tax will be calculated automatically using the customer’s location.

billing_address_collection enum

Configuration for collecting the customer’s billing address.

Possible enum values

auto Default

Checkout will only collect the billing address when necessary.

required

Checkout will always collect the customer’s billing address.

currency currency

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

line_items list

The line items representing what is being sold.

This field is not included by default. To include it in the response, expand the line_items field.

object string, value is "list"

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

data array of hashes

Details about each object.

has_more boolean

True if this list has another page of items after this one that can be fetched.

url string

The URL where this list can be accessed.

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.

on_behalf_of string expandable

The account on behalf of which to charge. See the Connect documentation for details.

payment_method_collection string

Configuration for collecting a payment method during checkout.

payment_method_types array of enum values

The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you’ve enabled in your payment method settings.

Possible enum values: card

phone_number_collection hash

Controls phone number collection settings during checkout.

enabled boolean

If true, a phone number will be collected during checkout.

shipping_address_collection hash

Configuration for collecting the customer’s shipping address.

shipping_address_collection.allowed_countries array of enum values

An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI.

subscription_data object

When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data.

This is a Net::API::Stripe::Billing::Subscription object.

transfer_data hash

The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.

amount integer

The amount in JPY that will be transferred to the destination account. By default, the entire amount is transferred to the destination.

destination string

The connected account receiving the transfer.

url

The public URL that can be shared with customers.

API SAMPLE

    {
      "id": "plink_1234567890qwertyuiop",
      "object": "payment_link",
      "active": true,
      "after_completion": {
        "hosted_confirmation": {
          "custom_message": null
        },
        "type": "hosted_confirmation"
      },
      "allow_promotion_codes": false,
      "application_fee_amount": null,
      "application_fee_percent": null,
      "automatic_tax": {
        "enabled": false
      },
      "billing_address_collection": "auto",
      "livemode": false,
      "metadata": {},
      "on_behalf_of": null,
      "payment_method_types": null,
      "phone_number_collection": {
        "enabled": false
      },
      "shipping_address_collection": null,
      "subscription_data": null,
      "transfer_data": null,
      "url": "https://buy.stripe.com/test_1234567890qwertyuiop"
    }

HISTORY

v0.1.0

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/payment_links/payment_links/object#payment_link_object

COPYRIGHT & LICENSE

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

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