eway_rapid 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +4 -4
- data/eway_rapid.gemspec +1 -1
- data/lib/eway_rapid/rapid_client.rb +18 -18
- data/lib/eway_rapid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cadf9a06166c7bff3ef2ebf6129fa768c421390
|
4
|
+
data.tar.gz: eb63766a182424dab6d7d5cdacb150585af32a5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87d91c452520897a536b036dc57cbae2a2a7a7d50732543ba537ab6957783a0c9e89cd89415ed6cb371a11e938dea8914ba12804c29ffb932f1bb570c20d2a8c
|
7
|
+
data.tar.gz: 8e3d549bd14215fb27b1628e6dc5e23e0d73c4e1eb33eb885fbf073b93645bc29c7f74ee27482c24be5cdf1a118e35b5af1d2641a3658ac4de8ca7e5b2d25ea9
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -51,7 +51,7 @@ api_key = 'Rapid API Key'
|
|
51
51
|
password = 'Rapid API Password'
|
52
52
|
endpoint = 'sandbox'
|
53
53
|
|
54
|
-
client =
|
54
|
+
client = EwayRapid::RapidClient.new(api_key, password, endpoint)
|
55
55
|
|
56
56
|
transaction = EwayRapid::Models::Transaction.new
|
57
57
|
transaction.customer = EwayRapid::Models::Customer.new
|
@@ -69,7 +69,7 @@ payment_details.total_amount = 1000
|
|
69
69
|
transaction.payment_details = payment_details
|
70
70
|
transaction.transaction_type = EwayRapid::Enums::TransactionType::PURCHASE
|
71
71
|
|
72
|
-
response = client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT,
|
72
|
+
response = client.create_transaction(EwayRapid::Enums::PaymentMethod::DIRECT, transaction)
|
73
73
|
|
74
74
|
if response.transaction_status.status?
|
75
75
|
puts "Success! ID: #{response.transaction_status.transaction_id.to_s}"
|
@@ -88,9 +88,9 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recen
|
|
88
88
|
|
89
89
|
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
|
90
90
|
|
91
|
-
[ico-version]: https://img.shields.io/gem/v/
|
91
|
+
[ico-version]: https://img.shields.io/gem/v/eway_rapid.svg?style=flat-square
|
92
92
|
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
|
93
93
|
[ico-travis]: https://img.shields.io/travis/eWAYPayment/eway-rapid-ruby/master.svg?style=flat-square
|
94
94
|
|
95
|
-
[link-rubygems]: https://rubygems.org/gems/
|
95
|
+
[link-rubygems]: https://rubygems.org/gems/eway_rapid
|
96
96
|
[link-travis]: https://travis-ci.org/eWAYPayment/eway-rapid-ruby
|
data/eway_rapid.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'eway_rapid'
|
8
8
|
spec.version = EwayRapid::VERSION
|
9
9
|
spec.required_ruby_version = '>= 1.9.3'
|
10
|
-
spec.author
|
10
|
+
spec.author = ['eWAY']
|
11
11
|
spec.summary = 'Ruby gem for eWAY\'s Rapid API'
|
12
12
|
spec.description = 'Easy online payments with eWAY and the eWAY Rapid Ruby gem.'
|
13
13
|
spec.homepage = 'https://www.eway.com.au'
|
@@ -44,39 +44,39 @@ module EwayRapid
|
|
44
44
|
begin
|
45
45
|
case payment_method
|
46
46
|
when Enums::PaymentMethod::DIRECT
|
47
|
-
url = @
|
47
|
+
url = @web_url + Constants::DIRECT_PAYMENT_METHOD_NAME + Constants::JSON_SUFFIX
|
48
48
|
|
49
49
|
request = Message::TransactionProcess::TransDirectPaymentMsgProcess.create_request(transaction)
|
50
50
|
response = Message::TransactionProcess::TransDirectPaymentMsgProcess.send_request(url, @api_key, @password, request)
|
51
51
|
Message::TransactionProcess::TransDirectPaymentMsgProcess.make_result(response)
|
52
52
|
when Enums::PaymentMethod::RESPONSIVE_SHARED
|
53
|
-
url = @
|
53
|
+
url = @web_url + Constants::RESPONSIVE_SHARED_METHOD_NAME + Constants::JSON_SUFFIX
|
54
54
|
|
55
55
|
request = Message::TransactionProcess::TransResponsiveSharedMsgProcess.create_request(transaction)
|
56
56
|
response = Message::TransactionProcess::TransResponsiveSharedMsgProcess.send_request(url, @api_key, @password, request)
|
57
57
|
Message::TransactionProcess::TransResponsiveSharedMsgProcess.make_result(response)
|
58
58
|
when Enums::PaymentMethod::TRANSPARENT_REDIRECT
|
59
|
-
url = @
|
59
|
+
url = @web_url + Constants::TRANSPARENT_REDIRECT_METHOD_NAME + Constants::JSON_SUFFIX
|
60
60
|
|
61
61
|
request = Message::TransactionProcess::TransTransparentRedirectMsgProcess.create_request(transaction)
|
62
62
|
response = Message::TransactionProcess::TransTransparentRedirectMsgProcess.send_request(url, @api_key, @password, request)
|
63
63
|
Message::TransactionProcess::TransTransparentRedirectMsgProcess.make_result(response)
|
64
64
|
when Enums::PaymentMethod::WALLET
|
65
65
|
if transaction.capture
|
66
|
-
url = @
|
66
|
+
url = @web_url + Constants::DIRECT_PAYMENT_METHOD_NAME + Constants::JSON_SUFFIX
|
67
67
|
|
68
68
|
request = Message::TransactionProcess::TransDirectPaymentMsgProcess.create_request(transaction)
|
69
69
|
response = Message::TransactionProcess::TransDirectPaymentMsgProcess.send_request(url, @api_key, @password, request)
|
70
70
|
Message::TransactionProcess::TransDirectPaymentMsgProcess.make_result(response)
|
71
71
|
else
|
72
|
-
url = @
|
72
|
+
url = @web_url + Constants::CAPTURE_PAYMENT_METHOD
|
73
73
|
|
74
74
|
request = Message::TransactionProcess::CapturePaymentMsgProcess.create_request(transaction)
|
75
75
|
response = Message::TransactionProcess::CapturePaymentMsgProcess.send_request(url, @api_key, @password, request)
|
76
76
|
Message::TransactionProcess::CapturePaymentMsgProcess.make_result(response)
|
77
77
|
end
|
78
78
|
when Enums::PaymentMethod::AUTHORISATION
|
79
|
-
url = @
|
79
|
+
url = @web_url + Constants::CAPTURE_PAYMENT_METHOD
|
80
80
|
|
81
81
|
request = Message::TransactionProcess::CapturePaymentMsgProcess.create_request(transaction)
|
82
82
|
response = Message::TransactionProcess::CapturePaymentMsgProcess.send_request(url, @api_key, @password, request)
|
@@ -140,7 +140,7 @@ module EwayRapid
|
|
140
140
|
end
|
141
141
|
|
142
142
|
begin
|
143
|
-
url = @
|
143
|
+
url = @web_url + Constants::TRANSACTION_METHOD
|
144
144
|
|
145
145
|
request = Message::RefundProcess::RefundMsgProcess.create_request(refund)
|
146
146
|
response = Message::RefundProcess::RefundMsgProcess.send_request(url, @api_key, @password, request)
|
@@ -160,7 +160,7 @@ module EwayRapid
|
|
160
160
|
return make_response_with_exception(Exceptions::APIKeyInvalidException.new('API key, password or Rapid endpoint missing or invalid'), RefundResponse)
|
161
161
|
end
|
162
162
|
begin
|
163
|
-
url = @
|
163
|
+
url = @web_url + Constants::CANCEL_AUTHORISATION_METHOD
|
164
164
|
|
165
165
|
request = Message::RefundProcess::CancelAuthorisationMsgProcess.create_request(refund)
|
166
166
|
response = Message::RefundProcess::CancelAuthorisationMsgProcess.send_request(url, @api_key, @password, request)
|
@@ -184,19 +184,19 @@ module EwayRapid
|
|
184
184
|
begin
|
185
185
|
case payment_method
|
186
186
|
when Enums::PaymentMethod::DIRECT
|
187
|
-
url = @
|
187
|
+
url = @web_url + Constants::DIRECT_PAYMENT_METHOD_NAME + Constants::JSON_SUFFIX
|
188
188
|
|
189
189
|
request = Message::CustomerProcess::CustDirectPaymentMsgProcess.create_request(customer)
|
190
190
|
response = Message::CustomerProcess::CustDirectPaymentMsgProcess.send_request(url, @api_key, @password, request)
|
191
191
|
Message::CustomerProcess::CustDirectPaymentMsgProcess.make_result(response)
|
192
192
|
when Enums::PaymentMethod::RESPONSIVE_SHARED
|
193
|
-
url = @
|
193
|
+
url = @web_url + Constants::RESPONSIVE_SHARED_METHOD_NAME + Constants::JSON_SUFFIX
|
194
194
|
|
195
195
|
request = Message::CustomerProcess::CustResponsiveSharedMsgProcess.create_request(customer)
|
196
196
|
response = Message::CustomerProcess::CustResponsiveSharedMsgProcess.send_request(url, @api_key, @password, request)
|
197
197
|
Message::CustomerProcess::CustResponsiveSharedMsgProcess.make_result(response)
|
198
198
|
when Enums::PaymentMethod::TRANSPARENT_REDIRECT
|
199
|
-
url = @
|
199
|
+
url = @web_url + Constants::TRANSPARENT_REDIRECT_METHOD_NAME + Constants::JSON_SUFFIX
|
200
200
|
|
201
201
|
request = Message::CustomerProcess::CustTransparentRedirectMsgProcess.create_request(customer)
|
202
202
|
response = Message::CustomerProcess::CustTransparentRedirectMsgProcess.send_request(url, @api_key, @password, request)
|
@@ -222,18 +222,18 @@ module EwayRapid
|
|
222
222
|
begin
|
223
223
|
case payment_method
|
224
224
|
when Enums::PaymentMethod::DIRECT
|
225
|
-
url = @
|
225
|
+
url = @web_url + Constants::DIRECT_PAYMENT_METHOD_NAME + Constants::JSON_SUFFIX
|
226
226
|
request = Message::CustomerProcess::CustDirectUpdateMsgProcess.create_request(customer)
|
227
227
|
response = Message::CustomerProcess::CustDirectUpdateMsgProcess.send_request(url, @api_key, @password, request)
|
228
228
|
Message::CustomerProcess::CustDirectUpdateMsgProcess.make_result(response)
|
229
229
|
when Enums::PaymentMethod::RESPONSIVE_SHARED
|
230
|
-
url = @
|
230
|
+
url = @web_url + Constants::RESPONSIVE_SHARED_METHOD_NAME + Constants::JSON_SUFFIX
|
231
231
|
|
232
232
|
request = Message::CustomerProcess::CustResponsiveUpdateMsgProcess.create_request(customer)
|
233
233
|
response = Message::CustomerProcess::CustResponsiveUpdateMsgProcess.send_request(url, @api_key, @password, request)
|
234
234
|
Message::CustomerProcess::CustResponsiveUpdateMsgProcess.make_result(response)
|
235
235
|
when Enums::PaymentMethod::TRANSPARENT_REDIRECT
|
236
|
-
url = @
|
236
|
+
url = @web_url + Constants::TRANSPARENT_REDIRECT_METHOD_NAME + Constants::JSON_SUFFIX
|
237
237
|
|
238
238
|
request = Message::CustomerProcess::CustTransparentUpdateMsgProcess.create_request(customer)
|
239
239
|
response = Message::CustomerProcess::CustTransparentUpdateMsgProcess.send_request(url, @api_key, @password, request)
|
@@ -258,7 +258,7 @@ module EwayRapid
|
|
258
258
|
return make_response_with_exception(Exceptions::APIKeyInvalidException.new('API key, password or Rapid endpoint missing or invalid'), QueryCustomerResponse)
|
259
259
|
end
|
260
260
|
begin
|
261
|
-
url = @
|
261
|
+
url = @web_url + Constants::DIRECT_CUSTOMER_SEARCH_METHOD + Constants::JSON_SUFFIX
|
262
262
|
url = URI.encode(url)
|
263
263
|
|
264
264
|
request = Message::CustomerProcess::QueryCustomerMsgProcess.create_request(token_customer_id.to_s)
|
@@ -306,9 +306,9 @@ module EwayRapid
|
|
306
306
|
end
|
307
307
|
begin
|
308
308
|
if request.nil? || request == ''
|
309
|
-
url = @
|
309
|
+
url = @web_url + request_path + '/' + '0'
|
310
310
|
else
|
311
|
-
url = @
|
311
|
+
url = @web_url + request_path + '/' + request
|
312
312
|
end
|
313
313
|
url = URI.encode(url)
|
314
314
|
|
@@ -358,7 +358,7 @@ module EwayRapid
|
|
358
358
|
@list_error.clear
|
359
359
|
end
|
360
360
|
set_valid(true)
|
361
|
-
@logger.info "Initiate client [#{@
|
361
|
+
@logger.info "Initiate client using [#{@web_url}] successful!" if @logger
|
362
362
|
rescue => e
|
363
363
|
@logger.error "Error setting Rapid endpoint #{e.backtrace.inspect}" if @logger
|
364
364
|
set_valid(false)
|
data/lib/eway_rapid/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eway_rapid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- eWAY
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|