Class: Stripe::Checkout::SessionCreateParams::Permissions

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/checkout/session_create_params.rb

Defined Under Namespace

Classes: Update

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(update: nil, update_discounts: nil, update_line_items: nil, update_shipping_details: nil) ⇒ Permissions

Returns a new instance of Permissions.



2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
# File 'lib/stripe/params/checkout/session_create_params.rb', line 2052

def initialize(
  update: nil,
  update_discounts: nil,
  update_line_items: nil,
  update_shipping_details: nil
)
  @update = update
  @update_discounts = update_discounts
  @update_line_items = update_line_items
  @update_shipping_details = update_shipping_details
end

Instance Attribute Details

#updateObject

Permissions for updating the Checkout Session.



2034
2035
2036
# File 'lib/stripe/params/checkout/session_create_params.rb', line 2034

def update
  @update
end

#update_discountsObject

Determines which entity is allowed to update the discounts (coupons or promotion codes) that apply to this session.

Default is ‘client_only`. Stripe Checkout client will automatically handle discount updates. If set to `server_only`, only your server is allowed to update discounts.



2038
2039
2040
# File 'lib/stripe/params/checkout/session_create_params.rb', line 2038

def update_discounts
  @update_discounts
end

#update_line_itemsObject

Determines which entity is allowed to update the line items.

Default is ‘client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items.

When set to ‘server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API.



2044
2045
2046
# File 'lib/stripe/params/checkout/session_create_params.rb', line 2044

def update_line_items
  @update_line_items
end

#update_shipping_detailsObject

Determines which entity is allowed to update the shipping details.

Default is ‘client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details.

When set to ‘server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API.



2050
2051
2052
# File 'lib/stripe/params/checkout/session_create_params.rb', line 2050

def update_shipping_details
  @update_shipping_details
end