kody-clientsdk-ruby 1.6.8 ā 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 +4 -4
- data/README.md +161 -78
- data/lib/ecom_pb.rb +1 -1
- data/lib/kody/configuration.rb +3 -30
- data/lib/kody/version.rb +1 -1
- data/lib/logging_pb.rb +27 -0
- data/lib/logging_services_pb.rb +31 -0
- data/lib/pay_at_table_pb.rb +1 -1
- data/lib/pay_pb.rb +1 -1
- data/samples/ecom/get_payments.rb +10 -16
- metadata +3 -2
- data/samples/pos/get_terminals.rb +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a8bb43a172f7c0200dfcfcdea60904a5c4afed9f3a5c18c9762c0f2381370fe
|
4
|
+
data.tar.gz: 4a0cfbae738e945b5ad5f9b8fdbc63c41bc62367d52ba1501ab267eac2086253
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cda9d9d04bace30d567c6fd8bcff3a161ad5016ad899aca89736f1c0068b30cc1fd69507f0f0bef8d7fe305aeda7739f652a2b0a20f8497b6db24b59a493fec3
|
7
|
+
data.tar.gz: f4fc9af1179eb5ce3d192ca76b18c06f9a66d41f83544758910199d2e47336749198632a66ac9f958c182d84060dcaf67bd47074d360393f14aa92668e0b380f
|
data/README.md
CHANGED
@@ -1,128 +1,211 @@
|
|
1
1
|
# Kody API - Ruby SDK
|
2
2
|
|
3
|
-
This guide provides an overview of using the Kody API and its reference documentation.
|
3
|
+
This guide provides an overview of using the Kody API and its reference documentation for Ruby.
|
4
4
|
|
5
|
-
- [
|
6
|
-
- [Ruby Installation](#ruby-installation)
|
5
|
+
- [Installation](#installation)
|
7
6
|
- [Authentication](#authentication)
|
8
|
-
- [
|
7
|
+
- [Quick Start](#quick-start)
|
9
8
|
- [Sample code](#sample-code)
|
10
9
|
|
11
|
-
##
|
10
|
+
## Installation
|
12
11
|
|
13
|
-
|
12
|
+
Add this line to your application's Gemfile:
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
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/
|
21
|
-
|
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.
|
14
|
+
```ruby
|
15
|
+
gem 'kody-clientsdk-ruby'
|
16
|
+
```
|
29
17
|
|
30
|
-
|
18
|
+
And then execute:
|
31
19
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- Bundler (optional), recommended way to manage dependencies
|
20
|
+
```bash
|
21
|
+
bundle install
|
22
|
+
```
|
36
23
|
|
37
|
-
|
24
|
+
Or install it yourself as:
|
38
25
|
|
39
26
|
```bash
|
40
27
|
gem install kody-clientsdk-ruby
|
41
28
|
```
|
42
29
|
|
43
|
-
|
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
|
44
49
|
|
45
50
|
```ruby
|
46
|
-
|
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
|
47
82
|
```
|
48
83
|
|
49
|
-
|
84
|
+
## Configuration Options
|
50
85
|
|
51
|
-
###
|
86
|
+
### Environment Configuration
|
52
87
|
|
53
88
|
```ruby
|
54
|
-
|
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
|
55
102
|
|
56
|
-
#
|
103
|
+
# Local development
|
57
104
|
Kody.configure do |config|
|
58
|
-
config.staging_ap! # Use Asia-Pacific staging
|
59
105
|
config.api_key = 'your-api-key'
|
60
106
|
config.store_id = 'your-store-id'
|
107
|
+
config.development! # Sets host to 'localhost:8080' with TLS disabled
|
61
108
|
end
|
109
|
+
```
|
62
110
|
|
63
|
-
|
64
|
-
ecom_stub = Com::Kodypay::Grpc::Ecom::V1::KodyEcomPaymentsService::Stub.new(
|
65
|
-
Kody.configuration.endpoint,
|
66
|
-
GRPC::Core::ChannelCredentials.new
|
67
|
-
)
|
111
|
+
### Environment Variables
|
68
112
|
|
69
|
-
|
70
|
-
terminal_stub = Com::Kodypay::Grpc::Pay::V1::KodyPayTerminalService::Stub.new(
|
71
|
-
Kody.configuration.endpoint,
|
72
|
-
GRPC::Core::ChannelCredentials.new
|
73
|
-
)
|
113
|
+
You can also configure using environment variables:
|
74
114
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
GRPC::Core::ChannelCredentials.new
|
79
|
-
)
|
115
|
+
```bash
|
116
|
+
export KODY_API_KEY="your-api-key"
|
117
|
+
export KODY_STORE_ID="your-store-id"
|
80
118
|
```
|
81
119
|
|
82
|
-
|
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
|
+
```
|
83
127
|
|
84
|
-
|
85
|
-
These will be shared with you during the technical integration onboarding or by your Kody contact.
|
128
|
+
## Available Methods
|
86
129
|
|
87
|
-
|
130
|
+
### E-commerce Payments
|
88
131
|
|
89
|
-
|
132
|
+
#### Initiate Payment
|
90
133
|
|
91
|
-
|
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
|
+
```
|
92
152
|
|
93
|
-
|
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`
|
153
|
+
#### Get Payments
|
97
154
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
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
|
+
```
|
102
172
|
|
103
|
-
|
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:
|
104
178
|
|
105
179
|
```ruby
|
106
|
-
#
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
config.staging_ap! # grpc-staging-ap.kodypay.com:443
|
114
|
-
config.staging_eu! # grpc-staging-eu.kodypay.com:443
|
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"
|
115
187
|
```
|
116
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
|
+
|
117
196
|
## Documentation
|
118
197
|
|
119
198
|
For complete API documentation, examples, and integration guides, please visit:
|
120
199
|
š https://api-docs.kody.com
|
121
200
|
|
122
|
-
##
|
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
|
123
210
|
|
124
|
-
|
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
|
211
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/ecom_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/ecom/v1/ecom.proto\x12\x18\x63om.kodypay.grpc.ecom.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9c\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\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_options\"\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"
|
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
11
|
|
12
12
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
data/lib/kody/configuration.rb
CHANGED
@@ -1,15 +1,8 @@
|
|
1
1
|
module Kody
|
2
2
|
class Configuration
|
3
|
-
# KodyPay gRPC endpoints
|
4
|
-
|
5
|
-
|
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
|
3
|
+
# Common KodyPay gRPC endpoints
|
4
|
+
PRODUCTION_ENDPOINT = 'grpc.kodypay.com:443'
|
5
|
+
STAGING_ENDPOINT = 'grpc-staging-ap.kodypay.com:443'
|
13
6
|
|
14
7
|
attr_accessor :api_key, :store_id, :endpoint
|
15
8
|
|
@@ -20,25 +13,5 @@ module Kody
|
|
20
13
|
def staging!
|
21
14
|
@endpoint = STAGING_ENDPOINT
|
22
15
|
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
|
43
16
|
end
|
44
17
|
end
|
data/lib/kody/version.rb
CHANGED
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/pay_at_table_pb.rb
CHANGED
@@ -8,7 +8,7 @@ require 'google/protobuf/timestamp_pb'
|
|
8
8
|
require 'google/protobuf/wrappers_pb'
|
9
9
|
|
10
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\"\
|
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
12
|
|
13
13
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
14
14
|
pool.add_serialized_file(descriptor_data)
|
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\"\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\"\
|
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
11
|
|
12
12
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
@@ -10,31 +10,25 @@ 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
|
13
19
|
|
14
20
|
begin
|
15
21
|
# Require the published gem
|
16
22
|
require 'kody'
|
17
23
|
|
18
|
-
#
|
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
|
24
|
+
# Create the stub and make the API call
|
31
25
|
stub = Com::Kodypay::Grpc::Ecom::V1::KodyEcomPaymentsService::Stub.new(
|
32
|
-
|
26
|
+
endpoint,
|
33
27
|
GRPC::Core::ChannelCredentials.new
|
34
28
|
)
|
35
29
|
|
36
30
|
request = Com::Kodypay::Grpc::Ecom::V1::GetPaymentsRequest.new(
|
37
|
-
store_id:
|
31
|
+
store_id: store_id,
|
38
32
|
page_cursor: Com::Kodypay::Grpc::Ecom::V1::GetPaymentsRequest::PageCursor.new(
|
39
33
|
page: 1,
|
40
34
|
page_size: 10
|
@@ -42,7 +36,7 @@ begin
|
|
42
36
|
)
|
43
37
|
|
44
38
|
puts "š¤ Making gRPC call to GetPayments API..."
|
45
|
-
response = stub.get_payments(request, metadata: { 'x-api-key' =>
|
39
|
+
response = stub.get_payments(request, metadata: { 'x-api-key' => api_key })
|
46
40
|
|
47
41
|
puts "š SUCCESS! Response from KodyPay API:"
|
48
42
|
puts "š Total payments: #{response.response.total}"
|
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.
|
4
|
+
version: 1.6.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kody Tech Team
|
@@ -125,6 +125,8 @@ files:
|
|
125
125
|
- lib/kody.rb
|
126
126
|
- lib/kody/configuration.rb
|
127
127
|
- lib/kody/version.rb
|
128
|
+
- lib/logging_pb.rb
|
129
|
+
- lib/logging_services_pb.rb
|
128
130
|
- lib/order_pb.rb
|
129
131
|
- lib/order_services_pb.rb
|
130
132
|
- lib/pay_at_table_pb.rb
|
@@ -132,7 +134,6 @@ files:
|
|
132
134
|
- lib/pay_pb.rb
|
133
135
|
- lib/pay_services_pb.rb
|
134
136
|
- samples/ecom/get_payments.rb
|
135
|
-
- samples/pos/get_terminals.rb
|
136
137
|
homepage: https://github.com/KodyPay/kody-clientsdk-ruby
|
137
138
|
licenses:
|
138
139
|
- MIT
|
@@ -1,77 +0,0 @@
|
|
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"
|