zazu-ruby 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +10 -0
- data/lib/zazu/client.rb +4 -0
- data/lib/zazu/resources/checkout_sessions.rb +25 -0
- data/lib/zazu/version.rb +1 -1
- data/lib/zazu.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 620203d0346c1431c20e9cfad3069bf979422714bef0e742aa8e6842da1e1ef3
|
|
4
|
+
data.tar.gz: 2853e240e0ef39bf83ff1c56bc19baafee48fdf6e52ce8024d2a6eb3c01b740b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0cb5ff54711f427cea94cf92f89e2e8ac8e238296b918bcdbf840403cb12e7d967a782278bc65e4499c4bf402645bdb34a8f7605e4df66734459e77503ed9dd
|
|
7
|
+
data.tar.gz: 8cdb8f94525b4de4174d48f8d3e95a3ac13e558c2c9acca7626c32eaaf29d08dba4353850f20cf59a3cc1b755bc3de24bc797a98c6cf7abe0af94bd1917c7081
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `Zazu::Resources::CheckoutSessions` — `create` and `get` for one-off
|
|
13
|
+
hosted checkout sessions. Status enum: `open`, `processing`,
|
|
14
|
+
`complete`, `expired` (read-only — no API to mutate). No list, no
|
|
15
|
+
update, no delete; sessions are addressed by their `cs_…` id.
|
|
16
|
+
|
|
10
17
|
## [0.1.0]
|
|
11
18
|
|
|
12
19
|
Initial release.
|
data/README.md
CHANGED
|
@@ -69,6 +69,16 @@ zazu.payment_links.create(
|
|
|
69
69
|
)
|
|
70
70
|
zazu.payment_links.cancel("01a0...")
|
|
71
71
|
|
|
72
|
+
zazu.checkout_sessions.create(
|
|
73
|
+
account_id: "019dde7d-...",
|
|
74
|
+
amount: "1500.00",
|
|
75
|
+
success_url: "https://merchant.example.com/success?session_id={CHECKOUT_SESSION_ID}",
|
|
76
|
+
cancel_url: "https://merchant.example.com/cancel",
|
|
77
|
+
customer_email: "buyer@example.com",
|
|
78
|
+
metadata: { order_id: "ORD-123" }
|
|
79
|
+
)
|
|
80
|
+
zazu.checkout_sessions.get("cs_...")
|
|
81
|
+
|
|
72
82
|
zazu.webhook_endpoints.list
|
|
73
83
|
zazu.webhook_endpoints.create(
|
|
74
84
|
url: "https://example.com/webhooks/zazu",
|
data/lib/zazu/client.rb
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Zazu
|
|
4
|
+
module Resources
|
|
5
|
+
# One-off hosted checkout sessions. Pre-API there's no list,
|
|
6
|
+
# update, or delete — sessions are created and inspected by id.
|
|
7
|
+
# State (`open`, `processing`, `complete`, `expired`) transitions
|
|
8
|
+
# are read-only from the SDK's perspective.
|
|
9
|
+
class CheckoutSessions < Base
|
|
10
|
+
# GET /api/checkout_sessions/:id
|
|
11
|
+
def get(id)
|
|
12
|
+
http_get(encode_path("api/checkout_sessions", id))
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# POST /api/checkout_sessions
|
|
16
|
+
#
|
|
17
|
+
# @param attributes [Hash] checkout-session attributes — see API docs.
|
|
18
|
+
# Required: account_id, amount, success_url.
|
|
19
|
+
# Optional: metadata, customer_email, cancel_url, description, expires_at.
|
|
20
|
+
def create(**attributes)
|
|
21
|
+
http_post("api/checkout_sessions", body: attributes)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
data/lib/zazu/version.rb
CHANGED
data/lib/zazu.rb
CHANGED
|
@@ -22,6 +22,7 @@ require_relative "zazu/response"
|
|
|
22
22
|
require_relative "zazu/page"
|
|
23
23
|
require_relative "zazu/resources/base"
|
|
24
24
|
require_relative "zazu/resources/accounts"
|
|
25
|
+
require_relative "zazu/resources/checkout_sessions"
|
|
25
26
|
require_relative "zazu/resources/customers"
|
|
26
27
|
require_relative "zazu/resources/entity"
|
|
27
28
|
require_relative "zazu/resources/invoices"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zazu-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Zazu
|
|
@@ -69,6 +69,7 @@ files:
|
|
|
69
69
|
- lib/zazu/page.rb
|
|
70
70
|
- lib/zazu/resources/accounts.rb
|
|
71
71
|
- lib/zazu/resources/base.rb
|
|
72
|
+
- lib/zazu/resources/checkout_sessions.rb
|
|
72
73
|
- lib/zazu/resources/customers.rb
|
|
73
74
|
- lib/zazu/resources/entity.rb
|
|
74
75
|
- lib/zazu/resources/invoices.rb
|