Class: Stripe::Checkout::SessionService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::Checkout::SessionService
- Defined in:
- lib/stripe/services/checkout/session_service.rb
Defined Under Namespace
Classes: CreateParams, ExpireParams, ListParams, RetrieveParams, UpdateParams
Instance Attribute Summary collapse
-
#line_items ⇒ Object
readonly
Returns the value of attribute line_items.
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
Creates a Checkout Session object.
-
#expire(session, params = {}, opts = {}) ⇒ Object
A Checkout Session can be expired when it is in one of these statuses: open.
-
#initialize(requestor) ⇒ SessionService
constructor
A new instance of SessionService.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of Checkout Sessions.
-
#retrieve(session, params = {}, opts = {}) ⇒ Object
Retrieves a Checkout Session object.
-
#update(session, params = {}, opts = {}) ⇒ Object
Updates a Checkout Session object.
Methods inherited from StripeService
Constructor Details
#initialize(requestor) ⇒ SessionService
Returns a new instance of SessionService.
9 10 11 12 |
# File 'lib/stripe/services/checkout/session_service.rb', line 9 def initialize(requestor) super @line_items = Stripe::Checkout::SessionLineItemService.new(@requestor) end |
Instance Attribute Details
#line_items ⇒ Object (readonly)
Returns the value of attribute line_items.
7 8 9 |
# File 'lib/stripe/services/checkout/session_service.rb', line 7 def line_items @line_items end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ Object
Creates a Checkout Session object.
2727 2728 2729 2730 2731 2732 2733 2734 2735 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2727 def create(params = {}, opts = {}) request( method: :post, path: "/v1/checkout/sessions", params: params, opts: opts, base_address: :api ) end |
#expire(session, params = {}, opts = {}) ⇒ Object
A Checkout Session can be expired when it is in one of these statuses: open
After it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
2740 2741 2742 2743 2744 2745 2746 2747 2748 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2740 def expire(session, params = {}, opts = {}) request( method: :post, path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(session) }), params: params, opts: opts, base_address: :api ) end |
#list(params = {}, opts = {}) ⇒ Object
Returns a list of Checkout Sessions.
2751 2752 2753 2754 2755 2756 2757 2758 2759 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2751 def list(params = {}, opts = {}) request( method: :get, path: "/v1/checkout/sessions", params: params, opts: opts, base_address: :api ) end |
#retrieve(session, params = {}, opts = {}) ⇒ Object
Retrieves a Checkout Session object.
2762 2763 2764 2765 2766 2767 2768 2769 2770 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2762 def retrieve(session, params = {}, opts = {}) request( method: :get, path: format("/v1/checkout/sessions/%<session>s", { session: CGI.escape(session) }), params: params, opts: opts, base_address: :api ) end |
#update(session, params = {}, opts = {}) ⇒ Object
Updates a Checkout Session object.
Related guide: [Dynamically update Checkout](docs.stripe.com/payments/checkout/dynamic-updates)
2775 2776 2777 2778 2779 2780 2781 2782 2783 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2775 def update(session, params = {}, opts = {}) request( method: :post, path: format("/v1/checkout/sessions/%<session>s", { session: CGI.escape(session) }), params: params, opts: opts, base_address: :api ) end |