kody-clientsdk-ruby 1.6.14
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 +7 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +211 -0
- data/Rakefile +24 -0
- data/kody-clientsdk-ruby.gemspec +38 -0
- data/lib/ecom_pb.rb +59 -0
- data/lib/ecom_services_pb.rb +38 -0
- data/lib/inventory_pb.rb +33 -0
- data/lib/inventory_services_pb.rb +33 -0
- data/lib/kody/configuration.rb +17 -0
- data/lib/kody/version.rb +3 -0
- data/lib/kody.rb +36 -0
- data/lib/logging_pb.rb +27 -0
- data/lib/logging_services_pb.rb +31 -0
- data/lib/order_pb.rb +39 -0
- data/lib/order_services_pb.rb +37 -0
- data/lib/pay_at_table_pb.rb +31 -0
- data/lib/pay_at_table_services_pb.rb +32 -0
- data/lib/pay_pb.rb +46 -0
- data/lib/pay_services_pb.rb +35 -0
- data/samples/ecom/get_payments.rb +76 -0
- metadata +163 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4a8bb43a172f7c0200dfcfcdea60904a5c4afed9f3a5c18c9762c0f2381370fe
|
4
|
+
data.tar.gz: 4a0cfbae738e945b5ad5f9b8fdbc63c41bc62367d52ba1501ab267eac2086253
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cda9d9d04bace30d567c6fd8bcff3a161ad5016ad899aca89736f1c0068b30cc1fd69507f0f0bef8d7fe305aeda7739f652a2b0a20f8497b6db24b59a493fec3
|
7
|
+
data.tar.gz: f4fc9af1179eb5ce3d192ca76b18c06f9a66d41f83544758910199d2e47336749198632a66ac9f958c182d84060dcaf67bd47074d360393f14aa92668e0b380f
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 KodyPay
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,211 @@
|
|
1
|
+
# Kody API - Ruby SDK
|
2
|
+
|
3
|
+
This guide provides an overview of using the Kody API and its reference documentation for Ruby.
|
4
|
+
|
5
|
+
- [Installation](#installation)
|
6
|
+
- [Authentication](#authentication)
|
7
|
+
- [Quick Start](#quick-start)
|
8
|
+
- [Sample code](#sample-code)
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'kody-clientsdk-ruby'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
```bash
|
21
|
+
bundle install
|
22
|
+
```
|
23
|
+
|
24
|
+
Or install it yourself as:
|
25
|
+
|
26
|
+
```bash
|
27
|
+
gem install kody-clientsdk-ruby
|
28
|
+
```
|
29
|
+
|
30
|
+
### Requirements
|
31
|
+
- Ruby 2.6.10 or higher
|
32
|
+
- gRPC support
|
33
|
+
|
34
|
+
## Authentication
|
35
|
+
|
36
|
+
The client library uses a combination of a `Store ID` and an `API key`.
|
37
|
+
These will be shared with you during the technical integration onboarding or by your Kody contact.
|
38
|
+
|
39
|
+
During development, you will have access to a **test Store** and **test API key**, and when the integration is ready for live access, the production credentials will be shared securely with you and associated with a live store that was onboarded on Kody.
|
40
|
+
|
41
|
+
The test and live API calls are always compatible, only changing credentials and the service hostname is required to enable the integration in production.
|
42
|
+
|
43
|
+
### Host names
|
44
|
+
|
45
|
+
- Development and test: `grpc-staging.kodypay.com`
|
46
|
+
- Live: `grpc.kodypay.com`
|
47
|
+
|
48
|
+
## Quick Start
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
require 'kody'
|
52
|
+
|
53
|
+
# Configure the Kody client
|
54
|
+
Kody.configure do |config|
|
55
|
+
config.api_key = 'your-api-key'
|
56
|
+
config.store_id = 'your-store-id'
|
57
|
+
config.staging! # Use staging environment for testing
|
58
|
+
end
|
59
|
+
|
60
|
+
# Create a client instance
|
61
|
+
client = Kody::Client.new
|
62
|
+
|
63
|
+
# Initiate a payment
|
64
|
+
begin
|
65
|
+
response = client.ecom.initiate_payment(
|
66
|
+
payment_reference: Kody::EcomClient.generate_payment_reference,
|
67
|
+
amount_minor_units: 2000, # £20.00 in pence
|
68
|
+
currency: 'GBP',
|
69
|
+
order_id: Kody::EcomClient.generate_order_id,
|
70
|
+
return_url: 'https://your-website.com/payment-return'
|
71
|
+
)
|
72
|
+
|
73
|
+
puts "Payment initiated successfully!"
|
74
|
+
puts "Payment ID: #{response.response.payment_id}"
|
75
|
+
puts "Payment URL: #{response.response.payment_url}"
|
76
|
+
|
77
|
+
rescue Kody::Error => e
|
78
|
+
puts "Error: #{e.message}"
|
79
|
+
rescue GRPC::BadStatus => e
|
80
|
+
puts "gRPC Error: #{e.message}"
|
81
|
+
end
|
82
|
+
```
|
83
|
+
|
84
|
+
## Configuration Options
|
85
|
+
|
86
|
+
### Environment Configuration
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
# Production environment (default)
|
90
|
+
Kody.configure do |config|
|
91
|
+
config.api_key = 'your-production-api-key'
|
92
|
+
config.store_id = 'your-production-store-id'
|
93
|
+
# config.host defaults to 'grpc.kodypay.com'
|
94
|
+
end
|
95
|
+
|
96
|
+
# Staging environment
|
97
|
+
Kody.configure do |config|
|
98
|
+
config.api_key = 'your-test-api-key'
|
99
|
+
config.store_id = 'your-test-store-id'
|
100
|
+
config.staging! # Sets host to 'grpc-staging.kodypay.com'
|
101
|
+
end
|
102
|
+
|
103
|
+
# Local development
|
104
|
+
Kody.configure do |config|
|
105
|
+
config.api_key = 'your-api-key'
|
106
|
+
config.store_id = 'your-store-id'
|
107
|
+
config.development! # Sets host to 'localhost:8080' with TLS disabled
|
108
|
+
end
|
109
|
+
```
|
110
|
+
|
111
|
+
### Environment Variables
|
112
|
+
|
113
|
+
You can also configure using environment variables:
|
114
|
+
|
115
|
+
```bash
|
116
|
+
export KODY_API_KEY="your-api-key"
|
117
|
+
export KODY_STORE_ID="your-store-id"
|
118
|
+
```
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
Kody.configure do |config|
|
122
|
+
config.api_key = ENV['KODY_API_KEY']
|
123
|
+
config.store_id = ENV['KODY_STORE_ID']
|
124
|
+
config.staging! # or production/development
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
## Available Methods
|
129
|
+
|
130
|
+
### E-commerce Payments
|
131
|
+
|
132
|
+
#### Initiate Payment
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
response = client.ecom.initiate_payment(
|
136
|
+
payment_reference: 'unique-payment-ref',
|
137
|
+
amount_minor_units: 2000, # Amount in minor units (e.g., pence for GBP)
|
138
|
+
currency: 'GBP',
|
139
|
+
order_id: 'order-123',
|
140
|
+
return_url: 'https://your-site.com/payment-return',
|
141
|
+
# Optional parameters:
|
142
|
+
order_metadata: '{"item": "Product Name"}',
|
143
|
+
expiry: {
|
144
|
+
show_timer: true,
|
145
|
+
expiring_seconds: 1800 # 30 minutes
|
146
|
+
},
|
147
|
+
locale: 'en_GB',
|
148
|
+
show_order_summary: true,
|
149
|
+
show_merchant_name: true
|
150
|
+
)
|
151
|
+
```
|
152
|
+
|
153
|
+
#### Get Payments
|
154
|
+
|
155
|
+
```ruby
|
156
|
+
response = client.ecom.get_payments(
|
157
|
+
page: 1,
|
158
|
+
page_size: 10,
|
159
|
+
# Optional filter:
|
160
|
+
filter: {
|
161
|
+
order_id: 'specific-order-id' # Optional: filter by order ID
|
162
|
+
}
|
163
|
+
)
|
164
|
+
|
165
|
+
puts "Total payments: #{response.response.total}"
|
166
|
+
response.response.payments.each do |payment|
|
167
|
+
puts "Payment ID: #{payment.payment_id}"
|
168
|
+
puts "Status: #{payment.status}"
|
169
|
+
puts "Amount: #{payment.sale_data.amount_minor_units}" if payment.has_sale_data?
|
170
|
+
end
|
171
|
+
```
|
172
|
+
|
173
|
+
**Note:** Currently, `initiate_payment` and `get_payments` methods are implemented. Additional methods (payment details, refunds, etc.) will be added in future versions.
|
174
|
+
|
175
|
+
## Helper Methods
|
176
|
+
|
177
|
+
The SDK provides convenient helper methods:
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
# Generate unique payment reference
|
181
|
+
payment_ref = Kody::EcomClient.generate_payment_reference
|
182
|
+
# Returns: "pay_a1b2c3d4e5f6g7h8"
|
183
|
+
|
184
|
+
# Generate unique order ID
|
185
|
+
order_id = Kody::EcomClient.generate_order_id
|
186
|
+
# Returns: "order_a1b2c3d4e5f6g7h8"
|
187
|
+
```
|
188
|
+
|
189
|
+
## Sample code
|
190
|
+
|
191
|
+
Complete examples can be found in the `samples/` directory:
|
192
|
+
|
193
|
+
- [Initiate Payment](samples/ecom/initiate_payment.rb)
|
194
|
+
- [Get Payments](samples/ecom/get_payments.rb)
|
195
|
+
|
196
|
+
## Documentation
|
197
|
+
|
198
|
+
For complete API documentation, examples, and integration guides, please visit:
|
199
|
+
📚 https://api-docs.kody.com
|
200
|
+
|
201
|
+
## Development Status
|
202
|
+
|
203
|
+
This is a minimal initial version of the Ruby SDK focusing on the core payment initiation functionality. The SDK follows the same patterns as other Kody client SDKs and will be extended with additional features in future releases.
|
204
|
+
|
205
|
+
## Contributing
|
206
|
+
|
207
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/KodyPay/kody-clientsdk-ruby.
|
208
|
+
|
209
|
+
## License
|
210
|
+
|
211
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
desc "Generate protobuf and gRPC files (requires proto files from build process)"
|
7
|
+
task :generate_protos do
|
8
|
+
proto_dir = "proto"
|
9
|
+
lib_dir = "lib"
|
10
|
+
|
11
|
+
unless Dir.exist?(proto_dir)
|
12
|
+
puts "Proto directory not found. This task should be run during CI/CD build process."
|
13
|
+
puts "For local development, use the GitHub Actions workflow to generate the Ruby gem."
|
14
|
+
exit 1
|
15
|
+
end
|
16
|
+
|
17
|
+
# Generate Ruby files from proto
|
18
|
+
sh "grpc_tools_ruby_protoc -I #{proto_dir} --ruby_out=#{lib_dir} --grpc_out=#{lib_dir} #{proto_dir}/com/kodypay/grpc/ecom/v1/ecom.proto"
|
19
|
+
|
20
|
+
# Clean up
|
21
|
+
rm_rf proto_dir
|
22
|
+
end
|
23
|
+
|
24
|
+
task default: :spec
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative 'lib/kody/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "kody-clientsdk-ruby"
|
5
|
+
spec.version = Kody::VERSION
|
6
|
+
spec.authors = ["Kody Tech Team"]
|
7
|
+
spec.email = ["tech@kody.com"]
|
8
|
+
spec.summary = "Ruby gRPC client for Kody payment services"
|
9
|
+
spec.description = "A Ruby client library for integrating with Kody payment APIs using gRPC"
|
10
|
+
spec.homepage = "https://github.com/KodyPay/kody-clientsdk-ruby"
|
11
|
+
spec.license = "MIT"
|
12
|
+
spec.required_ruby_version = ">= 2.6.10"
|
13
|
+
|
14
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
15
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
16
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
21
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
# Dependencies
|
30
|
+
spec.add_dependency "grpc", ">= 1.74.0", "< 2.0"
|
31
|
+
spec.add_dependency "google-protobuf", ">= 4.31.0", "< 5.0"
|
32
|
+
|
33
|
+
# Development dependencies
|
34
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
35
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
37
|
+
spec.add_development_dependency "grpc-tools", "~> 1.74.0"
|
38
|
+
end
|
data/lib/ecom_pb.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: com/kodypay/grpc/ecom/v1/ecom.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
8
|
+
|
9
|
+
|
10
|
+
descriptor_data = "\n#com/kodypay/grpc/ecom/v1/ecom.proto\x12\x18\x63om.kodypay.grpc.ecom.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xde\n\n\x18PaymentInitiationRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x19\n\x11payment_reference\x18\x02 \x01(\t\x12\x1a\n\x12\x61mount_minor_units\x18\x03 \x01(\x04\x12\x10\n\x08\x63urrency\x18\x04 \x01(\t\x12\x10\n\x08order_id\x18\x05 \x01(\t\x12\x1b\n\x0eorder_metadata\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x12\n\nreturn_url\x18\x07 \x01(\t\x12\x1c\n\x0fpayer_statement\x18\x08 \x01(\tH\x01\x88\x01\x01\x12 \n\x13payer_email_address\x18\t \x01(\tH\x02\x88\x01\x01\x12\x1d\n\x10payer_ip_address\x18\n \x01(\tH\x03\x88\x01\x01\x12\x19\n\x0cpayer_locale\x18\x0b \x01(\tH\x04\x88\x01\x01\x12\x1a\n\rtokenise_card\x18\x0c \x01(\x08H\x05\x88\x01\x01\x12V\n\x06\x65xpiry\x18\r \x01(\x0b\x32\x41.com.kodypay.grpc.ecom.v1.PaymentInitiationRequest.ExpirySettingsH\x06\x88\x01\x01\x12_\n\x0f\x63\x61pture_options\x18\x0e \x01(\x0b\x32\x41.com.kodypay.grpc.ecom.v1.PaymentInitiationRequest.CaptureOptionsH\x07\x88\x01\x01\x12$\n\x17is_pay_by_bank_accepted\x18\x0f \x01(\x08H\x08\x88\x01\x01\x1a>\n\x0e\x45xpirySettings\x12\x12\n\nshow_timer\x18\x01 \x01(\x08\x12\x18\n\x10\x65xpiring_seconds\x18\x02 \x01(\x04\x1a\xbc\x04\n\x0e\x43\x61ptureOptions\x12k\n\x10\x63\x61pture_settings\x18\x01 \x01(\x0b\x32Q.com.kodypay.grpc.ecom.v1.PaymentInitiationRequest.CaptureOptions.CaptureSettings\x12p\n\x10release_settings\x18\x02 \x01(\x0b\x32Q.com.kodypay.grpc.ecom.v1.PaymentInitiationRequest.CaptureOptions.ReleaseSettingsH\x00\x88\x01\x01\x1a\x99\x01\n\x0f\x43\x61ptureSettings\x12\x17\n\x0f\x64\x65layed_capture\x18\x01 \x01(\x08\x12\'\n\x1a\x61uto_capture_interval_mins\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12%\n\x1d\x61uto_capture_store_close_time\x18\x03 \x01(\x08\x42\x1d\n\x1b_auto_capture_interval_mins\x1a\x99\x01\n\x0fReleaseSettings\x12\x17\n\x0f\x64\x65layed_release\x18\x01 \x01(\x08\x12\'\n\x1a\x61uto_release_interval_mins\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12%\n\x1d\x61uto_release_store_close_time\x18\x03 \x01(\x08\x42\x1d\n\x1b_auto_release_interval_minsB\x13\n\x11_release_settingsB\x11\n\x0f_order_metadataB\x12\n\x10_payer_statementB\x16\n\x14_payer_email_addressB\x13\n\x11_payer_ip_addressB\x0f\n\r_payer_localeB\x10\n\x0e_tokenise_cardB\t\n\x07_expiryB\x12\n\x10_capture_optionsB\x1a\n\x18_is_pay_by_bank_accepted\"\xa2\x03\n\x19PaymentInitiationResponse\x12P\n\x08response\x18\x01 \x01(\x0b\x32<.com.kodypay.grpc.ecom.v1.PaymentInitiationResponse.ResponseH\x00\x12J\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x39.com.kodypay.grpc.ecom.v1.PaymentInitiationResponse.ErrorH\x00\x1a\x33\n\x08Response\x12\x12\n\npayment_id\x18\x01 \x01(\t\x12\x13\n\x0bpayment_url\x18\x02 \x01(\t\x1a\xa7\x01\n\x05\x45rror\x12L\n\x04type\x18\x01 \x01(\x0e\x32>.com.kodypay.grpc.ecom.v1.PaymentInitiationResponse.Error.Type\x12\x0f\n\x07message\x18\x02 \x01(\t\"?\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x15\n\x11\x44UPLICATE_ATTEMPT\x10\x01\x12\x13\n\x0fINVALID_REQUEST\x10\x02\x42\x08\n\x06result\"r\n\x15PaymentDetailsRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x14\n\npayment_id\x18\x02 \x01(\tH\x00\x12\x1b\n\x11payment_reference\x18\x03 \x01(\tH\x00\x42\x14\n\x12payment_identifier\"p\n\x13GetCardTokenRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x14\n\npayment_id\x18\x02 \x01(\tH\x00\x12\x1b\n\x11payment_reference\x18\x03 \x01(\tH\x00\x42\x14\n\x12payment_identifier\"\xbc\x01\n\x14GetCardTokenResponse\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0e\n\x06\x65xpiry\x18\x02 \x01(\t\x12N\n\x06status\x18\x03 \x01(\x0e\x32>.com.kodypay.grpc.ecom.v1.GetCardTokenResponse.CardTokenStatus\"5\n\x0f\x43\x61rdTokenStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\t\n\x05READY\x10\x02\"\xde\x0f\n\x16PaymentDetailsResponse\x12S\n\x08response\x18\x01 \x01(\x0b\x32?.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentDetailsH\x00\x12G\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x36.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.ErrorH\x00\x1a\xb3\x01\n\x05\x45rror\x12I\n\x04type\x18\x01 \x01(\x0e\x32;.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.Error.Type\x12\x0f\n\x07message\x18\x02 \x01(\t\"N\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tNOT_FOUND\x10\x01\x12\x13\n\x0fINVALID_REQUEST\x10\x02\x12\x15\n\x11\x44UPLICATE_ATTEMPT\x10\x03\x1a\xa9\x05\n\x0ePaymentDetails\x12\x12\n\npayment_id\x18\x01 \x01(\t\x12\x1d\n\x11payment_reference\x18\x02 \x01(\tB\x02\x18\x01\x12\x14\n\x08order_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x1f\n\x0eorder_metadata\x18\x04 \x01(\tB\x02\x18\x01H\x00\x88\x01\x01\x12\x37\n\x06status\x18\x05 \x01(\x0e\x32\'.com.kodypay.grpc.ecom.v1.PaymentStatus\x12\"\n\x11payment_data_json\x18\x06 \x01(\tB\x02\x18\x01H\x01\x88\x01\x01\x12\x30\n\x0c\x64\x61te_created\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\tdate_paid\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01H\x02\x88\x01\x01\x12\x1e\n\rpsp_reference\x18\t \x01(\tB\x02\x18\x01H\x03\x88\x01\x01\x12\x1f\n\x0epayment_method\x18\n \x01(\tB\x02\x18\x01H\x04\x88\x01\x01\x12W\n\x0cpayment_data\x18\x0b \x01(\x0b\x32<.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentDataH\x05\x88\x01\x01\x12Q\n\tsale_data\x18\x0c \x01(\x0b\x32\x39.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.SaleDataH\x06\x88\x01\x01\x42\x11\n\x0f_order_metadataB\x14\n\x12_payment_data_jsonB\x0c\n\n_date_paidB\x10\n\x0e_psp_referenceB\x11\n\x0f_payment_methodB\x0f\n\r_payment_dataB\x0c\n\n_sale_data\x1a\xa1\x06\n\x0bPaymentData\x12\x15\n\rpsp_reference\x18\x01 \x01(\t\x12@\n\x0epayment_method\x18\x02 \x01(\x0e\x32(.com.kodypay.grpc.ecom.v1.PaymentMethods\x12\x1e\n\x16payment_method_variant\x18\x03 \x01(\t\x12\x63\n\x0b\x61uth_status\x18\x04 \x01(\x0e\x32N.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentData.PaymentAuthStatus\x12\x34\n\x10\x61uth_status_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12`\n\x0cpayment_card\x18\x06 \x01(\x0b\x32H.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentData.PaymentCardH\x00\x12\x64\n\x0epayment_wallet\x18\x07 \x01(\x0b\x32J.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentData.PaymentWalletH\x00\x1aS\n\x0bPaymentCard\x12\x1a\n\x12\x63\x61rd_last_4_digits\x18\x01 \x01(\t\x12\x11\n\tauth_code\x18\x02 \x01(\t\x12\x15\n\rpayment_token\x18\x03 \x01(\t\x1a`\n\rPaymentWallet\x12\x1f\n\x12\x63\x61rd_last_4_digits\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x17\n\x0fpayment_link_id\x18\x02 \x01(\tB\x15\n\x13_card_last_4_digits\"e\n\x11PaymentAuthStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0e\n\nAUTHORISED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\x0c\n\x08\x43\x41PTURED\x10\x03\x12\x0c\n\x08RELEASED\x10\x04\x12\x0b\n\x07\x45XPIRED\x10\x05\x42\x18\n\x16payment_method_details\x1a\x95\x01\n\x08SaleData\x12\x1a\n\x12\x61mount_minor_units\x18\x01 \x01(\x04\x12\x10\n\x08\x63urrency\x18\x02 \x01(\t\x12\x10\n\x08order_id\x18\x03 \x01(\t\x12\x19\n\x11payment_reference\x18\x04 \x01(\t\x12\x1b\n\x0eorder_metadata\x18\x05 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_order_metadataB\x08\n\x06result\"\xe2\x02\n\x12GetPaymentsRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12L\n\x0bpage_cursor\x18\x02 \x01(\x0b\x32\x37.com.kodypay.grpc.ecom.v1.GetPaymentsRequest.PageCursor\x12\x43\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x33.com.kodypay.grpc.ecom.v1.GetPaymentsRequest.Filter\x1ax\n\x06\x46ilter\x12\x15\n\x08order_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x0e\x63reated_before\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x88\x01\x01\x42\x0b\n\t_order_idB\x11\n\x0f_created_before\x1a-\n\nPageCursor\x12\x0c\n\x04page\x18\x01 \x01(\x03\x12\x11\n\tpage_size\x18\x02 \x01(\x03\"\xfe\x07\n\x13GetPaymentsResponse\x12J\n\x08response\x18\x01 \x01(\x0b\x32\x36.com.kodypay.grpc.ecom.v1.GetPaymentsResponse.ResponseH\x00\x12\x44\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x33.com.kodypay.grpc.ecom.v1.GetPaymentsResponse.ErrorH\x00\x1a\xad\x05\n\x08Response\x12p\n\x13\x64\x65precated_payments\x18\x01 \x03(\x0b\x32O.com.kodypay.grpc.ecom.v1.GetPaymentsResponse.Response.DeprecatedPaymentDetailsB\x02\x18\x01\x12\r\n\x05total\x18\x02 \x01(\x03\x12Q\n\x08payments\x18\x03 \x03(\x0b\x32?.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentDetails\x1a\xcc\x03\n\x18\x44\x65precatedPaymentDetails\x12\x12\n\npayment_id\x18\x01 \x01(\t\x12\x19\n\x11payment_reference\x18\x02 \x01(\t\x12\x10\n\x08order_id\x18\x03 \x01(\t\x12\x1b\n\x0eorder_metadata\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x06status\x18\x05 \x01(\x0e\x32\'.com.kodypay.grpc.ecom.v1.PaymentStatus\x12\x1e\n\x11payment_data_json\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\x30\n\x0c\x64\x61te_created\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\tdate_paid\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02\x88\x01\x01\x12\x1a\n\rpsp_reference\x18\t \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0epayment_method\x18\n \x01(\tH\x04\x88\x01\x01\x42\x11\n\x0f_order_metadataB\x14\n\x12_payment_data_jsonB\x0c\n\n_date_paidB\x10\n\x0e_psp_referenceB\x11\n\x0f_payment_method\x1a\x9a\x01\n\x05\x45rror\x12\x46\n\x04type\x18\x01 \x01(\x0e\x32\x38.com.kodypay.grpc.ecom.v1.GetPaymentsResponse.Error.Type\x12\x0f\n\x07message\x18\x02 \x01(\t\"8\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tNOT_FOUND\x10\x01\x12\x14\n\x10INVALID_ARGUMENT\x10\x02\x42\x08\n\x06result\"f\n\rRefundRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x14\n\npayment_id\x18\x02 \x01(\tH\x00\x12\x17\n\rpsp_reference\x18\x04 \x01(\tH\x00\x12\x0e\n\x06\x61mount\x18\x03 \x01(\tB\x04\n\x02id\"\x97\x03\n\x0eRefundResponse\x12\x45\n\x06status\x18\x01 \x01(\x0e\x32\x35.com.kodypay.grpc.ecom.v1.RefundResponse.RefundStatus\x12\x1b\n\x0e\x66\x61ilure_reason\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x12\n\npayment_id\x18\x03 \x01(\t\x12\x30\n\x0c\x64\x61te_created\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11total_paid_amount\x18\x05 \x01(\t\x12\x1d\n\x15total_amount_refunded\x18\x06 \x01(\t\x12\x18\n\x10remaining_amount\x18\x07 \x01(\t\x12\x1e\n\x16total_amount_requested\x18\x08 \x01(\t\x12\x1c\n\x14paymentTransactionId\x18\t \x01(\t\"6\n\x0cRefundStatus\x12\x0b\n\x07PENDING\x10\x00\x12\r\n\tREQUESTED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x11\n\x0f_failure_reason*\xa2\x01\n\x0ePaymentMethods\x12\x08\n\x04VISA\x10\x00\x12\x0e\n\nMASTERCARD\x10\x01\x12\x08\n\x04\x41MEX\x10\x02\x12\x0f\n\x0b\x42\x41N_CONTACT\x10\x03\x12\x13\n\x0f\x43HINA_UNION_PAY\x10\x04\x12\x0b\n\x07MAESTRO\x10\x05\x12\n\n\x06\x44INERS\x10\x06\x12\x0c\n\x08\x44ISCOVER\x10\x07\x12\x07\n\x03JCB\x10\x08\x12\n\n\x06\x41LIPAY\x10\t\x12\n\n\x06WECHAT\x10\n*Q\n\rPaymentStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\x0b\n\x07\x45XPIRED\x10\x04\x32\xc2\x06\n\x17KodyEcomPaymentsService\x12z\n\x0fInitiatePayment\x12\x32.com.kodypay.grpc.ecom.v1.PaymentInitiationRequest\x1a\x33.com.kodypay.grpc.ecom.v1.PaymentInitiationResponse\x12\x7f\n\x15InitiatePaymentStream\x12\x32.com.kodypay.grpc.ecom.v1.PaymentInitiationRequest\x1a\x30.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse0\x01\x12s\n\x0ePaymentDetails\x12/.com.kodypay.grpc.ecom.v1.PaymentDetailsRequest\x1a\x30.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse\x12{\n\x14PaymentDetailsStream\x12/.com.kodypay.grpc.ecom.v1.PaymentDetailsRequest\x1a\x30.com.kodypay.grpc.ecom.v1.PaymentDetailsResponse0\x01\x12j\n\x0bGetPayments\x12,.com.kodypay.grpc.ecom.v1.GetPaymentsRequest\x1a-.com.kodypay.grpc.ecom.v1.GetPaymentsResponse\x12m\n\x0cGetCardToken\x12-.com.kodypay.grpc.ecom.v1.GetCardTokenRequest\x1a..com.kodypay.grpc.ecom.v1.GetCardTokenResponse\x12]\n\x06Refund\x12\'.com.kodypay.grpc.ecom.v1.RefundRequest\x1a(.com.kodypay.grpc.ecom.v1.RefundResponse0\x01\x42\x33\n\x18\x63om.kodypay.grpc.ecom.v1B\x15KodyEcomPaymentsProtoP\x01\x62\x06proto3"
|
11
|
+
|
12
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
|
15
|
+
module Com
|
16
|
+
module Kodypay
|
17
|
+
module Grpc
|
18
|
+
module Ecom
|
19
|
+
module V1
|
20
|
+
PaymentInitiationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationRequest").msgclass
|
21
|
+
PaymentInitiationRequest::ExpirySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationRequest.ExpirySettings").msgclass
|
22
|
+
PaymentInitiationRequest::CaptureOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationRequest.CaptureOptions").msgclass
|
23
|
+
PaymentInitiationRequest::CaptureOptions::CaptureSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationRequest.CaptureOptions.CaptureSettings").msgclass
|
24
|
+
PaymentInitiationRequest::CaptureOptions::ReleaseSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationRequest.CaptureOptions.ReleaseSettings").msgclass
|
25
|
+
PaymentInitiationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationResponse").msgclass
|
26
|
+
PaymentInitiationResponse::Response = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationResponse.Response").msgclass
|
27
|
+
PaymentInitiationResponse::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationResponse.Error").msgclass
|
28
|
+
PaymentInitiationResponse::Error::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentInitiationResponse.Error.Type").enummodule
|
29
|
+
PaymentDetailsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsRequest").msgclass
|
30
|
+
GetCardTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetCardTokenRequest").msgclass
|
31
|
+
GetCardTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetCardTokenResponse").msgclass
|
32
|
+
GetCardTokenResponse::CardTokenStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetCardTokenResponse.CardTokenStatus").enummodule
|
33
|
+
PaymentDetailsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse").msgclass
|
34
|
+
PaymentDetailsResponse::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.Error").msgclass
|
35
|
+
PaymentDetailsResponse::Error::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.Error.Type").enummodule
|
36
|
+
PaymentDetailsResponse::PaymentDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentDetails").msgclass
|
37
|
+
PaymentDetailsResponse::PaymentData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentData").msgclass
|
38
|
+
PaymentDetailsResponse::PaymentData::PaymentCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentData.PaymentCard").msgclass
|
39
|
+
PaymentDetailsResponse::PaymentData::PaymentWallet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentData.PaymentWallet").msgclass
|
40
|
+
PaymentDetailsResponse::PaymentData::PaymentAuthStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.PaymentData.PaymentAuthStatus").enummodule
|
41
|
+
PaymentDetailsResponse::SaleData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentDetailsResponse.SaleData").msgclass
|
42
|
+
GetPaymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetPaymentsRequest").msgclass
|
43
|
+
GetPaymentsRequest::Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetPaymentsRequest.Filter").msgclass
|
44
|
+
GetPaymentsRequest::PageCursor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetPaymentsRequest.PageCursor").msgclass
|
45
|
+
GetPaymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetPaymentsResponse").msgclass
|
46
|
+
GetPaymentsResponse::Response = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetPaymentsResponse.Response").msgclass
|
47
|
+
GetPaymentsResponse::Response::DeprecatedPaymentDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetPaymentsResponse.Response.DeprecatedPaymentDetails").msgclass
|
48
|
+
GetPaymentsResponse::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetPaymentsResponse.Error").msgclass
|
49
|
+
GetPaymentsResponse::Error::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.GetPaymentsResponse.Error.Type").enummodule
|
50
|
+
RefundRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.RefundRequest").msgclass
|
51
|
+
RefundResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.RefundResponse").msgclass
|
52
|
+
RefundResponse::RefundStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.RefundResponse.RefundStatus").enummodule
|
53
|
+
PaymentMethods = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentMethods").enummodule
|
54
|
+
PaymentStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ecom.v1.PaymentStatus").enummodule
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: com/kodypay/grpc/ecom/v1/ecom.proto for package 'com.kodypay.grpc.ecom.v1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require_relative "ecom_pb"
|
6
|
+
|
7
|
+
module Com
|
8
|
+
module Kodypay
|
9
|
+
module Grpc
|
10
|
+
module Ecom
|
11
|
+
module V1
|
12
|
+
module KodyEcomPaymentsService
|
13
|
+
# All service requests require X-API-Key header with 'API Key' value
|
14
|
+
class Service
|
15
|
+
|
16
|
+
include ::GRPC::GenericService
|
17
|
+
|
18
|
+
self.marshal_class_method = :encode
|
19
|
+
self.unmarshal_class_method = :decode
|
20
|
+
self.service_name = 'com.kodypay.grpc.ecom.v1.KodyEcomPaymentsService'
|
21
|
+
|
22
|
+
# Initiates a payment and returns a URL for the user to complete payment
|
23
|
+
rpc :InitiatePayment, ::Com::Kodypay::Grpc::Ecom::V1::PaymentInitiationRequest, ::Com::Kodypay::Grpc::Ecom::V1::PaymentInitiationResponse
|
24
|
+
rpc :InitiatePaymentStream, ::Com::Kodypay::Grpc::Ecom::V1::PaymentInitiationRequest, stream(::Com::Kodypay::Grpc::Ecom::V1::PaymentDetailsResponse)
|
25
|
+
rpc :PaymentDetails, ::Com::Kodypay::Grpc::Ecom::V1::PaymentDetailsRequest, ::Com::Kodypay::Grpc::Ecom::V1::PaymentDetailsResponse
|
26
|
+
rpc :PaymentDetailsStream, ::Com::Kodypay::Grpc::Ecom::V1::PaymentDetailsRequest, stream(::Com::Kodypay::Grpc::Ecom::V1::PaymentDetailsResponse)
|
27
|
+
rpc :GetPayments, ::Com::Kodypay::Grpc::Ecom::V1::GetPaymentsRequest, ::Com::Kodypay::Grpc::Ecom::V1::GetPaymentsResponse
|
28
|
+
rpc :GetCardToken, ::Com::Kodypay::Grpc::Ecom::V1::GetCardTokenRequest, ::Com::Kodypay::Grpc::Ecom::V1::GetCardTokenResponse
|
29
|
+
rpc :Refund, ::Com::Kodypay::Grpc::Ecom::V1::RefundRequest, stream(::Com::Kodypay::Grpc::Ecom::V1::RefundResponse)
|
30
|
+
end
|
31
|
+
|
32
|
+
Stub = Service.rpc_stub_class
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/inventory_pb.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: com/kodypay/grpc/ordering/v1/inventory.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
|
8
|
+
descriptor_data = "\n,com/kodypay/grpc/ordering/v1/inventory.proto\x12\x1c\x63om.kodypay.grpc.ordering.v1\"(\n\x14GetCategoriesRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\"S\n\x15GetCategoriesResponse\x12:\n\ncategories\x18\x01 \x03(\x0b\x32&.com.kodypay.grpc.ordering.v1.Category\"p\n\x08\x43\x61tegory\x12\x13\n\x0b\x63\x61tegory_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x41\n\x05items\x18\x03 \x03(\x0b\x32\x32.com.kodypay.grpc.ordering.v1.InventoryItemOrCombo\"\x91\x01\n\x14InventoryItemOrCombo\x12;\n\x04item\x18\x01 \x01(\x0b\x32+.com.kodypay.grpc.ordering.v1.InventoryItemH\x00\x12\x34\n\x05\x63ombo\x18\x02 \x01(\x0b\x32#.com.kodypay.grpc.ordering.v1.ComboH\x00\x42\x06\n\x04type\"\xc7\x01\n\rInventoryItem\x12\x18\n\x10merchant_item_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x13\n\x0bgross_price\x18\x04 \x01(\t\x12\x16\n\x0eintegration_id\x18\x05 \x01(\t\x12\x0c\n\x04tags\x18\x06 \x03(\t\x12>\n\x0c\x61\x64\x64on_groups\x18\x07 \x03(\x0b\x32(.com.kodypay.grpc.ordering.v1.AddOnGroup\"\xce\x01\n\nAddOnGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x41\n\x05rules\x18\x02 \x01(\x0b\x32\x32.com.kodypay.grpc.ordering.v1.AddOnGroup.AddOnRule\x12\x36\n\x05items\x18\x03 \x03(\x0b\x32\'.com.kodypay.grpc.ordering.v1.AddOnItem\x12\x10\n\x08group_id\x18\x04 \x01(\t\x1a%\n\tAddOnRule\x12\x0b\n\x03min\x18\x01 \x01(\x05\x12\x0b\n\x03max\x18\x02 \x01(\x05\"\xc7\x01\n\tAddOnItem\x12\x18\n\x10merchant_item_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x13\n\x0bgross_price\x18\x04 \x01(\t\x12\x16\n\x0eintegration_id\x18\x05 \x01(\t\x12\x0c\n\x04tags\x18\x06 \x03(\t\x12\x10\n\x08group_id\x18\x07 \x01(\t\x12\x10\n\x03max\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x16\n\x0eparent_item_id\x18\t \x01(\tB\x06\n\x04_max\"\x8d\x01\n\x05\x43ombo\x12\x10\n\x08\x63ombo_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x13\n\x0bgross_price\x18\x04 \x01(\t\x12:\n\ncategories\x18\x05 \x03(\x0b\x32&.com.kodypay.grpc.ordering.v1.Category\"Q\n\x13GetInventoryRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x18\n\x0b\x63\x61tegory_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_category_id\"Y\n\x14GetInventoryResponse\x12\x41\n\x05items\x18\x01 \x03(\x0b\x32\x32.com.kodypay.grpc.ordering.v1.InventoryItemOrCombo2\x83\x02\n\x10InventoryService\x12u\n\x0cGetInventory\x12\x31.com.kodypay.grpc.ordering.v1.GetInventoryRequest\x1a\x32.com.kodypay.grpc.ordering.v1.GetInventoryResponse\x12x\n\rGetCategories\x12\x32.com.kodypay.grpc.ordering.v1.GetCategoriesRequest\x1a\x33.com.kodypay.grpc.ordering.v1.GetCategoriesResponseB0\n\x1c\x63om.kodypay.grpc.ordering.v1B\x0eInventoryProtoP\x01\x62\x06proto3"
|
9
|
+
|
10
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
pool.add_serialized_file(descriptor_data)
|
12
|
+
|
13
|
+
module Com
|
14
|
+
module Kodypay
|
15
|
+
module Grpc
|
16
|
+
module Ordering
|
17
|
+
module V1
|
18
|
+
GetCategoriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.GetCategoriesRequest").msgclass
|
19
|
+
GetCategoriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.GetCategoriesResponse").msgclass
|
20
|
+
Category = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.Category").msgclass
|
21
|
+
InventoryItemOrCombo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.InventoryItemOrCombo").msgclass
|
22
|
+
InventoryItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.InventoryItem").msgclass
|
23
|
+
AddOnGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.AddOnGroup").msgclass
|
24
|
+
AddOnGroup::AddOnRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.AddOnGroup.AddOnRule").msgclass
|
25
|
+
AddOnItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.AddOnItem").msgclass
|
26
|
+
Combo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.Combo").msgclass
|
27
|
+
GetInventoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.GetInventoryRequest").msgclass
|
28
|
+
GetInventoryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.GetInventoryResponse").msgclass
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: com/kodypay/grpc/ordering/v1/inventory.proto for package 'com.kodypay.grpc.ordering.v1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require_relative "inventory_pb"
|
6
|
+
|
7
|
+
module Com
|
8
|
+
module Kodypay
|
9
|
+
module Grpc
|
10
|
+
module Ordering
|
11
|
+
module V1
|
12
|
+
module InventoryService
|
13
|
+
class Service
|
14
|
+
|
15
|
+
include ::GRPC::GenericService
|
16
|
+
|
17
|
+
self.marshal_class_method = :encode
|
18
|
+
self.unmarshal_class_method = :decode
|
19
|
+
self.service_name = 'com.kodypay.grpc.ordering.v1.InventoryService'
|
20
|
+
|
21
|
+
# Retrieve full inventory or items filtered by category
|
22
|
+
rpc :GetInventory, ::Com::Kodypay::Grpc::Ordering::V1::GetInventoryRequest, ::Com::Kodypay::Grpc::Ordering::V1::GetInventoryResponse
|
23
|
+
# Retrieve all categories for a store
|
24
|
+
rpc :GetCategories, ::Com::Kodypay::Grpc::Ordering::V1::GetCategoriesRequest, ::Com::Kodypay::Grpc::Ordering::V1::GetCategoriesResponse
|
25
|
+
end
|
26
|
+
|
27
|
+
Stub = Service.rpc_stub_class
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Kody
|
2
|
+
class Configuration
|
3
|
+
# Common KodyPay gRPC endpoints
|
4
|
+
PRODUCTION_ENDPOINT = 'grpc.kodypay.com:443'
|
5
|
+
STAGING_ENDPOINT = 'grpc-staging-ap.kodypay.com:443'
|
6
|
+
|
7
|
+
attr_accessor :api_key, :store_id, :endpoint
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@endpoint = PRODUCTION_ENDPOINT
|
11
|
+
end
|
12
|
+
|
13
|
+
def staging!
|
14
|
+
@endpoint = STAGING_ENDPOINT
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/kody/version.rb
ADDED
data/lib/kody.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative 'kody/version'
|
2
|
+
require_relative 'kody/configuration'
|
3
|
+
|
4
|
+
# Load gRPC protobuf definitions and services (generated during build)
|
5
|
+
begin
|
6
|
+
require 'grpc'
|
7
|
+
|
8
|
+
# Automatically load all generated protobuf files
|
9
|
+
lib_dir = File.dirname(__FILE__)
|
10
|
+
|
11
|
+
# Load all _pb.rb files (protobuf messages)
|
12
|
+
Dir.glob(File.join(lib_dir, '*_pb.rb')).each do |file|
|
13
|
+
require file
|
14
|
+
end
|
15
|
+
|
16
|
+
# Load all _services_pb.rb files (gRPC services)
|
17
|
+
Dir.glob(File.join(lib_dir, '*_services_pb.rb')).each do |file|
|
18
|
+
require file
|
19
|
+
end
|
20
|
+
|
21
|
+
rescue LoadError => e
|
22
|
+
raise LoadError, "KodyPay gRPC files not found. This gem must be installed from RubyGems to include generated protobuf files. Error: #{e.message}"
|
23
|
+
end
|
24
|
+
|
25
|
+
module Kody
|
26
|
+
class << self
|
27
|
+
attr_accessor :configuration
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.configure
|
31
|
+
self.configuration ||= Configuration.new
|
32
|
+
yield(configuration)
|
33
|
+
end
|
34
|
+
|
35
|
+
class Error < StandardError; end
|
36
|
+
end
|
data/lib/logging_pb.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: com/kodypay/grpc/utils/v1/logging.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
8
|
+
|
9
|
+
|
10
|
+
descriptor_data = "\n\'com/kodypay/grpc/utils/v1/logging.proto\x12\x19\x63om.kodypay.grpc.utils.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc4\x01\n\x0eGetLogsRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x33\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x88\x01\x01\x12\x12\n\x05\x65vent\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_start_timeB\x0b\n\t_end_timeB\x08\n\x06_event\"\xc7\x01\n\x08LogEntry\x12\n\n\x02id\x18\x01 \x01(\t\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05\x65vent\x18\x03 \x01(\t\x12\x41\n\x07\x63ontext\x18\x04 \x03(\x0b\x32\x30.com.kodypay.grpc.utils.v1.LogEntry.ContextEntry\x1a.\n\x0c\x43ontextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"D\n\x0fGetLogsResponse\x12\x31\n\x04logs\x18\x01 \x03(\x0b\x32#.com.kodypay.grpc.utils.v1.LogEntry2\xdc\x01\n\x0eLoggingService\x12`\n\x07GetLogs\x12).com.kodypay.grpc.utils.v1.GetLogsRequest\x1a*.com.kodypay.grpc.utils.v1.GetLogsResponse\x12h\n\rGetLogsStream\x12).com.kodypay.grpc.utils.v1.GetLogsRequest\x1a*.com.kodypay.grpc.utils.v1.GetLogsResponse0\x01\x42+\n\x19\x63om.kodypay.grpc.utils.v1B\x0cLoggingProtoP\x01\x62\x06proto3"
|
11
|
+
|
12
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
|
15
|
+
module Com
|
16
|
+
module Kodypay
|
17
|
+
module Grpc
|
18
|
+
module Utils
|
19
|
+
module V1
|
20
|
+
GetLogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.utils.v1.GetLogsRequest").msgclass
|
21
|
+
LogEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.utils.v1.LogEntry").msgclass
|
22
|
+
GetLogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.utils.v1.GetLogsResponse").msgclass
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: com/kodypay/grpc/utils/v1/logging.proto for package 'com.kodypay.grpc.utils.v1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require_relative "logging_pb"
|
6
|
+
|
7
|
+
module Com
|
8
|
+
module Kodypay
|
9
|
+
module Grpc
|
10
|
+
module Utils
|
11
|
+
module V1
|
12
|
+
module LoggingService
|
13
|
+
class Service
|
14
|
+
|
15
|
+
include ::GRPC::GenericService
|
16
|
+
|
17
|
+
self.marshal_class_method = :encode
|
18
|
+
self.unmarshal_class_method = :decode
|
19
|
+
self.service_name = 'com.kodypay.grpc.utils.v1.LoggingService'
|
20
|
+
|
21
|
+
rpc :GetLogs, ::Com::Kodypay::Grpc::Utils::V1::GetLogsRequest, ::Com::Kodypay::Grpc::Utils::V1::GetLogsResponse
|
22
|
+
rpc :GetLogsStream, ::Com::Kodypay::Grpc::Utils::V1::GetLogsRequest, stream(::Com::Kodypay::Grpc::Utils::V1::GetLogsResponse)
|
23
|
+
end
|
24
|
+
|
25
|
+
Stub = Service.rpc_stub_class
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/order_pb.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: com/kodypay/grpc/ordering/v1/order.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
8
|
+
|
9
|
+
|
10
|
+
descriptor_data = "\n(com/kodypay/grpc/ordering/v1/order.proto\x12\x1c\x63om.kodypay.grpc.ordering.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf4\x01\n\x10GetOrdersRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12<\n\tstatus_in\x18\x02 \x03(\x0e\x32).com.kodypay.grpc.ordering.v1.OrderStatus\x12\x33\n\nafter_date\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x12\x17\n\npage_token\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x16\n\tpage_size\x18\x05 \x01(\x05H\x02\x88\x01\x01\x42\r\n\x0b_after_dateB\r\n\x0b_page_tokenB\x0c\n\n_page_size\"a\n\x11GetOrdersResponse\x12\x33\n\x06orders\x18\x01 \x03(\x0b\x32#.com.kodypay.grpc.ordering.v1.Order\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x97\x01\n\x18UpdateOrderStatusRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x10\n\x08order_id\x18\x02 \x01(\t\x12=\n\nnew_status\x18\x03 \x01(\x0e\x32).com.kodypay.grpc.ordering.v1.OrderStatus\x12\x18\n\x10idempotency_uuid\x18\x04 \x01(\t\"N\n\x19UpdateOrderStatusResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x14\n\x07message\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xf3\x01\n\x11RefundItemRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x10\n\x08order_id\x18\x02 \x01(\t\x12I\n\x05items\x18\x03 \x03(\x0b\x32:.com.kodypay.grpc.ordering.v1.RefundItemRequest.RefundItem\x12\x13\n\x06reason\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x10idempotency_uuid\x18\x05 \x01(\t\x1a\x35\n\nRefundItem\x12\x15\n\rorder_item_id\x18\x01 \x01(\t\x12\x10\n\x08quantity\x18\x02 \x01(\rB\t\n\x07_reason\"W\n\x12RefundItemResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\t\x12\x14\n\x07message\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"r\n\x12RefundOrderRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x10\n\x08order_id\x18\x02 \x01(\t\x12\x13\n\x06reason\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x10idempotency_uuid\x18\x04 \x01(\tB\t\n\x07_reason\"X\n\x13RefundOrderResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\t\x12\x14\n\x07message\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\x9f\n\n\x05Order\x12\x10\n\x08order_id\x18\x01 \x01(\t\x12\x10\n\x08store_id\x18\x02 \x01(\t\x12\x43\n\x05items\x18\x03 \x03(\x0b\x32\x34.com.kodypay.grpc.ordering.v1.Order.OrderItemOrCombo\x12\x18\n\x0border_notes\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0ctotal_amount\x18\x05 \x01(\t\x12\x1c\n\x0flocation_number\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\x39\n\x06status\x18\x07 \x01(\x0e\x32).com.kodypay.grpc.ordering.v1.OrderStatus\x12\x35\n\x0c\x64\x61te_created\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02\x88\x01\x01\x12\"\n\x15service_charge_amount\x18\t \x01(\tH\x03\x88\x01\x01\x1a\xa4\x01\n\x10OrderItemOrCombo\x12G\n\x04item\x18\x01 \x01(\x0b\x32\x37.com.kodypay.grpc.ordering.v1.Order.OrderItemWithAddOnsH\x00\x12?\n\x05\x63ombo\x18\x02 \x01(\x0b\x32..com.kodypay.grpc.ordering.v1.Order.OrderComboH\x00\x42\x06\n\x04type\x1a\x88\x02\n\x13OrderItemWithAddOns\x12\x15\n\rorder_item_id\x18\x01 \x01(\t\x12\x1b\n\x0eintegration_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x08quantity\x18\x03 \x01(\r\x12\x17\n\nitem_notes\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x42\n\x06\x61\x64\x64ons\x18\x06 \x03(\x0b\x32\x32.com.kodypay.grpc.ordering.v1.Order.OrderAddOnItem\x12\x12\n\nunit_price\x18\x07 \x01(\t\x12\x18\n\x10merchant_item_id\x18\x08 \x01(\tB\x11\n\x0f_integration_idB\r\n\x0b_item_notes\x1a\x98\x02\n\nOrderCombo\x12\x16\n\x0eorder_combo_id\x18\x01 \x01(\t\x12\x10\n\x08\x63ombo_id\x18\x02 \x01(\t\x12\x10\n\x08quantity\x18\x03 \x01(\r\x12\x18\n\x0b\x63ombo_notes\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x46\n\x05items\x18\x05 \x03(\x0b\x32\x37.com.kodypay.grpc.ordering.v1.Order.OrderItemWithAddOns\x12\x12\n\nunit_price\x18\x06 \x01(\t\x12\x1b\n\x0eintegration_id\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x10merchant_item_id\x18\x08 \x01(\tB\x0e\n\x0c_combo_notesB\x11\n\x0f_integration_id\x1a\xac\x01\n\x0eOrderAddOnItem\x12\x10\n\x08quantity\x18\x01 \x01(\r\x12\x12\n\nitem_notes\x18\x02 \x01(\t\x12\x16\n\x0eparent_item_id\x18\x03 \x01(\t\x12\x12\n\nunit_price\x18\x04 \x01(\t\x12\x1b\n\x0eintegration_id\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x10merchant_item_id\x18\x06 \x01(\tB\x11\n\x0f_integration_idB\x0e\n\x0c_order_notesB\x12\n\x10_location_numberB\x0f\n\r_date_createdB\x18\n\x16_service_charge_amount*j\n\x0bOrderStatus\x12\n\n\x06UNPAID\x10\x00\x12\r\n\tNEW_ORDER\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x12\r\n\tCOMPLETED\x10\x03\x12\x0c\n\x08\x44\x45\x43LINED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\n\n\x06PICKED\x10\x06\x32\xe8\x03\n\x0cOrderService\x12l\n\tGetOrders\x12..com.kodypay.grpc.ordering.v1.GetOrdersRequest\x1a/.com.kodypay.grpc.ordering.v1.GetOrdersResponse\x12\x84\x01\n\x11UpdateOrderStatus\x12\x36.com.kodypay.grpc.ordering.v1.UpdateOrderStatusRequest\x1a\x37.com.kodypay.grpc.ordering.v1.UpdateOrderStatusResponse\x12o\n\nRefundItem\x12/.com.kodypay.grpc.ordering.v1.RefundItemRequest\x1a\x30.com.kodypay.grpc.ordering.v1.RefundItemResponse\x12r\n\x0bRefundOrder\x12\x30.com.kodypay.grpc.ordering.v1.RefundOrderRequest\x1a\x31.com.kodypay.grpc.ordering.v1.RefundOrderResponseB,\n\x1c\x63om.kodypay.grpc.ordering.v1B\nOrderProtoP\x01\x62\x06proto3"
|
11
|
+
|
12
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
|
15
|
+
module Com
|
16
|
+
module Kodypay
|
17
|
+
module Grpc
|
18
|
+
module Ordering
|
19
|
+
module V1
|
20
|
+
GetOrdersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.GetOrdersRequest").msgclass
|
21
|
+
GetOrdersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.GetOrdersResponse").msgclass
|
22
|
+
UpdateOrderStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.UpdateOrderStatusRequest").msgclass
|
23
|
+
UpdateOrderStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.UpdateOrderStatusResponse").msgclass
|
24
|
+
RefundItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.RefundItemRequest").msgclass
|
25
|
+
RefundItemRequest::RefundItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.RefundItemRequest.RefundItem").msgclass
|
26
|
+
RefundItemResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.RefundItemResponse").msgclass
|
27
|
+
RefundOrderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.RefundOrderRequest").msgclass
|
28
|
+
RefundOrderResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.RefundOrderResponse").msgclass
|
29
|
+
Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.Order").msgclass
|
30
|
+
Order::OrderItemOrCombo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.Order.OrderItemOrCombo").msgclass
|
31
|
+
Order::OrderItemWithAddOns = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.Order.OrderItemWithAddOns").msgclass
|
32
|
+
Order::OrderCombo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.Order.OrderCombo").msgclass
|
33
|
+
Order::OrderAddOnItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.Order.OrderAddOnItem").msgclass
|
34
|
+
OrderStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.ordering.v1.OrderStatus").enummodule
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: com/kodypay/grpc/ordering/v1/order.proto for package 'com.kodypay.grpc.ordering.v1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require_relative "order_pb"
|
6
|
+
|
7
|
+
module Com
|
8
|
+
module Kodypay
|
9
|
+
module Grpc
|
10
|
+
module Ordering
|
11
|
+
module V1
|
12
|
+
module OrderService
|
13
|
+
# Service definition for managing Ordering orders.
|
14
|
+
class Service
|
15
|
+
|
16
|
+
include ::GRPC::GenericService
|
17
|
+
|
18
|
+
self.marshal_class_method = :encode
|
19
|
+
self.unmarshal_class_method = :decode
|
20
|
+
self.service_name = 'com.kodypay.grpc.ordering.v1.OrderService'
|
21
|
+
|
22
|
+
# RPC to retrieve orders based on filter criteria.
|
23
|
+
rpc :GetOrders, ::Com::Kodypay::Grpc::Ordering::V1::GetOrdersRequest, ::Com::Kodypay::Grpc::Ordering::V1::GetOrdersResponse
|
24
|
+
rpc :UpdateOrderStatus, ::Com::Kodypay::Grpc::Ordering::V1::UpdateOrderStatusRequest, ::Com::Kodypay::Grpc::Ordering::V1::UpdateOrderStatusResponse
|
25
|
+
# RPC to refund a specific item in an order.
|
26
|
+
rpc :RefundItem, ::Com::Kodypay::Grpc::Ordering::V1::RefundItemRequest, ::Com::Kodypay::Grpc::Ordering::V1::RefundItemResponse
|
27
|
+
# RPC to refund an entire order.
|
28
|
+
rpc :RefundOrder, ::Com::Kodypay::Grpc::Ordering::V1::RefundOrderRequest, ::Com::Kodypay::Grpc::Ordering::V1::RefundOrderResponse
|
29
|
+
end
|
30
|
+
|
31
|
+
Stub = Service.rpc_stub_class
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: com/kodypay/grpc/payattable/v1/pay_at_table.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
8
|
+
require 'google/protobuf/wrappers_pb'
|
9
|
+
|
10
|
+
|
11
|
+
descriptor_data = "\n1com/kodypay/grpc/payattable/v1/pay_at_table.proto\x12\x1e\x63om.kodypay.grpc.payattable.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\":\n\tCheckItem\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08quantity\x18\x02 \x01(\t\x12\r\n\x05price\x18\x03 \x01(\t\"K\n\x0c\x43heckPayment\x12\x13\n\x0btender_name\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\t\x12\x16\n\x0ereference_text\x18\x03 \x01(\t\"\xc5\x02\n\x05\x43heck\x12\x11\n\tcheck_ref\x18\x01 \x01(\t\x12\x14\n\x0c\x63heck_number\x18\x02 \x01(\t\x12\x12\n\ntable_name\x18\x03 \x01(\t\x12\x14\n\x0ctotal_amount\x18\x04 \x01(\t\x12\x13\n\x0b\x62\x61lance_due\x18\x05 \x01(\t\x12\x38\n\x05items\x18\x06 \x03(\x0b\x32).com.kodypay.grpc.payattable.v1.CheckItem\x12\x46\n\x10payments_applied\x18\x07 \x03(\x0b\x32,.com.kodypay.grpc.payattable.v1.CheckPayment\x12\x10\n\x08subtotal\x18\x08 \x01(\t\x12\x11\n\ttax_total\x18\t \x01(\t\x12-\n\topen_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xbe\x01\n\x11\x46indChecksRequest\x12\x14\n\x0csearch_query\x18\x01 \x01(\t\x12Q\n\x0bsearch_type\x18\x02 \x01(\x0e\x32<.com.kodypay.grpc.payattable.v1.FindChecksRequest.SearchType\x12\x10\n\x08store_id\x18\x03 \x01(\t\".\n\nSearchType\x12\x0e\n\nTABLE_NAME\x10\x00\x12\x10\n\x0c\x43HECK_NUMBER\x10\x01\"b\n\x12\x46indChecksResponse\x12\x35\n\x06\x63hecks\x18\x01 \x03(\x0b\x32%.com.kodypay.grpc.payattable.v1.Check\x12\x15\n\rerror_message\x18\x02 \x01(\t2\x88\x01\n\x11PayAtTableService\x12s\n\nFindChecks\x12\x31.com.kodypay.grpc.payattable.v1.FindChecksRequest\x1a\x32.com.kodypay.grpc.payattable.v1.FindChecksResponseb\x06proto3"
|
12
|
+
|
13
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
14
|
+
pool.add_serialized_file(descriptor_data)
|
15
|
+
|
16
|
+
module Com
|
17
|
+
module Kodypay
|
18
|
+
module Grpc
|
19
|
+
module Payattable
|
20
|
+
module V1
|
21
|
+
CheckItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.payattable.v1.CheckItem").msgclass
|
22
|
+
CheckPayment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.payattable.v1.CheckPayment").msgclass
|
23
|
+
Check = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.payattable.v1.Check").msgclass
|
24
|
+
FindChecksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.payattable.v1.FindChecksRequest").msgclass
|
25
|
+
FindChecksRequest::SearchType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.payattable.v1.FindChecksRequest.SearchType").enummodule
|
26
|
+
FindChecksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.payattable.v1.FindChecksResponse").msgclass
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: com/kodypay/grpc/payattable/v1/pay_at_table.proto for package 'com.kodypay.grpc.payattable.v1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require_relative "pay_at_table_pb"
|
6
|
+
|
7
|
+
module Com
|
8
|
+
module Kodypay
|
9
|
+
module Grpc
|
10
|
+
module Payattable
|
11
|
+
module V1
|
12
|
+
module PayAtTableService
|
13
|
+
# Service definition for Pay@Table operations
|
14
|
+
class Service
|
15
|
+
|
16
|
+
include ::GRPC::GenericService
|
17
|
+
|
18
|
+
self.marshal_class_method = :encode
|
19
|
+
self.unmarshal_class_method = :decode
|
20
|
+
self.service_name = 'com.kodypay.grpc.payattable.v1.PayAtTableService'
|
21
|
+
|
22
|
+
# Find open checks based on search criteria (e.g., table number, check number)
|
23
|
+
rpc :FindChecks, ::Com::Kodypay::Grpc::Payattable::V1::FindChecksRequest, ::Com::Kodypay::Grpc::Payattable::V1::FindChecksResponse
|
24
|
+
end
|
25
|
+
|
26
|
+
Stub = Service.rpc_stub_class
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/pay_pb.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: com/kodypay/grpc/pay/v1/pay.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
8
|
+
|
9
|
+
|
10
|
+
descriptor_data = "\n!com/kodypay/grpc/pay/v1/pay.proto\x12\x17\x63om.kodypay.grpc.pay.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"$\n\x10TerminalsRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\"I\n\x11TerminalsResponse\x12\x34\n\tterminals\x18\x01 \x03(\x0b\x32!.com.kodypay.grpc.pay.v1.Terminal\"/\n\x08Terminal\x12\x13\n\x0bterminal_id\x18\x01 \x01(\t\x12\x0e\n\x06online\x18\x02 \x01(\x08\"\xbe\x04\n\nPayRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\t\x12\x13\n\x0bterminal_id\x18\x03 \x01(\t\x12\x16\n\tshow_tips\x18\x04 \x01(\x08H\x00\x88\x01\x01\x12\x43\n\x0epayment_method\x18\x05 \x01(\x0b\x32&.com.kodypay.grpc.pay.v1.PaymentMethodH\x01\x88\x01\x01\x12\x1d\n\x10idempotency_uuid\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x1e\n\x11payment_reference\x18\x07 \x01(\tH\x03\x88\x01\x01\x12\x15\n\x08order_id\x18\x08 \x01(\tH\x04\x88\x01\x01\x12H\n\x0c\x61\x63\x63\x65pts_only\x18\t \x03(\x0e\x32\x32.com.kodypay.grpc.pay.v1.PayRequest.PaymentMethods\"\xa2\x01\n\x0ePaymentMethods\x12\x08\n\x04VISA\x10\x00\x12\x0e\n\nMASTERCARD\x10\x01\x12\x08\n\x04\x41MEX\x10\x02\x12\x0f\n\x0b\x42\x41N_CONTACT\x10\x03\x12\x13\n\x0f\x43HINA_UNION_PAY\x10\x04\x12\x0b\n\x07MAESTRO\x10\x05\x12\n\n\x06\x44INERS\x10\x06\x12\x0c\n\x08\x44ISCOVER\x10\x07\x12\x07\n\x03JCB\x10\x08\x12\n\n\x06\x41LIPAY\x10\t\x12\n\n\x06WECHAT\x10\nB\x0c\n\n_show_tipsB\x11\n\x0f_payment_methodB\x13\n\x11_idempotency_uuidB\x14\n\x12_payment_referenceB\x0b\n\t_order_id\"\xbf\x01\n\rPaymentMethod\x12L\n\x13payment_method_type\x18\x01 \x01(\x0e\x32*.com.kodypay.grpc.pay.v1.PaymentMethodTypeH\x01\x88\x01\x01\x12\x0f\n\x05token\x18\x02 \x01(\tH\x00\x12\"\n\x18\x61\x63tivate_qr_code_scanner\x18\x03 \x01(\x08H\x00\x42\x13\n\x11verification_modeB\x16\n\x14_payment_method_type\"\xbd\r\n\x0bPayResponse\x12\x36\n\x06status\x18\x01 \x01(\x0e\x32&.com.kodypay.grpc.pay.v1.PaymentStatus\x12\x1b\n\x0e\x66\x61ilure_reason\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x1d\n\x0creceipt_json\x18\x03 \x01(\tB\x02\x18\x01H\x01\x88\x01\x01\x12\x12\n\npayment_id\x18\x04 \x01(\t\x12\x30\n\x0c\x64\x61te_created\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\rpsp_reference\x18\x06 \x01(\tB\x02\x18\x01H\x02\x88\x01\x01\x12\x31\n\tdate_paid\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01\x12\x1d\n\x0ctotal_amount\x18\x08 \x01(\tB\x02\x18\x01H\x03\x88\x01\x01\x12\x1c\n\x0bsale_amount\x18\t \x01(\tB\x02\x18\x01H\x04\x88\x01\x01\x12\x1c\n\x0btips_amount\x18\n \x01(\tB\x02\x18\x01H\x05\x88\x01\x01\x12K\n\x0cpayment_data\x18\x0b \x01(\x0b\x32\x30.com.kodypay.grpc.pay.v1.PayResponse.PaymentDataH\x06\x88\x01\x01\x12\x1e\n\x11payment_reference\x18\x0c \x01(\tH\x07\x88\x01\x01\x12\x15\n\x08order_id\x18\r \x01(\tH\x08\x88\x01\x01\x12H\n\x0c\x61\x63\x63\x65pts_only\x18\x0e \x03(\x0e\x32\x32.com.kodypay.grpc.pay.v1.PayRequest.PaymentMethods\x12 \n\x13is_payment_declined\x18\x0f \x01(\x08H\t\x88\x01\x01\x12\x43\n\x07refunds\x18\x10 \x03(\x0b\x32\x32.com.kodypay.grpc.pay.v1.PayResponse.RefundDetails\x1a\xea\x04\n\x0bPaymentData\x12-\n\tdate_paid\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0ctotal_amount\x18\x02 \x01(\t\x12\x13\n\x0bsale_amount\x18\x03 \x01(\t\x12\x13\n\x0btips_amount\x18\x04 \x01(\t\x12\x14\n\x0creceipt_json\x18\x05 \x01(\t\x12\x15\n\rpsp_reference\x18\x06 \x01(\t\x12G\n\x13payment_method_type\x18\x07 \x01(\x0e\x32*.com.kodypay.grpc.pay.v1.PaymentMethodType\x12\x16\n\x0epayment_method\x18\x08 \x01(\t\x12W\n\x0cpayment_card\x18\t \x01(\x0b\x32<.com.kodypay.grpc.pay.v1.PayResponse.PaymentData.PaymentCardH\x00\x88\x01\x01\x12#\n\x16payment_method_variant\x18\n \x01(\tH\x01\x88\x01\x01\x12\x1a\n\rrefund_amount\x18\x0b \x01(\tH\x02\x88\x01\x01\x1a\x85\x01\n\x0bPaymentCard\x12\x1a\n\x12\x63\x61rd_last_4_digits\x18\x01 \x01(\t\x12\x18\n\x10\x63\x61rd_expiry_date\x18\x02 \x01(\t\x12\x16\n\x0epos_entry_mode\x18\x03 \x01(\t\x12\x15\n\rpayment_token\x18\x04 \x01(\t\x12\x11\n\tauth_code\x18\x05 \x01(\tB\x0f\n\r_payment_cardB\x19\n\x17_payment_method_variantB\x10\n\x0e_refund_amount\x1a\xf0\x01\n\rRefundDetails\x12\x12\n\npayment_id\x18\x01 \x01(\t\x12!\n\x14refund_psp_reference\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x16payment_transaction_id\x18\x03 \x01(\t\x12\x15\n\rrefund_amount\x18\x04 \x01(\t\x12.\n\nevent_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x0bterminal_id\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\x17\n\x15_refund_psp_referenceB\x0e\n\x0c_terminal_idB\x11\n\x0f_failure_reasonB\x0f\n\r_receipt_jsonB\x10\n\x0e_psp_referenceB\x0f\n\r_total_amountB\x0e\n\x0c_sale_amountB\x0e\n\x0c_tips_amountB\x0f\n\r_payment_dataB\x14\n\x12_payment_referenceB\x0b\n\t_order_idB\x16\n\x14_is_payment_declined\"n\n\rCancelRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\t\x12\x13\n\x0bterminal_id\x18\x03 \x01(\t\x12\x17\n\npayment_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\r\n\x0b_payment_id\"H\n\x0e\x43\x61ncelResponse\x12\x36\n\x06status\x18\x01 \x01(\x0e\x32&.com.kodypay.grpc.pay.v1.PaymentStatus\";\n\x15PaymentDetailsRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x10\n\x08order_id\x18\x02 \x01(\t\"\x85\x02\n\rRefundRequest\x12\x10\n\x08store_id\x18\x01 \x01(\t\x12\x12\n\npayment_id\x18\x02 \x01(\t\x12\x0e\n\x06\x61mount\x18\x03 \x01(\t\x12\x1d\n\x10idempotency_uuid\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0bterminal_id\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x1e\n\x11\x65xt_pay_reference\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x19\n\x0c\x65xt_order_id\x18\x07 \x01(\tH\x03\x88\x01\x01\x42\x13\n\x11_idempotency_uuidB\x0e\n\x0c_terminal_idB\x14\n\x12_ext_pay_referenceB\x0f\n\r_ext_order_id\"\x9c\x04\n\x0eRefundResponse\x12\x44\n\x06status\x18\x01 \x01(\x0e\x32\x34.com.kodypay.grpc.pay.v1.RefundResponse.RefundStatus\x12\x1b\n\x0e\x66\x61ilure_reason\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x12\n\npayment_id\x18\x03 \x01(\t\x12\x30\n\x0c\x64\x61te_created\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11total_paid_amount\x18\x05 \x01(\t\x12\x1d\n\x15total_amount_refunded\x18\x06 \x01(\t\x12\x18\n\x10remaining_amount\x18\x07 \x01(\t\x12\x1e\n\x16total_amount_requested\x18\x08 \x01(\t\x12\x1c\n\x14paymentTransactionId\x18\t \x01(\t\x12\x15\n\x08order_id\x18\n \x01(\tH\x01\x88\x01\x01\x12\x1e\n\x11\x65xt_pay_reference\x18\x0b \x01(\tH\x02\x88\x01\x01\x12\x19\n\x0c\x65xt_order_id\x18\x0c \x01(\tH\x03\x88\x01\x01\"6\n\x0cRefundStatus\x12\x0b\n\x07PENDING\x10\x00\x12\r\n\tREQUESTED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x11\n\x0f_failure_reasonB\x0b\n\t_order_idB\x14\n\x12_ext_pay_referenceB\x0f\n\r_ext_order_id\"\xb6\x01\n\x12VoidPaymentRequest\x12\x17\n\rpsp_reference\x18\x01 \x01(\tH\x00\x12\x14\n\npayment_id\x18\x02 \x01(\tH\x00\x12\x1e\n\x11payment_reference\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08order_id\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x08store_id\x18\x05 \x01(\tB\x05\n\x03idsB\x14\n\x12_payment_referenceB\x0b\n\t_order_id\"\xd2\x03\n\x13VoidPaymentResponse\x12\x15\n\rpsp_reference\x18\x01 \x01(\t\x12\x12\n\npayment_id\x18\x02 \x01(\t\x12G\n\x06status\x18\x03 \x01(\x0e\x32\x37.com.kodypay.grpc.pay.v1.VoidPaymentResponse.VoidStatus\x12M\n\tsale_data\x18\x04 \x01(\x0b\x32\x35.com.kodypay.grpc.pay.v1.VoidPaymentResponse.SaleDataH\x00\x88\x01\x01\x12/\n\x0b\x64\x61te_voided\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aw\n\x08SaleData\x12\x14\n\x0ctotal_amount\x18\x01 \x01(\t\x12\x13\n\x0bsale_amount\x18\x02 \x01(\t\x12\x13\n\x0btips_amount\x18\x03 \x01(\t\x12\x10\n\x08order_id\x18\x04 \x01(\t\x12\x19\n\x11payment_reference\x18\x05 \x01(\t\"@\n\nVoidStatus\x12\x0b\n\x07PENDING\x10\x00\x12\r\n\tREQUESTED\x10\x01\x12\n\n\x06VOIDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x42\x0c\n\n_sale_data*+\n\x11PaymentMethodType\x12\x08\n\x04\x43\x41RD\x10\x00\x12\x0c\n\x08\x45_WALLET\x10\x01*|\n\rPaymentStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\x0c\n\x08\x44\x45\x43LINED\x10\x04\x12\x12\n\x0eREFUND_PENDING\x10\x05\x12\x14\n\x10REFUND_REQUESTED\x10\x06\x32\xd3\x04\n\x16KodyPayTerminalService\x12\x62\n\tTerminals\x12).com.kodypay.grpc.pay.v1.TerminalsRequest\x1a*.com.kodypay.grpc.pay.v1.TerminalsResponse\x12R\n\x03Pay\x12#.com.kodypay.grpc.pay.v1.PayRequest\x1a$.com.kodypay.grpc.pay.v1.PayResponse0\x01\x12Y\n\x06\x43\x61ncel\x12&.com.kodypay.grpc.pay.v1.CancelRequest\x1a\'.com.kodypay.grpc.pay.v1.CancelResponse\x12\x66\n\x0ePaymentDetails\x12..com.kodypay.grpc.pay.v1.PaymentDetailsRequest\x1a$.com.kodypay.grpc.pay.v1.PayResponse\x12[\n\x06Refund\x12&.com.kodypay.grpc.pay.v1.RefundRequest\x1a\'.com.kodypay.grpc.pay.v1.RefundResponse0\x01\x12\x61\n\x04Void\x12+.com.kodypay.grpc.pay.v1.VoidPaymentRequest\x1a,.com.kodypay.grpc.pay.v1.VoidPaymentResponseB1\n\x17\x63om.kodypay.grpc.pay.v1B\x14KodyPayTerminalProtoP\x01\x62\x06proto3"
|
11
|
+
|
12
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
|
15
|
+
module Com
|
16
|
+
module Kodypay
|
17
|
+
module Grpc
|
18
|
+
module Pay
|
19
|
+
module V1
|
20
|
+
TerminalsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.TerminalsRequest").msgclass
|
21
|
+
TerminalsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.TerminalsResponse").msgclass
|
22
|
+
Terminal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.Terminal").msgclass
|
23
|
+
PayRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PayRequest").msgclass
|
24
|
+
PayRequest::PaymentMethods = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PayRequest.PaymentMethods").enummodule
|
25
|
+
PaymentMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PaymentMethod").msgclass
|
26
|
+
PayResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PayResponse").msgclass
|
27
|
+
PayResponse::PaymentData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PayResponse.PaymentData").msgclass
|
28
|
+
PayResponse::PaymentData::PaymentCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PayResponse.PaymentData.PaymentCard").msgclass
|
29
|
+
PayResponse::RefundDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PayResponse.RefundDetails").msgclass
|
30
|
+
CancelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.CancelRequest").msgclass
|
31
|
+
CancelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.CancelResponse").msgclass
|
32
|
+
PaymentDetailsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PaymentDetailsRequest").msgclass
|
33
|
+
RefundRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.RefundRequest").msgclass
|
34
|
+
RefundResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.RefundResponse").msgclass
|
35
|
+
RefundResponse::RefundStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.RefundResponse.RefundStatus").enummodule
|
36
|
+
VoidPaymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.VoidPaymentRequest").msgclass
|
37
|
+
VoidPaymentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.VoidPaymentResponse").msgclass
|
38
|
+
VoidPaymentResponse::SaleData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.VoidPaymentResponse.SaleData").msgclass
|
39
|
+
VoidPaymentResponse::VoidStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.VoidPaymentResponse.VoidStatus").enummodule
|
40
|
+
PaymentMethodType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PaymentMethodType").enummodule
|
41
|
+
PaymentStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PaymentStatus").enummodule
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: com/kodypay/grpc/pay/v1/pay.proto for package 'com.kodypay.grpc.pay.v1'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require_relative "pay_pb"
|
6
|
+
|
7
|
+
module Com
|
8
|
+
module Kodypay
|
9
|
+
module Grpc
|
10
|
+
module Pay
|
11
|
+
module V1
|
12
|
+
module KodyPayTerminalService
|
13
|
+
class Service
|
14
|
+
|
15
|
+
include ::GRPC::GenericService
|
16
|
+
|
17
|
+
self.marshal_class_method = :encode
|
18
|
+
self.unmarshal_class_method = :decode
|
19
|
+
self.service_name = 'com.kodypay.grpc.pay.v1.KodyPayTerminalService'
|
20
|
+
|
21
|
+
rpc :Terminals, ::Com::Kodypay::Grpc::Pay::V1::TerminalsRequest, ::Com::Kodypay::Grpc::Pay::V1::TerminalsResponse
|
22
|
+
rpc :Pay, ::Com::Kodypay::Grpc::Pay::V1::PayRequest, stream(::Com::Kodypay::Grpc::Pay::V1::PayResponse)
|
23
|
+
rpc :Cancel, ::Com::Kodypay::Grpc::Pay::V1::CancelRequest, ::Com::Kodypay::Grpc::Pay::V1::CancelResponse
|
24
|
+
rpc :PaymentDetails, ::Com::Kodypay::Grpc::Pay::V1::PaymentDetailsRequest, ::Com::Kodypay::Grpc::Pay::V1::PayResponse
|
25
|
+
rpc :Refund, ::Com::Kodypay::Grpc::Pay::V1::RefundRequest, stream(::Com::Kodypay::Grpc::Pay::V1::RefundResponse)
|
26
|
+
rpc :Void, ::Com::Kodypay::Grpc::Pay::V1::VoidPaymentRequest, ::Com::Kodypay::Grpc::Pay::V1::VoidPaymentResponse
|
27
|
+
end
|
28
|
+
|
29
|
+
Stub = Service.rpc_stub_class
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
puts "🚀 KodyPay Ruby SDK Sample - GetPayments API"
|
6
|
+
puts "============================================="
|
7
|
+
puts "📦 Using kody-clientsdk-ruby gem from RubyGems"
|
8
|
+
puts
|
9
|
+
|
10
|
+
# Configuration - replace with your actual credentials
|
11
|
+
api_key = ENV['KODY_API_KEY'] || 'your-api-key-here'
|
12
|
+
store_id = ENV['KODY_STORE_ID'] || 'your-store-id-here'
|
13
|
+
endpoint = ENV['KODY_ENDPOINT'] || 'grpc-staging-ap.kodypay.com:443'
|
14
|
+
|
15
|
+
puts "📡 Endpoint: #{endpoint}"
|
16
|
+
puts "🔑 Store ID: #{store_id[0..8]}..."
|
17
|
+
puts "🗝️ API Key: #{api_key[0..10]}..."
|
18
|
+
puts
|
19
|
+
|
20
|
+
begin
|
21
|
+
# Require the published gem
|
22
|
+
require 'kody'
|
23
|
+
|
24
|
+
# Create the stub and make the API call
|
25
|
+
stub = Com::Kodypay::Grpc::Ecom::V1::KodyEcomPaymentsService::Stub.new(
|
26
|
+
endpoint,
|
27
|
+
GRPC::Core::ChannelCredentials.new
|
28
|
+
)
|
29
|
+
|
30
|
+
request = Com::Kodypay::Grpc::Ecom::V1::GetPaymentsRequest.new(
|
31
|
+
store_id: store_id,
|
32
|
+
page_cursor: Com::Kodypay::Grpc::Ecom::V1::GetPaymentsRequest::PageCursor.new(
|
33
|
+
page: 1,
|
34
|
+
page_size: 10
|
35
|
+
)
|
36
|
+
)
|
37
|
+
|
38
|
+
puts "📤 Making gRPC call to GetPayments API..."
|
39
|
+
response = stub.get_payments(request, metadata: { 'x-api-key' => api_key })
|
40
|
+
|
41
|
+
puts "🎉 SUCCESS! Response from KodyPay API:"
|
42
|
+
puts "📊 Total payments: #{response.response.total}"
|
43
|
+
|
44
|
+
if response.response.payments.empty?
|
45
|
+
puts "📭 No payments found for this store"
|
46
|
+
else
|
47
|
+
response.response.payments.each_with_index do |payment, index|
|
48
|
+
puts "\n💳 Payment #{index + 1}:"
|
49
|
+
puts " ID: #{payment.payment_id}"
|
50
|
+
puts " Status: #{payment.status}"
|
51
|
+
puts " Created: #{Time.at(payment.date_created.seconds).strftime('%Y-%m-%d %H:%M:%S')}"
|
52
|
+
|
53
|
+
if payment.sale_data
|
54
|
+
sale = payment.sale_data
|
55
|
+
amount = (sale.amount_minor_units / 100.0).round(2)
|
56
|
+
puts " Amount: #{amount} #{sale.currency}"
|
57
|
+
puts " Order ID: #{sale.order_id}"
|
58
|
+
puts " Payment Ref: #{sale.payment_reference}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
rescue GRPC::BadStatus => e
|
64
|
+
puts "❌ gRPC API Error: #{e.code} - #{e.message}"
|
65
|
+
puts "💡 Check your API credentials and store permissions"
|
66
|
+
rescue LoadError => e
|
67
|
+
puts "❌ Missing dependency: #{e.message}"
|
68
|
+
puts "💡 Install the gem with: gem install kody-clientsdk-ruby"
|
69
|
+
rescue => e
|
70
|
+
puts "❌ Error: #{e.message}"
|
71
|
+
puts "🔍 #{e.backtrace.first}"
|
72
|
+
end
|
73
|
+
|
74
|
+
puts "\n📚 Documentation:"
|
75
|
+
puts " RubyGems: https://rubygems.org/gems/kody-clientsdk-ruby"
|
76
|
+
puts " GitHub: https://github.com/KodyPay/kody-clientsdk-ruby"
|
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kody-clientsdk-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.6.14
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kody Tech Team
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-08-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: grpc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.74.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.74.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: google-protobuf
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 4.31.0
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '5.0'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 4.31.0
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '5.0'
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: bundler
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '2.0'
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '2.0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: rake
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '13.0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '13.0'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rspec
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '3.0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '3.0'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: grpc-tools
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - "~>"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 1.74.0
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - "~>"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 1.74.0
|
109
|
+
description: A Ruby client library for integrating with Kody payment APIs using gRPC
|
110
|
+
email:
|
111
|
+
- tech@kody.com
|
112
|
+
executables: []
|
113
|
+
extensions: []
|
114
|
+
extra_rdoc_files: []
|
115
|
+
files:
|
116
|
+
- Gemfile
|
117
|
+
- LICENSE
|
118
|
+
- README.md
|
119
|
+
- Rakefile
|
120
|
+
- kody-clientsdk-ruby.gemspec
|
121
|
+
- lib/ecom_pb.rb
|
122
|
+
- lib/ecom_services_pb.rb
|
123
|
+
- lib/inventory_pb.rb
|
124
|
+
- lib/inventory_services_pb.rb
|
125
|
+
- lib/kody.rb
|
126
|
+
- lib/kody/configuration.rb
|
127
|
+
- lib/kody/version.rb
|
128
|
+
- lib/logging_pb.rb
|
129
|
+
- lib/logging_services_pb.rb
|
130
|
+
- lib/order_pb.rb
|
131
|
+
- lib/order_services_pb.rb
|
132
|
+
- lib/pay_at_table_pb.rb
|
133
|
+
- lib/pay_at_table_services_pb.rb
|
134
|
+
- lib/pay_pb.rb
|
135
|
+
- lib/pay_services_pb.rb
|
136
|
+
- samples/ecom/get_payments.rb
|
137
|
+
homepage: https://github.com/KodyPay/kody-clientsdk-ruby
|
138
|
+
licenses:
|
139
|
+
- MIT
|
140
|
+
metadata:
|
141
|
+
homepage_uri: https://github.com/KodyPay/kody-clientsdk-ruby
|
142
|
+
source_code_uri: https://github.com/KodyPay/kody-clientsdk-ruby
|
143
|
+
changelog_uri: https://github.com/KodyPay/kody-clientsdk-ruby/blob/main/CHANGELOG.md
|
144
|
+
post_install_message:
|
145
|
+
rdoc_options: []
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 2.6.10
|
153
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
requirements: []
|
159
|
+
rubygems_version: 3.4.19
|
160
|
+
signing_key:
|
161
|
+
specification_version: 4
|
162
|
+
summary: Ruby gRPC client for Kody payment services
|
163
|
+
test_files: []
|