kody-clientsdk-ruby 1.6.3 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c52a53bbb23361c316ff9c1b025794fe92611728ff8db5d6c592b798f6cc7eb4
4
- data.tar.gz: '07992297134e806d7b01fc4bcb6defbcf6c53b82d81af01eca79732802bb0c6f'
3
+ metadata.gz: 8debbaf6c1e5c93b1ab8c52bc664d027075b025a20a0981e15f81e41e2e42813
4
+ data.tar.gz: 92f71d6f53310ece007b3e3e801e887642939a0c50a46108a5498f8e7d8be96f
5
5
  SHA512:
6
- metadata.gz: e7d67e49af9b8afdd2f20365295546199135db19a15d1a6cfeca97513a3485cd7dce2230c02ac3ef4712557f96f55e9071865bead4708b5c2668f1698e7dccb1
7
- data.tar.gz: d1f34ef403cf3badadfbb126b36ddc21b36ef3936ad84e240bcf99b41f33ba4d5f93418859f0165661d5bc1165459b2ebf52fb2678a71bf4e2ed995190f94b92
6
+ metadata.gz: 3bbcf37c83cecb290aeaf5e77072a2c684fbe001f2ceee5375cd38991304f8ca8c03c4f29273ad75489c123cb2132c9c0426b99ed5444e26930df5e9979b8e80
7
+ data.tar.gz: 524b2b076319b846f593ec7585fa019852b34b3322ef2063b3a1de769db671033dc6aa5fe2a7cc3a860559aff13685a14e128646a15ded788f109560b15f0906
data/README.md CHANGED
@@ -1,211 +1,128 @@
1
1
  # Kody API - Ruby SDK
2
2
 
3
- This guide provides an overview of using the Kody API and its reference documentation for Ruby.
3
+ This guide provides an overview of using the Kody API and its reference documentation.
4
4
 
5
- - [Installation](#installation)
5
+ - [Client Libraries](#client-libraries)
6
+ - [Ruby Installation](#ruby-installation)
6
7
  - [Authentication](#authentication)
7
- - [Quick Start](#quick-start)
8
+ - [Documentation](#documentation)
8
9
  - [Sample code](#sample-code)
9
10
 
10
- ## Installation
11
+ ## Client Libraries
11
12
 
12
- Add this line to your application's Gemfile:
13
+ Kody provides client libraries for many popular languages to access the APIs. If your desired programming language is supported by the client libraries, we recommend that you use this option.
13
14
 
14
- ```ruby
15
- gem 'kody-clientsdk-ruby'
16
- ```
15
+ Available languages:
16
+ - Java: https://github.com/KodyPay/kody-clientsdk-java/
17
+ - Python: https://github.com/KodyPay/kody-clientsdk-python/
18
+ - PHP: https://github.com/KodyPay/kody-clientsdk-php/
19
+ - .Net: https://github.com/KodyPay/kody-clientsdk-dotnet/
20
+ - Ruby: https://github.com/KodyPay/kody-clientsdk-ruby/
17
21
 
18
- And then execute:
22
+ The advantages of using the Kody Client library instead of a REST API are:
23
+ - Maintained by Kody.
24
+ - Built-in authentication and increased security.
25
+ - Built-in retries.
26
+ - Idiomatic for each language.
27
+ - Quicker development.
28
+ - Backwards compatibility with new versions.
19
29
 
20
- ```bash
21
- bundle install
22
- ```
30
+ If your coding language is not listed, please let the Kody team know and we will be able to create it for you.
23
31
 
24
- Or install it yourself as:
32
+ ## Ruby Installation
33
+ ### Requirements
34
+ - Ruby 2.6.10 and above
35
+ - Bundler (optional), recommended way to manage dependencies
36
+
37
+ Install the Kody Ruby Client SDK using gem:
25
38
 
26
39
  ```bash
27
40
  gem install kody-clientsdk-ruby
28
41
  ```
29
42
 
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
43
+ Or add to your Gemfile:
49
44
 
50
45
  ```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
46
+ gem 'kody-clientsdk-ruby'
82
47
  ```
83
48
 
84
- ## Configuration Options
49
+ The library can also be downloaded from [RubyGems](https://rubygems.org/gems/kody-clientsdk-ruby).
85
50
 
86
- ### Environment Configuration
51
+ ### Import in code
87
52
 
88
53
  ```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
54
+ require 'kody'
102
55
 
103
- # Local development
56
+ # Configure SDK
104
57
  Kody.configure do |config|
58
+ config.staging_ap! # Use Asia-Pacific staging
105
59
  config.api_key = 'your-api-key'
106
60
  config.store_id = 'your-store-id'
107
- config.development! # Sets host to 'localhost:8080' with TLS disabled
108
61
  end
109
- ```
110
-
111
- ### Environment Variables
112
62
 
113
- You can also configure using environment variables:
63
+ # eCommerce API
64
+ ecom_stub = Com::Kodypay::Grpc::Ecom::V1::KodyEcomPaymentsService::Stub.new(
65
+ Kody.configuration.endpoint,
66
+ GRPC::Core::ChannelCredentials.new
67
+ )
114
68
 
115
- ```bash
116
- export KODY_API_KEY="your-api-key"
117
- export KODY_STORE_ID="your-store-id"
118
- ```
69
+ # Terminal API
70
+ terminal_stub = Com::Kodypay::Grpc::Pay::V1::KodyPayTerminalService::Stub.new(
71
+ Kody.configuration.endpoint,
72
+ GRPC::Core::ChannelCredentials.new
73
+ )
119
74
 
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
75
+ # Ordering API
76
+ ordering_stub = Com::Kodypay::Grpc::Ordering::V1::KodyOrderingService::Stub.new(
77
+ Kody.configuration.endpoint,
78
+ GRPC::Core::ChannelCredentials.new
79
+ )
126
80
  ```
127
81
 
128
- ## Available Methods
129
-
130
- ### E-commerce Payments
131
-
132
- #### Initiate Payment
82
+ ## Authentication
133
83
 
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
- ```
84
+ The client library uses a combination of a `Store ID` and an `API key`.
85
+ These will be shared with you during the technical integration onboarding or by your Kody contact.
152
86
 
153
- #### Get Payments
87
+ 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.
154
88
 
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
- )
89
+ The test and live API calls are always compatible, only changing credentials and the service hostname is required to enable the integration in production.
164
90
 
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
- ```
91
+ ### Host names
172
92
 
173
- **Note:** Currently, `initiate_payment` and `get_payments` methods are implemented. Additional methods (payment details, refunds, etc.) will be added in future versions.
93
+ Development and Test:
94
+ - Default: `grpc-staging.kodypay.com`
95
+ - For Asia-specific region: `grpc-staging-ap.kodypay.com`
96
+ - For Europe-specific region: `grpc-staging-eu.kodypay.com`
174
97
 
175
- ## Helper Methods
98
+ Live:
99
+ - Default: `grpc.kodypay.com`
100
+ - For Asia-specific region: `grpc-ap.kodypay.com`
101
+ - For Europe-specific region: `grpc-eu.kodypay.com`
176
102
 
177
- The SDK provides convenient helper methods:
103
+ ### Endpoints Configuration
178
104
 
179
105
  ```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"
106
+ # Production
107
+ config.production! # grpc.kodypay.com:443
108
+ config.production_ap! # grpc-ap.kodypay.com:443
109
+ config.production_eu! # grpc-eu.kodypay.com:443
110
+
111
+ # Staging
112
+ config.staging! # grpc-staging.kodypay.com:443
113
+ config.staging_ap! # grpc-staging-ap.kodypay.com:443
114
+ config.staging_eu! # grpc-staging-eu.kodypay.com:443
187
115
  ```
188
116
 
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
117
  ## Documentation
197
118
 
198
119
  For complete API documentation, examples, and integration guides, please visit:
199
120
  šŸ“š https://api-docs.kody.com
200
121
 
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
122
+ ## Sample code
210
123
 
211
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
124
+ - Java: https://github.com/KodyPay/kody-clientsdk-java/tree/main/samples
125
+ - Python: https://github.com/KodyPay/kody-clientsdk-python/tree/main/versions/3_12/samples
126
+ - PHP: https://github.com/KodyPay/kody-clientsdk-php/tree/main/samples
127
+ - .Net: https://github.com/KodyPay/kody-clientsdk-dotnet/tree/main/samples
128
+ - Ruby: https://github.com/KodyPay/kody-clientsdk-ruby/tree/main/samples
@@ -1,8 +1,15 @@
1
1
  module Kody
2
2
  class Configuration
3
- # Common KodyPay gRPC endpoints
4
- PRODUCTION_ENDPOINT = 'grpc.kodypay.com:443'
5
- STAGING_ENDPOINT = 'grpc-staging-ap.kodypay.com:443'
3
+ # KodyPay gRPC endpoints by region
4
+ # Production endpoints
5
+ PRODUCTION_ENDPOINT = 'grpc.kodypay.com:443' # Default
6
+ PRODUCTION_AP_ENDPOINT = 'grpc-ap.kodypay.com:443' # Asia-Pacific
7
+ PRODUCTION_EU_ENDPOINT = 'grpc-eu.kodypay.com:443' # Europe
8
+
9
+ # Staging endpoints
10
+ STAGING_ENDPOINT = 'grpc-staging.kodypay.com:443' # Default
11
+ STAGING_AP_ENDPOINT = 'grpc-staging-ap.kodypay.com:443' # Asia-Pacific
12
+ STAGING_EU_ENDPOINT = 'grpc-staging-eu.kodypay.com:443' # Europe
6
13
 
7
14
  attr_accessor :api_key, :store_id, :endpoint
8
15
 
@@ -13,5 +20,25 @@ module Kody
13
20
  def staging!
14
21
  @endpoint = STAGING_ENDPOINT
15
22
  end
23
+
24
+ def staging_ap!
25
+ @endpoint = STAGING_AP_ENDPOINT
26
+ end
27
+
28
+ def staging_eu!
29
+ @endpoint = STAGING_EU_ENDPOINT
30
+ end
31
+
32
+ def production!
33
+ @endpoint = PRODUCTION_ENDPOINT
34
+ end
35
+
36
+ def production_ap!
37
+ @endpoint = PRODUCTION_AP_ENDPOINT
38
+ end
39
+
40
+ def production_eu!
41
+ @endpoint = PRODUCTION_EU_ENDPOINT
42
+ end
16
43
  end
17
44
  end
data/lib/kody/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kody
2
- VERSION = "1.6.3"
2
+ VERSION = "1.6.8"
3
3
  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\"\xbd\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\x0f\n\x07storeId\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 CHANGED
@@ -7,7 +7,7 @@ require 'google/protobuf'
7
7
  require 'google/protobuf/timestamp_pb'
8
8
 
9
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\"\x85\x0b\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\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_amountB\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\"\xa3\x01\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\x42\x13\n\x11_idempotency_uuidB\x0e\n\x0c_terminal_id\"\xba\x03\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\"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_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"
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\"\xa3\x01\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\x42\x13\n\x11_idempotency_uuidB\x0e\n\x0c_terminal_id\"\xba\x03\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\"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_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
11
 
12
12
  pool = ::Google::Protobuf::DescriptorPool.generated_pool
13
13
  pool.add_serialized_file(descriptor_data)
@@ -26,6 +26,7 @@ module Com
26
26
  PayResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PayResponse").msgclass
27
27
  PayResponse::PaymentData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PayResponse.PaymentData").msgclass
28
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
29
30
  CancelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.CancelRequest").msgclass
30
31
  CancelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.CancelResponse").msgclass
31
32
  PaymentDetailsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("com.kodypay.grpc.pay.v1.PaymentDetailsRequest").msgclass
@@ -10,25 +10,31 @@ puts
10
10
  # Configuration - replace with your actual credentials
11
11
  api_key = ENV['KODY_API_KEY'] || 'your-api-key-here'
12
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
13
 
20
14
  begin
21
15
  # Require the published gem
22
16
  require 'kody'
23
17
 
24
- # Create the stub and make the API call
18
+ # Configure KodyPay SDK
19
+ Kody.configure do |config|
20
+ config.staging_ap! # Use Asia-Pacific staging endpoint
21
+ config.api_key = api_key
22
+ config.store_id = store_id
23
+ end
24
+
25
+ puts "šŸ“” Endpoint: #{Kody.configuration.endpoint}"
26
+ puts "šŸ”‘ Store ID: #{Kody.configuration.store_id[0..8]}..."
27
+ puts "šŸ—ļø API Key: #{Kody.configuration.api_key[0..10]}..."
28
+ puts
29
+
30
+ # Create the stub using configuration
25
31
  stub = Com::Kodypay::Grpc::Ecom::V1::KodyEcomPaymentsService::Stub.new(
26
- endpoint,
32
+ Kody.configuration.endpoint,
27
33
  GRPC::Core::ChannelCredentials.new
28
34
  )
29
35
 
30
36
  request = Com::Kodypay::Grpc::Ecom::V1::GetPaymentsRequest.new(
31
- store_id: store_id,
37
+ store_id: Kody.configuration.store_id,
32
38
  page_cursor: Com::Kodypay::Grpc::Ecom::V1::GetPaymentsRequest::PageCursor.new(
33
39
  page: 1,
34
40
  page_size: 10
@@ -36,7 +42,7 @@ begin
36
42
  )
37
43
 
38
44
  puts "šŸ“¤ Making gRPC call to GetPayments API..."
39
- response = stub.get_payments(request, metadata: { 'x-api-key' => api_key })
45
+ response = stub.get_payments(request, metadata: { 'x-api-key' => Kody.configuration.api_key })
40
46
 
41
47
  puts "šŸŽ‰ SUCCESS! Response from KodyPay API:"
42
48
  puts "šŸ“Š Total payments: #{response.response.total}"
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ puts "šŸš€ KodyPay Ruby SDK Sample - GetTerminals API"
4
+ puts "============================================="
5
+ puts "šŸ“¦ Using kody-clientsdk-ruby gem from RubyGems"
6
+ puts
7
+
8
+ # Configuration - replace with your actual credentials
9
+ api_key = ENV['KODY_API_KEY'] || 'your-api-key-here'
10
+ store_id = ENV['KODY_STORE_ID'] || 'your-store-id-here'
11
+
12
+ begin
13
+ # Require the published gem
14
+ require 'kody'
15
+
16
+ # Configure KodyPay SDK
17
+ Kody.configure do |config|
18
+ config.staging_ap! # Use Asia-Pacific staging endpoint
19
+ config.api_key = api_key
20
+ config.store_id = store_id
21
+ end
22
+
23
+ puts "šŸ“” Endpoint: #{Kody.configuration.endpoint}"
24
+ puts "šŸ”‘ Store ID: #{Kody.configuration.store_id[0..8]}..."
25
+ puts "šŸ—ļø API Key: #{Kody.configuration.api_key[0..10]}..."
26
+ puts
27
+
28
+ # Create the Terminal API stub using configuration
29
+ stub = Com::Kodypay::Grpc::Pay::V1::KodyPayTerminalService::Stub.new(
30
+ Kody.configuration.endpoint,
31
+ GRPC::Core::ChannelCredentials.new
32
+ )
33
+
34
+ request = Com::Kodypay::Grpc::Pay::V1::TerminalsRequest.new(
35
+ store_id: Kody.configuration.store_id
36
+ )
37
+
38
+ puts "šŸ“¤ Making gRPC call to GetTerminals API..."
39
+ response = stub.terminals(request, metadata: { 'x-api-key' => Kody.configuration.api_key })
40
+
41
+ puts "šŸŽ‰ SUCCESS! Response from KodyPay Terminal API:"
42
+ puts "šŸ–„ļø Total terminals: #{response.terminals.length}"
43
+
44
+ if response.terminals.empty?
45
+ puts "šŸ“­ No terminals found for this store"
46
+ else
47
+ response.terminals.each_with_index do |terminal, index|
48
+ status = terminal.online ? "🟢 Online" : "šŸ”“ Offline"
49
+ puts "\nšŸ–„ļø Terminal #{index + 1}:"
50
+ puts " ID: #{terminal.terminal_id}"
51
+ puts " Status: #{status}"
52
+
53
+ if terminal.respond_to?(:last_activity_at) && terminal.last_activity_at
54
+ last_activity = Time.at(terminal.last_activity_at.seconds).strftime('%Y-%m-%d %H:%M:%S')
55
+ puts " Last Activity: #{last_activity}"
56
+ end
57
+
58
+ if terminal.respond_to?(:version) && terminal.version && !terminal.version.empty?
59
+ puts " Version: #{terminal.version}"
60
+ end
61
+ end
62
+ end
63
+
64
+ rescue GRPC::BadStatus => e
65
+ puts "āŒ gRPC API Error: #{e.code} - #{e.message}"
66
+ puts "šŸ’” Check your API credentials and store permissions"
67
+ rescue LoadError => e
68
+ puts "āŒ Missing dependency: #{e.message}"
69
+ puts "šŸ’” Install the gem with: gem install kody-clientsdk-ruby"
70
+ rescue => e
71
+ puts "āŒ Error: #{e.message}"
72
+ puts "šŸ” #{e.backtrace.first}"
73
+ end
74
+
75
+ puts "\nšŸ“š Documentation:"
76
+ puts " RubyGems: https://rubygems.org/gems/kody-clientsdk-ruby"
77
+ puts " GitHub: https://github.com/KodyPay/kody-clientsdk-ruby"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kody-clientsdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kody Tech Team
@@ -127,9 +127,12 @@ files:
127
127
  - lib/kody/version.rb
128
128
  - lib/order_pb.rb
129
129
  - lib/order_services_pb.rb
130
+ - lib/pay_at_table_pb.rb
131
+ - lib/pay_at_table_services_pb.rb
130
132
  - lib/pay_pb.rb
131
133
  - lib/pay_services_pb.rb
132
134
  - samples/ecom/get_payments.rb
135
+ - samples/pos/get_terminals.rb
133
136
  homepage: https://github.com/KodyPay/kody-clientsdk-ruby
134
137
  licenses:
135
138
  - MIT