Net::API::Stripe::Checkout::Session - A Stripe Checkout Session Object
my $session = $stripe->session({ # This easy to implement with Net::API::REST cancel_url => 'https://api.example.com/v1/stripe/cancel', success_url => 'https://api.example.com/v1/stripe/success', client_reference_id => '1F7F749C-D9C9-46EB-B692-986628BD7302', customer => $customer_object, customer_email => 'john.doe@example.com', # Japanese please locale => 'ja', mode => 'subscription', payment_intent => $payment_intent_object, submit_type => 'pay', subscription => $subscription_object, });
v0.100.0
A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout (https://stripe.com/docs/payments/checkout). Stripe recommends creating a new Session each time your customer attempts to pay.
Once payment is successful, the Checkout Session will contain a reference to the Customer (Net::API::Stripe::Customer / https://stripe.com/docs/api/customers), and either the successful PaymentIntent (Net::API::Stripe::Payment::Intent / https://stripe.com/docs/api/payment_intents) or an active Subscription (Net::API::Stripe::Billing::Subscription / https://stripe.com/docs/api/subscriptions).
You can create a Checkout Session on your server and pass its ID to the client to begin Checkout.
Creates a new Net::API::Stripe::Checkout::Session object.
Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js.
String representing the object’s type. Objects of the same type share the same value.
The value (auto or required) for whether Checkout collected the customer’s billing address.
The URL the customer will be directed to if they decide to cancel payment and return to your website.
This is a URI object.
A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems.
The ID of the customer for this session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the session unless an existing customer was provided when the session was created.
When expanded, this is a Net::API::Stripe::Customer object.
If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once a session is complete, use the customer field.
The line items, plans, or SKUs purchased by the customer.
This is an array of Net::API::Stripe::Checkout::Item objects.
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser’s locale is used.
The mode of the Checkout Session, one of payment, setup, or subscription.
The ID of the PaymentIntent for Checkout Sessions in payment mode. If it is expanded, it contains a Net::API::Stripe::Payment::Intent object.
A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in payment mode.
This is a Net::API::Stripe::Payment::Intent object and used to create a checkout session.
A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
The ID of the SetupIntent for Checkout Sessions in setup mode.
When expanded, this is a Net::API::Stripe::Payment::Intent object.
A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in setup mode.
Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. Supported values are auto, book, donate, or pay.
The ID of the subscription for Checkout Sessions in subscription mode. If it is expanded, this is the Net::API::Stripe::Billing::Subscription object.
A subset of parameters to be passed to subscription creation for Checkout Sessions in subscription mode.
This is a Net::API::Stripe::Billing::Subscription object and used to create a checkout session.
The URL the customer will be directed to after the payment or subscription creation is successful.
{ "id": "cs_test_ksjfkjfkljslfkjlfkflsfklskflskflskfs", "object": "checkout.session", "billing_address_collection": null, "cancel_url": "https://example.com/cancel", "client_reference_id": null, "customer": null, "customer_email": null, "display_items": [ { "amount": 1500, "currency": "usd", "custom": { "description": "Comfortable cotton t-shirt", "images": null, "name": "T-shirt" }, "quantity": 2, "type": "custom" } ], "livemode": false, "locale": null, "mode": null, "payment_intent": "pi_fake123456789", "payment_method_types": [ "card" ], "setup_intent": null, "submit_type": null, "subscription": null, "success_url": "https://example.com/success" }
Initial version
Jacques Deguest <jack@deguest.jp>
Stripe API documentation:
https://stripe.com/docs/api/checkout/sessions, https://stripe.com/docs/payments/checkout/api
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.
To install Net::API::Stripe, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::API::Stripe
CPAN shell
perl -MCPAN -e shell install Net::API::Stripe
For more information on module installation, please visit the detailed CPAN module installation guide.