zai_payment 1.3.2 → 2.0.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 → changelog.md} +38 -11
- data/{CONTRIBUTING.md → contributing.md} +4 -4
- data/docs/{AUTHENTICATION.md → authentication.md} +2 -2
- data/docs/items.md +666 -0
- data/docs/{USER_QUICK_REFERENCE.md → user_quick_reference.md} +6 -6
- data/docs/{WEBHOOK_SECURITY_QUICKSTART.md → webhook_security_quickstart.md} +1 -1
- data/examples/items.md +598 -0
- data/examples/users.md +69 -50
- data/{IMPLEMENTATION.md → implementation.md} +9 -9
- data/lib/zai_payment/resources/item.rb +363 -0
- data/lib/zai_payment/resources/user.rb +61 -23
- data/lib/zai_payment/response.rb +6 -1
- data/lib/zai_payment/version.rb +1 -1
- data/lib/zai_payment.rb +6 -0
- data/{README.md → readme.md} +65 -19
- metadata +20 -17
- /data/{CODE_OF_CONDUCT.md → code_of_conduct.md} +0 -0
- /data/docs/{ARCHITECTURE.md → architecture.md} +0 -0
- /data/docs/{README.md → readme.md} +0 -0
- /data/docs/{USER_ID_FIELD.md → user_id_field.md} +0 -0
- /data/docs/{USERS.md → users.md} +0 -0
- /data/docs/{WEBHOOK_SIGNATURE.md → webhook_signature.md} +0 -0
- /data/docs/{WEBHOOKS.md → webhooks.md} +0 -0
- /data/{IMPLEMENTATION_SUMMARY.md → implementation_summary.md} +0 -0
data/{README.md → readme.md}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Zai Payment Ruby Library
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-
[](./
|
|
4
|
+
[](./code_of_conduct.md)
|
|
5
5
|
[](https://rubygems.org/gems/zai_payment)
|
|
6
6
|
[](https://github.com/Sentia/zai-payment/releases)
|
|
7
7
|
[](https://rubygems.org/gems/zai_payment)
|
|
8
8
|
[](https://github.com/Sentia/zai-payment/actions/workflows/ci.yml)
|
|
9
9
|

|
|
10
10
|

|
|
11
|
-
[](https://rubydoc.info/gems/zai_payment)
|
|
12
|
-
[](./
|
|
11
|
+
[](https://rubydoc.info/gems/zai_payment?refresh=true)
|
|
12
|
+
[](./contributing.md)
|
|
13
13
|
|
|
14
14
|
A lightweight and extensible Ruby client for the **Zai (AssemblyPay)** API — starting with secure OAuth2 authentication, and ready for Payments, Virtual Accounts, Webhooks, and more.
|
|
15
15
|
|
|
@@ -20,6 +20,7 @@ A lightweight and extensible Ruby client for the **Zai (AssemblyPay)** API — s
|
|
|
20
20
|
- 🔐 **OAuth2 Authentication** - Client Credentials flow with automatic token management
|
|
21
21
|
- 🧠 **Smart Token Caching** - Auto-refresh before expiration, thread-safe storage
|
|
22
22
|
- 👥 **User Management** - Create and manage payin (buyers) & payout (sellers) users
|
|
23
|
+
- 📦 **Item Management** - Full CRUD for transactions/payments between buyers and sellers
|
|
23
24
|
- 🪝 **Webhooks** - Full CRUD + secure signature verification (HMAC SHA256)
|
|
24
25
|
- ⚙️ **Environment-Aware** - Seamless Pre-live / Production switching
|
|
25
26
|
- 🧱 **Modular & Extensible** - Clean resource-based architecture
|
|
@@ -77,7 +78,7 @@ token = token_provider.bearer_token
|
|
|
77
78
|
|
|
78
79
|
The gem handles OAuth2 Client Credentials flow automatically - tokens are cached and refreshed before expiration.
|
|
79
80
|
|
|
80
|
-
📖 **<a href="docs/
|
|
81
|
+
📖 **<a href="docs/authentication.md">Complete Authentication Guide</a>** - Two approaches, examples, and best practices
|
|
81
82
|
|
|
82
83
|
### Users
|
|
83
84
|
|
|
@@ -99,7 +100,7 @@ response = ZaiPayment.users.create(
|
|
|
99
100
|
first_name: 'Jane',
|
|
100
101
|
last_name: 'Smith',
|
|
101
102
|
country: 'AUS',
|
|
102
|
-
dob: '
|
|
103
|
+
dob: '01/01/1990',
|
|
103
104
|
address_line1: '456 Market St',
|
|
104
105
|
city: 'Sydney',
|
|
105
106
|
state: 'NSW',
|
|
@@ -135,11 +136,53 @@ response = ZaiPayment.users.update('user_id', mobile: '+9876543210')
|
|
|
135
136
|
```
|
|
136
137
|
|
|
137
138
|
**📚 Documentation:**
|
|
138
|
-
- 📖 [User Management Guide](docs/
|
|
139
|
+
- 📖 [User Management Guide](docs/users.md) - Complete guide for payin and payout users
|
|
139
140
|
- 💡 [User Examples](examples/users.md) - Real-world usage patterns and Rails integration
|
|
140
141
|
- 🔗 [Zai: Onboarding a Payin User](https://developer.hellozai.com/docs/onboarding-a-pay-in-user)
|
|
141
142
|
- 🔗 [Zai: Onboarding a Payout User](https://developer.hellozai.com/docs/onboarding-a-pay-out-user)
|
|
142
143
|
|
|
144
|
+
### Items
|
|
145
|
+
|
|
146
|
+
Manage transactions/payments between buyers and sellers:
|
|
147
|
+
|
|
148
|
+
```ruby
|
|
149
|
+
# Create an item
|
|
150
|
+
response = ZaiPayment.items.create(
|
|
151
|
+
name: "Product Purchase",
|
|
152
|
+
amount: 10000, # Amount in cents ($100.00)
|
|
153
|
+
payment_type: 2, # Credit card
|
|
154
|
+
buyer_id: "buyer-123",
|
|
155
|
+
seller_id: "seller-456",
|
|
156
|
+
description: "Purchase of premium product",
|
|
157
|
+
currency: "AUD",
|
|
158
|
+
tax_invoice: true
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
# List items
|
|
162
|
+
response = ZaiPayment.items.list(limit: 20, offset: 0)
|
|
163
|
+
|
|
164
|
+
# Get item details
|
|
165
|
+
response = ZaiPayment.items.show('item_id')
|
|
166
|
+
|
|
167
|
+
# Update item
|
|
168
|
+
response = ZaiPayment.items.update('item_id', name: 'Updated Name')
|
|
169
|
+
|
|
170
|
+
# Get item status
|
|
171
|
+
response = ZaiPayment.items.show_status('item_id')
|
|
172
|
+
|
|
173
|
+
# Get buyer/seller details
|
|
174
|
+
response = ZaiPayment.items.show_buyer('item_id')
|
|
175
|
+
response = ZaiPayment.items.show_seller('item_id')
|
|
176
|
+
|
|
177
|
+
# List transactions
|
|
178
|
+
response = ZaiPayment.items.list_transactions('item_id')
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**📚 Documentation:**
|
|
182
|
+
- 📖 [Item Management Guide](docs/items.md) - Complete guide for creating and managing items
|
|
183
|
+
- 💡 [Item Examples](examples/items.md) - Real-world usage patterns and complete workflows
|
|
184
|
+
- 🔗 [Zai: Items API Reference](https://developer.hellozai.com/reference/listitems)
|
|
185
|
+
|
|
143
186
|
### Webhooks
|
|
144
187
|
|
|
145
188
|
Manage webhook endpoints:
|
|
@@ -163,9 +206,9 @@ ZaiPayment.webhooks.create_secret_key(secret_key: secret_key)
|
|
|
163
206
|
|
|
164
207
|
**📚 Documentation:**
|
|
165
208
|
- 📖 [Webhook Examples & Complete Guide](examples/webhooks.md) - Full CRUD operations and patterns
|
|
166
|
-
- 🔒 [Security Quick Start](docs/
|
|
167
|
-
- 🏗️ [Architecture & Implementation](docs/
|
|
168
|
-
- 🔐 [Signature Verification Details](docs/
|
|
209
|
+
- 🔒 [Security Quick Start](docs/webhook_security_quickstart.md) - 5-minute webhook security setup
|
|
210
|
+
- 🏗️ [Architecture & Implementation](docs/webhooks.md) - Detailed technical documentation
|
|
211
|
+
- 🔐 [Signature Verification Details](docs/webhook_signature.md) - Security implementation specs
|
|
169
212
|
|
|
170
213
|
### Error Handling
|
|
171
214
|
|
|
@@ -199,6 +242,7 @@ end
|
|
|
199
242
|
| ✅ Authentication | OAuth2 Client Credentials flow | Done |
|
|
200
243
|
| ✅ Webhooks | CRUD for webhook endpoints | Done |
|
|
201
244
|
| ✅ Users | Manage PayIn / PayOut users | Done |
|
|
245
|
+
| ✅ Items | Transactions/payments (CRUD) | Done |
|
|
202
246
|
| 💳 Payments | Single and recurring payments | 🚧 In progress |
|
|
203
247
|
| 🏦 Virtual Accounts (VA / PIPU) | Manage virtual accounts & PayTo | ⏳ Planned |
|
|
204
248
|
| 💼 Wallets | Create and manage wallet accounts | ⏳ Planned |
|
|
@@ -236,12 +280,12 @@ This will load the gem and all its dependencies, allowing you to experiment with
|
|
|
236
280
|
## 🧾 Versioning
|
|
237
281
|
This gem follows [Semantic Versioning](https://semver.org).
|
|
238
282
|
|
|
239
|
-
See [
|
|
283
|
+
See [changelog.md](./changelog.md) for release history.
|
|
240
284
|
|
|
241
285
|
|
|
242
286
|
## 🤝 Contributing
|
|
243
287
|
|
|
244
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/Sentia/zai-payment. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Sentia/zai-payment/blob/main/
|
|
288
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Sentia/zai-payment. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Sentia/zai-payment/blob/main/code_of_conduct.md).
|
|
245
289
|
|
|
246
290
|
## 🪪 License
|
|
247
291
|
|
|
@@ -249,27 +293,29 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
249
293
|
|
|
250
294
|
## Code of Conduct
|
|
251
295
|
|
|
252
|
-
Everyone interacting in the ZaiPayment project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Sentia/zai-payment/blob/main/
|
|
296
|
+
Everyone interacting in the ZaiPayment project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Sentia/zai-payment/blob/main/code_of_conduct.md).
|
|
253
297
|
|
|
254
298
|
## 📚 Documentation
|
|
255
299
|
|
|
256
300
|
### Getting Started
|
|
257
|
-
- [**Authentication Guide**](docs/
|
|
258
|
-
- [**User Management Guide**](docs/
|
|
301
|
+
- [**Authentication Guide**](docs/authentication.md) - Two approaches to getting tokens, automatic management
|
|
302
|
+
- [**User Management Guide**](docs/users.md) - Managing payin and payout users
|
|
303
|
+
- [**Item Management Guide**](docs/items.md) - Creating and managing transactions/payments
|
|
259
304
|
- [**Webhook Examples**](examples/webhooks.md) - Complete webhook usage guide
|
|
260
|
-
- [**Documentation Index**](docs/
|
|
305
|
+
- [**Documentation Index**](docs/readme.md) - Full documentation navigation
|
|
261
306
|
|
|
262
307
|
### Examples & Patterns
|
|
263
308
|
- [User Examples](examples/users.md) - Real-world user management patterns
|
|
309
|
+
- [Item Examples](examples/items.md) - Transaction and payment workflows
|
|
264
310
|
- [Webhook Examples](examples/webhooks.md) - Webhook integration patterns
|
|
265
311
|
|
|
266
312
|
### Technical Guides
|
|
267
|
-
- [Webhook Architecture](docs/
|
|
268
|
-
- [Architecture Overview](docs/
|
|
313
|
+
- [Webhook Architecture](docs/webhooks.md) - Technical implementation details
|
|
314
|
+
- [Architecture Overview](docs/architecture.md) - System architecture and design
|
|
269
315
|
|
|
270
316
|
### Security
|
|
271
|
-
- [Webhook Security Quick Start](docs/
|
|
272
|
-
- [Signature Verification](docs/
|
|
317
|
+
- [Webhook Security Quick Start](docs/webhook_security_quickstart.md) - 5-minute setup guide
|
|
318
|
+
- [Signature Verification](docs/webhook_signature.md) - Implementation details
|
|
273
319
|
|
|
274
320
|
### External Resources
|
|
275
321
|
- [Zai Developer Portal](https://developer.hellozai.com/)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zai_payment
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eddy Jaga
|
|
@@ -59,27 +59,28 @@ extensions: []
|
|
|
59
59
|
extra_rdoc_files: []
|
|
60
60
|
files:
|
|
61
61
|
- ".yardopts"
|
|
62
|
-
- CHANGELOG.md
|
|
63
|
-
- CODE_OF_CONDUCT.md
|
|
64
|
-
- CONTRIBUTING.md
|
|
65
|
-
- IMPLEMENTATION.md
|
|
66
|
-
- IMPLEMENTATION_SUMMARY.md
|
|
67
62
|
- LICENSE.txt
|
|
68
|
-
- README.md
|
|
69
63
|
- Rakefile
|
|
70
64
|
- badges/.gitkeep
|
|
71
65
|
- badges/coverage.json
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
- docs/
|
|
76
|
-
- docs/
|
|
77
|
-
- docs/
|
|
78
|
-
- docs/
|
|
79
|
-
- docs/
|
|
80
|
-
- docs/
|
|
66
|
+
- changelog.md
|
|
67
|
+
- code_of_conduct.md
|
|
68
|
+
- contributing.md
|
|
69
|
+
- docs/architecture.md
|
|
70
|
+
- docs/authentication.md
|
|
71
|
+
- docs/items.md
|
|
72
|
+
- docs/readme.md
|
|
73
|
+
- docs/user_id_field.md
|
|
74
|
+
- docs/user_quick_reference.md
|
|
75
|
+
- docs/users.md
|
|
76
|
+
- docs/webhook_security_quickstart.md
|
|
77
|
+
- docs/webhook_signature.md
|
|
78
|
+
- docs/webhooks.md
|
|
79
|
+
- examples/items.md
|
|
81
80
|
- examples/users.md
|
|
82
81
|
- examples/webhooks.md
|
|
82
|
+
- implementation.md
|
|
83
|
+
- implementation_summary.md
|
|
83
84
|
- lib/zai_payment.rb
|
|
84
85
|
- lib/zai_payment/auth/token_provider.rb
|
|
85
86
|
- lib/zai_payment/auth/token_store.rb
|
|
@@ -87,10 +88,12 @@ files:
|
|
|
87
88
|
- lib/zai_payment/client.rb
|
|
88
89
|
- lib/zai_payment/config.rb
|
|
89
90
|
- lib/zai_payment/errors.rb
|
|
91
|
+
- lib/zai_payment/resources/item.rb
|
|
90
92
|
- lib/zai_payment/resources/user.rb
|
|
91
93
|
- lib/zai_payment/resources/webhook.rb
|
|
92
94
|
- lib/zai_payment/response.rb
|
|
93
95
|
- lib/zai_payment/version.rb
|
|
96
|
+
- readme.md
|
|
94
97
|
- sig/zai_payment.rbs
|
|
95
98
|
homepage: https://github.com/Sentia/zai-payment
|
|
96
99
|
licenses:
|
|
@@ -117,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
117
120
|
- !ruby/object:Gem::Version
|
|
118
121
|
version: '0'
|
|
119
122
|
requirements: []
|
|
120
|
-
rubygems_version: 3.
|
|
123
|
+
rubygems_version: 3.7.1
|
|
121
124
|
specification_version: 4
|
|
122
125
|
summary: Ruby gem for Zai payment integration
|
|
123
126
|
test_files: []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/data/docs/{USERS.md → users.md}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|