Class: Stripe::Checkout::SessionService::UpdateParams

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/checkout/session_service.rb

Defined Under Namespace

Classes: CollectedInformation, Discount, LineItem, ShippingOption, SubscriptionData

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(collected_information: nil, discounts: nil, expand: nil, line_items: nil, metadata: nil, shipping_options: nil, subscription_data: nil) ⇒ UpdateParams

Returns a new instance of UpdateParams.



2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
# File 'lib/stripe/services/checkout/session_service.rb', line 2786

def initialize(
  collected_information: nil,
  discounts: nil,
  expand: nil,
  line_items: nil,
  metadata: nil,
  shipping_options: nil,
  subscription_data: nil
)
  @collected_information = collected_information
  @discounts = discounts
  @expand = expand
  @line_items = line_items
  @metadata = 
  @shipping_options = shipping_options
  @subscription_data = subscription_data
end

Instance Attribute Details

#collected_informationObject

Information about the customer collected within the Checkout Session. Can only be set when updating ‘embedded` or `custom` sessions.



2760
2761
2762
# File 'lib/stripe/services/checkout/session_service.rb', line 2760

def collected_information
  @collected_information
end

#discountsObject

List of coupons and promotion codes attached to the Checkout Session.



2762
2763
2764
# File 'lib/stripe/services/checkout/session_service.rb', line 2762

def discounts
  @discounts
end

#expandObject

Specifies which fields in the response should be expanded.



2764
2765
2766
# File 'lib/stripe/services/checkout/session_service.rb', line 2764

def expand
  @expand
end

#line_itemsObject

A list of items the customer is purchasing.

When updating line items, you must retransmit the entire array of line items.

To retain an existing line item, specify its ‘id`.

To update an existing line item, specify its ‘id` along with the new values of the fields to update.

To add a new line item, specify one of ‘price` or `price_data` and `quantity`.

To remove an existing line item, omit the line item’s ID from the retransmitted array.

To reorder a line item, specify it at the desired position in the retransmitted array.



2778
2779
2780
# File 'lib/stripe/services/checkout/session_service.rb', line 2778

def line_items
  @line_items
end

#metadataObject

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.



2780
2781
2782
# File 'lib/stripe/services/checkout/session_service.rb', line 2780

def 
  @metadata
end

#shipping_optionsObject

The shipping rate options to apply to this Session. Up to a maximum of 5.



2782
2783
2784
# File 'lib/stripe/services/checkout/session_service.rb', line 2782

def shipping_options
  @shipping_options
end

#subscription_dataObject

A subset of parameters to be passed to subscription creation for Checkout Sessions in ‘subscription` mode.



2784
2785
2786
# File 'lib/stripe/services/checkout/session_service.rb', line 2784

def subscription_data
  @subscription_data
end