Skip to content

Commit 7bc46e4

Browse files
committed
Add support for Secure Fields
Adds the `secured_card_data` field and deprecates `third_party_wallet_id`. Also adds new error codes and some minor test and formatting improvements.
1 parent db0369e commit 7bc46e4

File tree

7 files changed

+36
-7
lines changed

7 files changed

+36
-7
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes will be documented in this file
44

5+
## 1.2.0
6+
7+
- Add support for Secure Fields and wallets with `secured_card_data field`
8+
- Add support for Rest Client 2.0 (thanks @brocktimus)
9+
510
## 1.1.0
611

712
- Add settlement search support

lib/eway_rapid/models/internal_models.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def self.from_hash(hash)
456456

457457
def self.from_array(array)
458458
summaries = []
459-
array.each {|summary_hash|
459+
Array(array).each {|summary_hash|
460460
obj = from_hash(summary_hash)
461461
summaries.push(obj)
462462
}
@@ -488,7 +488,7 @@ def self.from_hash(hash)
488488

489489
def self.from_array(array)
490490
balances = []
491-
array.each {|balance_hash|
491+
Array(array).each {|balance_hash|
492492
obj = from_hash(balance_hash)
493493
balances.push(obj)
494494
}
@@ -532,7 +532,7 @@ def self.from_hash(hash)
532532

533533
def self.from_array(array)
534534
transactions = []
535-
array.each {|transaction_hash|
535+
Array(array).each {|transaction_hash|
536536
obj = from_hash(transaction_hash)
537537
transactions.push(obj)
538538
}

lib/eway_rapid/models/models.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,11 @@ class Transaction
244244
# The partner ID generated from an eWAY partner agreement
245245
attr_accessor :partner_id
246246

247-
# The wallet ID of a third party wallet used for a payment
247+
# Deprecated, use secured_card_data
248248
attr_accessor :third_party_wallet_id
249+
250+
# Card data ID, used for Secure Fields, Visa Checkout, AMEX Express Checkout and Android Pay
251+
attr_accessor :secured_card_data
249252

250253
# The Transaction ID of an authorisation to capture
251254
attr_accessor :auth_transaction_id

lib/eway_rapid/rapid_client.rb

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def query_transaction_by_access_code(access_code)
110110
# code, invoice number, invoice reference
111111
#
112112
# @param [Enums::TransactionFilter] filter Filter definition for searching
113+
# @return [QueryTransactionResponse]
113114
def query_transaction_by_filter(filter)
114115
index_of_value = filter.calculate_index_of_value
115116
if index_of_value.nil?

lib/eway_rapid/resources/err_code_resource_en.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,22 @@
103103
- V6140: Merchant account is suspended
104104
- V6141: Invalid PayPal account details or API signature
105105
- V6142: Authorise not available for Bank/Branch
106+
- V6143: Invalid Public Key
107+
- V6146: Client Side Encryption Key Missing or Invalid
108+
- V6147: Unable to Create One Time Code for Secure Field
109+
- V6148: Secure Field has Expired
110+
- V6149: Invalid Secure Field One Time Code
106111
- V6150: Invalid Refund Amount
107112
- V6151: Refund amount greater than original transaction
108113
- V6152: Original transaction already refunded for total amount
109114
- V6153: Card type not support by merchant
110115
- V6160: Encryption Method Not Supported
111116
- V6165: Invalid Visa Checkout data or decryption failed
117+
- V6170: Invalid TransactionSearch, Invoice Number is not unique
118+
- V6171: Invalid TransactionSearch, Invoice Number not found
119+
- V6210: Secure Field Invalid Type
120+
- V6211: Secure Field Invalid Div
121+
- V6212: Invalid Style string for Secure Field
112122
# Third party error code
113123
- S5000: System Error
114124
- S5011: PayPal Connection Error
@@ -125,8 +135,8 @@
125135
- S9992: Communication error with Rapid API
126136
- S9993: Authentication error with Rapid API
127137
- S9994: Internal system error communicating with Rapid API
128-
- S9995: Internal SDK Error, Bad Parameters ...
129-
- S9996: Internal rapid server error (This error fire when post, get message from client to server has problem)
138+
- S9995: Internal SDK Error, Bad Parameters
139+
- S9996: Internal Rapid server error
130140
# Transaction response message
131141
- A2000: Transaction Approved
132142
- A2008: Honour With Identification

lib/eway_rapid/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module EwayRapid
2-
VERSION = '1.1.0'
2+
VERSION = '1.2.0'
33
end

test/eway_rapid/integration/transaction/settlement_search_test.rb

+10
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,15 @@ def test_valid_input
1515
assert(!search_response.settlement_transactions.nil? && search_response.settlement_transactions.length > 0)
1616
end
1717

18+
def test_invalid_input
19+
@search = EwayRapid::InputModelFactory.create_settlement_search
20+
21+
@search.settlement_date = '2014-01-01'
22+
23+
search_response = @client.settlement_search(@search)
24+
25+
assert(!search_response.errors.nil?)
26+
end
27+
1828
def teardown; end
1929
end

0 commit comments

Comments
 (0)