zai_payment 1.3.2 → 2.0.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.
@@ -1,15 +1,15 @@
1
1
  # Zai Payment Ruby Library
2
2
 
3
3
  ![GitHub License](https://img.shields.io/github/license/Sentia/zai-payment)
4
- [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-MIT-blue.svg)](./CODE_OF_CONDUCT.md)
4
+ [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-MIT-blue.svg)](./code_of_conduct.md)
5
5
  [![Gem Version](https://img.shields.io/gem/v/zai_payment.svg)](https://rubygems.org/gems/zai_payment)
6
6
  [![GitHub release](https://img.shields.io/github/release/Sentia/zai-payment.svg)](https://github.com/Sentia/zai-payment/releases)
7
7
  [![Gem](https://img.shields.io/gem/dt/zai_payment.svg)](https://rubygems.org/gems/zai_payment)
8
8
  [![CI](https://github.com/Sentia/zai-payment/actions/workflows/ci.yml/badge.svg)](https://github.com/Sentia/zai-payment/actions/workflows/ci.yml)
9
9
  ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FSentia%2Fzai-payment%2Fmain%2Fbadges%2Fcoverage.json)
10
10
  ![GitHub top language](https://img.shields.io/github/languages/top/Sentia/zai-payment)
11
- [![Documentation](https://img.shields.io/badge/docs-rubydoc.info-blue.svg)](https://rubydoc.info/gems/zai_payment)
12
- [![Contributing](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](./CONTRIBUTING.md)
11
+ [![Documentation](https://img.shields.io/badge/docs-rubydoc.info-blue.svg)](https://rubydoc.info/gems/zai_payment?refresh=true)
12
+ [![Contributing](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](./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/AUTHENTICATION.md">Complete Authentication Guide</a>** - Two approaches, examples, and best practices
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: '19900101',
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/USERS.md) - Complete guide for payin and payout users
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/WEBHOOK_SECURITY_QUICKSTART.md) - 5-minute webhook security setup
167
- - 🏗️ [Architecture & Implementation](docs/WEBHOOKS.md) - Detailed technical documentation
168
- - 🔐 [Signature Verification Details](docs/WEBHOOK_SIGNATURE.md) - Security implementation specs
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 [CHANGELOG.md](./CHANGELOG.md) for release history.
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/CODE_OF_CONDUCT.md).
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/CODE_OF_CONDUCT.md).
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/AUTHENTICATION.md) - Two approaches to getting tokens, automatic management
258
- - [**User Management Guide**](docs/USERS.md) - Managing payin and payout users
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/README.md) - Full documentation navigation
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/WEBHOOKS.md) - Technical implementation details
268
- - [Architecture Overview](docs/ARCHITECTURE.md) - System architecture and design
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/WEBHOOK_SECURITY_QUICKSTART.md) - 5-minute setup guide
272
- - [Signature Verification](docs/WEBHOOK_SIGNATURE.md) - Implementation details
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: 1.3.2
4
+ version: 2.0.1
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
- - docs/ARCHITECTURE.md
73
- - docs/AUTHENTICATION.md
74
- - docs/README.md
75
- - docs/USERS.md
76
- - docs/USER_ID_FIELD.md
77
- - docs/USER_QUICK_REFERENCE.md
78
- - docs/WEBHOOKS.md
79
- - docs/WEBHOOK_SECURITY_QUICKSTART.md
80
- - docs/WEBHOOK_SIGNATURE.md
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:
@@ -99,8 +102,8 @@ metadata:
99
102
  allowed_push_host: https://rubygems.org
100
103
  homepage_uri: https://github.com/Sentia/zai-payment
101
104
  source_code_uri: https://github.com/Sentia/zai-payment
102
- changelog_uri: https://github.com/Sentia/zai-payment/blob/main/CHANGELOG.md
103
- code_of_conduct_uri: https://github.com/Sentia/zai-payment/blob/main/CODE_OF_CONDUCT.md
105
+ changelog_uri: https://github.com/Sentia/zai-payment/blob/main/changelog.md
106
+ code_of_conduct_uri: https://github.com/Sentia/zai-payment/blob/main/code_of_conduct.md
104
107
  rubygems_mfa_required: 'true'
105
108
  documentation_uri: https://github.com/Sentia/zai-payment#readme
106
109
  rdoc_options: []
@@ -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.6.7
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
File without changes
File without changes