Class: Zazu::Resources::CheckoutSessions

Inherits:
Base
  • Object
show all
Defined in:
lib/zazu/resources/checkout_sessions.rb

Overview

One-off hosted checkout sessions. Pre-API there’s no list, update, or delete — sessions are created and inspected by id. State (‘open`, `processing`, `complete`, `expired`) transitions are read-only from the SDK’s perspective.

Constant Summary

Constants inherited from Base

Base::MAX_PER_PAGE

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Zazu::Resources::Base

Instance Method Details

#create(**attributes) ⇒ Object

POST /api/checkout_sessions

Parameters:

  • attributes (Hash)

    checkout-session attributes — see API docs. Required: account_id, amount, success_url. Optional: metadata, customer_email, cancel_url, description, expires_at.



20
21
22
# File 'lib/zazu/resources/checkout_sessions.rb', line 20

def create(**attributes)
  http_post("api/checkout_sessions", body: attributes)
end

#get(id) ⇒ Object

GET /api/checkout_sessions/:id



11
12
13
# File 'lib/zazu/resources/checkout_sessions.rb', line 11

def get(id)
  http_get(encode_path("api/checkout_sessions", id))
end