zazu-ruby 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 620203d0346c1431c20e9cfad3069bf979422714bef0e742aa8e6842da1e1ef3
4
- data.tar.gz: 2853e240e0ef39bf83ff1c56bc19baafee48fdf6e52ce8024d2a6eb3c01b740b
3
+ metadata.gz: 71bc6633249ecc429eb365ac5421ec4877d05f51f0b9b96bbcb1e45d8b65eaae
4
+ data.tar.gz: eea60136a9acaea0d9cbade450c6a8e08893c30c4258605d7242b396d4b6d06f
5
5
  SHA512:
6
- metadata.gz: e0cb5ff54711f427cea94cf92f89e2e8ac8e238296b918bcdbf840403cb12e7d967a782278bc65e4499c4bf402645bdb34a8f7605e4df66734459e77503ed9dd
7
- data.tar.gz: 8cdb8f94525b4de4174d48f8d3e95a3ac13e558c2c9acca7626c32eaaf29d08dba4353850f20cf59a3cc1b755bc3de24bc797a98c6cf7abe0af94bd1917c7081
6
+ metadata.gz: b62cd7f7eba2cd18e82d6b3d464a7aa9abf86d9047d9bca26627788eef33714d6defd64cba0842a75cdae9d3290e25cad9b3f9a89adbb8a8d08daa727d78d1d3
7
+ data.tar.gz: e5aa06c535d57287791b49e0a22f9c9a9f9b9df146ed9e53784bf2637950f00dc742b4d386fe5b42c991a7c77b0921ada67a3f18710f8ef1337660419adffb3c
data/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.1]
11
+
12
+ ### Added
13
+
14
+ - `Zazu::Resources::TransferDrafts` — `create` and `get`. Creating a
15
+ draft routes it into the workspace's in-app approval flow; the API
16
+ never executes a transfer itself. Lifecycle: `requested` →
17
+ `processing` → `completed` / `failed`.
18
+ - `Zazu::Resources::Beneficiaries` — `list` and `get`, the read-only
19
+ recipient directory (each beneficiary embeds its bank accounts;
20
+ the `default` one is used when a transfer names only the
21
+ beneficiary_id).
22
+ - Fixture seeding: `discover_beneficiary_id!` + `seed_transfer_draft!`.
23
+ The transfer_drafts/beneficiaries cassettes in this release are
24
+ hand-authored against the documented contract; re-record via
25
+ `rake fixtures:record` once the endpoints are live on staging.
26
+
27
+ ## [0.2.0]
28
+
10
29
  ### Added
11
30
 
12
31
  - `Zazu::Resources::CheckoutSessions` — `create` and `get` for one-off
data/lib/zazu/client.rb CHANGED
@@ -45,6 +45,10 @@ module Zazu
45
45
  @accounts ||= Resources::Accounts.new(self)
46
46
  end
47
47
 
48
+ def beneficiaries
49
+ @beneficiaries ||= Resources::Beneficiaries.new(self)
50
+ end
51
+
48
52
  def checkout_sessions
49
53
  @checkout_sessions ||= Resources::CheckoutSessions.new(self)
50
54
  end
@@ -65,6 +69,10 @@ module Zazu
65
69
  @payment_links ||= Resources::PaymentLinks.new(self)
66
70
  end
67
71
 
72
+ def transfer_drafts
73
+ @transfer_drafts ||= Resources::TransferDrafts.new(self)
74
+ end
75
+
68
76
  def webhook_endpoints
69
77
  @webhook_endpoints ||= Resources::WebhookEndpoints.new(self)
70
78
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zazu
4
+ module Resources
5
+ # Read-only directory of saved transfer recipients. Each
6
+ # beneficiary embeds its bank accounts; the one flagged `default`
7
+ # is used when a transfer names only the beneficiary_id.
8
+ # Beneficiaries are created and managed in the Zazu dashboard.
9
+ class Beneficiaries < Base
10
+ # GET /api/beneficiaries
11
+ def list(limit: MAX_PER_PAGE, cursor: nil)
12
+ list_page("api/beneficiaries", limit: limit, cursor: cursor)
13
+ end
14
+
15
+ # GET /api/beneficiaries/:id
16
+ def get(id)
17
+ http_get(encode_path("api/beneficiaries", id))
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zazu
4
+ module Resources
5
+ # API-initiated transfers. Creating a draft routes it into the
6
+ # workspace's in-app approval flow — the API never executes a
7
+ # transfer itself. A manager or legal representative approves in
8
+ # the Zazu app; poll {#get} (status: requested → processing →
9
+ # completed / failed) or subscribe to the `transfer.executed`
10
+ # webhook to follow execution.
11
+ class TransferDrafts < Base
12
+ # POST /api/transfer_drafts
13
+ #
14
+ # Required: account_id, amount, and exactly one of beneficiary_id
15
+ # (external transfer) or destination_account_id (own-account move).
16
+ # Optional: external_account_id, currency_code, payment_reference,
17
+ # internal_notes.
18
+ def create(**attributes)
19
+ http_post("api/transfer_drafts", body: attributes)
20
+ end
21
+
22
+ # GET /api/transfer_drafts/:id
23
+ def get(id)
24
+ http_get(encode_path("api/transfer_drafts", id))
25
+ end
26
+ end
27
+ end
28
+ end
data/lib/zazu/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zazu
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/zazu.rb CHANGED
@@ -22,10 +22,12 @@ 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/beneficiaries"
25
26
  require_relative "zazu/resources/checkout_sessions"
26
27
  require_relative "zazu/resources/customers"
27
28
  require_relative "zazu/resources/entity"
28
29
  require_relative "zazu/resources/invoices"
29
30
  require_relative "zazu/resources/payment_links"
31
+ require_relative "zazu/resources/transfer_drafts"
30
32
  require_relative "zazu/resources/webhook_endpoints"
31
33
  require_relative "zazu/client"
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zazu
@@ -69,11 +69,13 @@ 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/beneficiaries.rb
72
73
  - lib/zazu/resources/checkout_sessions.rb
73
74
  - lib/zazu/resources/customers.rb
74
75
  - lib/zazu/resources/entity.rb
75
76
  - lib/zazu/resources/invoices.rb
76
77
  - lib/zazu/resources/payment_links.rb
78
+ - lib/zazu/resources/transfer_drafts.rb
77
79
  - lib/zazu/resources/webhook_endpoints.rb
78
80
  - lib/zazu/response.rb
79
81
  - lib/zazu/version.rb