eway_rapid 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/.travis.yml +11 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +2 -0
- data/LICENSE.md +21 -0
- data/README.md +96 -0
- data/Rakefile +14 -0
- data/eway_rapid.gemspec +26 -0
- data/lib/eway_rapid.rb +78 -0
- data/lib/eway_rapid/constants.rb +126 -0
- data/lib/eway_rapid/entities/cancel_authorisation_request.rb +9 -0
- data/lib/eway_rapid/entities/cancel_authorisation_response.rb +34 -0
- data/lib/eway_rapid/entities/capture_payment_request.rb +11 -0
- data/lib/eway_rapid/entities/capture_payment_response.rb +34 -0
- data/lib/eway_rapid/entities/create_access_code_request.rb +35 -0
- data/lib/eway_rapid/entities/create_access_code_response.rb +128 -0
- data/lib/eway_rapid/entities/create_access_code_shared_request.rb +53 -0
- data/lib/eway_rapid/entities/create_access_code_shared_response.rb +40 -0
- data/lib/eway_rapid/entities/create_customer_response.rb +8 -0
- data/lib/eway_rapid/entities/direct_customer_search_request.rb +9 -0
- data/lib/eway_rapid/entities/direct_customer_search_response.rb +23 -0
- data/lib/eway_rapid/entities/direct_payment_request.rb +29 -0
- data/lib/eway_rapid/entities/direct_payment_response.rb +58 -0
- data/lib/eway_rapid/entities/direct_refund_request.rb +26 -0
- data/lib/eway_rapid/entities/direct_refund_response.rb +44 -0
- data/lib/eway_rapid/entities/transaction_search_response.rb +23 -0
- data/lib/eway_rapid/exceptions.rb +51 -0
- data/lib/eway_rapid/message/convert/customer_to_internal_customer.rb +70 -0
- data/lib/eway_rapid/message/convert/direct_payment_to_trans_status.rb +47 -0
- data/lib/eway_rapid/message/convert/direct_refund_to_trans_status.rb +33 -0
- data/lib/eway_rapid/message/convert/internal_customer_to_customer.rb +41 -0
- data/lib/eway_rapid/message/convert/internal_trans_to_trans.rb +62 -0
- data/lib/eway_rapid/message/convert/internal_transaction_to_address.rb +27 -0
- data/lib/eway_rapid/message/convert/internal_transaction_to_status.rb +55 -0
- data/lib/eway_rapid/message/convert/payment_to_payment_details.rb +25 -0
- data/lib/eway_rapid/message/convert/request/refund_to_direct_refund_req.rb +41 -0
- data/lib/eway_rapid/message/convert/request/transaction_to_capture_payment.rb +28 -0
- data/lib/eway_rapid/message/convert/request/transaction_to_create_access_code_request.rb +58 -0
- data/lib/eway_rapid/message/convert/request/transaction_to_create_access_code_shared_request.rb +54 -0
- data/lib/eway_rapid/message/convert/request/transaction_to_direct_payment.rb +45 -0
- data/lib/eway_rapid/message/convert/response/access_code_shared_to_create_cust.rb +23 -0
- data/lib/eway_rapid/message/convert/response/access_code_shared_to_create_trans.rb +28 -0
- data/lib/eway_rapid/message/convert/response/access_code_to_create_cust.rb +24 -0
- data/lib/eway_rapid/message/convert/response/access_code_to_create_trans.rb +27 -0
- data/lib/eway_rapid/message/convert/response/cancel_authorisation_to_refund.rb +37 -0
- data/lib/eway_rapid/message/convert/response/capture_payment_to_create_transaction.rb +43 -0
- data/lib/eway_rapid/message/convert/response/direct_customer_to_query_customer.rb +55 -0
- data/lib/eway_rapid/message/convert/response/direct_payment_to_create_cust.rb +23 -0
- data/lib/eway_rapid/message/convert/response/direct_payment_to_create_trans.rb +32 -0
- data/lib/eway_rapid/message/convert/response/direct_refund_to_refund_response.rb +28 -0
- data/lib/eway_rapid/message/convert/response/search_to_query_trans.rb +30 -0
- data/lib/eway_rapid/message/convert/shipping_details_to_address.rb +35 -0
- data/lib/eway_rapid/message/convert/transaction_shipping_address.rb +37 -0
- data/lib/eway_rapid/message/convert/transaction_to_arr_line_item.rb +14 -0
- data/lib/eway_rapid/message/convert/transaction_to_arr_option.rb +25 -0
- data/lib/eway_rapid/message/convert/transaction_to_payment.rb +29 -0
- data/lib/eway_rapid/message/convert/verification_to_verification_result.rb +33 -0
- data/lib/eway_rapid/message/process/customer_process.rb +255 -0
- data/lib/eway_rapid/message/process/refund_process.rb +76 -0
- data/lib/eway_rapid/message/process/rest_process.rb +87 -0
- data/lib/eway_rapid/message/process/transaction_process.rb +139 -0
- data/lib/eway_rapid/models/enums.rb +126 -0
- data/lib/eway_rapid/models/internal_models.rb +431 -0
- data/lib/eway_rapid/models/models.rb +334 -0
- data/lib/eway_rapid/output/create_transaction_response.rb +24 -0
- data/lib/eway_rapid/output/query_customer_response.rb +25 -0
- data/lib/eway_rapid/output/query_transaction_response.rb +16 -0
- data/lib/eway_rapid/output/refund_response.rb +9 -0
- data/lib/eway_rapid/output/response_output.rb +14 -0
- data/lib/eway_rapid/rapid_client.rb +444 -0
- data/lib/eway_rapid/rapid_logger.rb +40 -0
- data/lib/eway_rapid/resources/err_code_resource_en.yml +237 -0
- data/lib/eway_rapid/resources/rapid-api.yml +4 -0
- data/lib/eway_rapid/version.rb +3 -0
- metadata +201 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
class PaymentToPaymentDetails
|
5
|
+
|
6
|
+
# @param [InternalModels::Payment] payment
|
7
|
+
# @return [Models::PaymentDetails]
|
8
|
+
def do_convert(payment)
|
9
|
+
detail = Models::PaymentDetails.new
|
10
|
+
|
11
|
+
if payment
|
12
|
+
detail.currency_code = payment.currency_code
|
13
|
+
detail.invoice_description = payment.invoice_description
|
14
|
+
detail.invoice_number = payment.invoice_number
|
15
|
+
detail.invoice_reference = payment.invoice_reference
|
16
|
+
detail.total_amount = payment.total_amount
|
17
|
+
else
|
18
|
+
detail.total_amount = 0
|
19
|
+
end
|
20
|
+
detail
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Request
|
5
|
+
class RefundToDirectRefundReq
|
6
|
+
|
7
|
+
# @param [Models::Refund] refund
|
8
|
+
# @return [DirectRefundRequest]
|
9
|
+
def do_convert(refund)
|
10
|
+
request = DirectRefundRequest.new
|
11
|
+
|
12
|
+
if refund
|
13
|
+
shipping_convert = ShippingDetailsToAddress.new
|
14
|
+
customer_convert = CustomerToInternalCustomer.new
|
15
|
+
request.refund = refund.refund_details
|
16
|
+
request.shipping_address = shipping_convert.do_convert(refund.shipping_details)
|
17
|
+
request.customer = customer_convert.do_convert(refund.customer)
|
18
|
+
request.partner_id = refund.partner_id
|
19
|
+
request.device_id = refund.device_id
|
20
|
+
request.line_items = refund.line_items
|
21
|
+
|
22
|
+
# @type [Array]
|
23
|
+
list_options = refund.options
|
24
|
+
|
25
|
+
if list_options && list_options.length > 0
|
26
|
+
list_convert = []
|
27
|
+
list_options.each do |value|
|
28
|
+
op = InternalModels::Option.new
|
29
|
+
op.value = value
|
30
|
+
list_convert.push(op)
|
31
|
+
end
|
32
|
+
request.options = list_convert
|
33
|
+
end
|
34
|
+
end
|
35
|
+
request
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Request
|
5
|
+
class TransactionToCapturePayment
|
6
|
+
|
7
|
+
# @param [Models::Transaction] transaction
|
8
|
+
# @return [CapturePaymentRequest]
|
9
|
+
def do_convert(transaction)
|
10
|
+
request = CapturePaymentRequest.new
|
11
|
+
request.transaction_id = transaction.auth_transaction_id
|
12
|
+
|
13
|
+
if transaction.payment_details
|
14
|
+
payment = InternalModels::Payment.new
|
15
|
+
payment.currency_code = transaction.payment_details.currency_code
|
16
|
+
payment.invoice_description = transaction.payment_details.invoice_description
|
17
|
+
payment.invoice_number = transaction.payment_details.invoice_number
|
18
|
+
payment.invoice_reference = transaction.payment_details.invoice_reference
|
19
|
+
payment.total_amount = transaction.payment_details.total_amount
|
20
|
+
request.payment = payment
|
21
|
+
end
|
22
|
+
request
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Request
|
5
|
+
class TransactionToCreateAccessCodeRequest
|
6
|
+
|
7
|
+
# @param [Models::Transaction] transaction
|
8
|
+
# @return [CreateAccessCodeRequest]
|
9
|
+
def do_convert(transaction)
|
10
|
+
request = CreateAccessCodeRequest.new
|
11
|
+
|
12
|
+
if transaction
|
13
|
+
request.transaction_type = transaction.transaction_type
|
14
|
+
request.device_id = transaction.device_id
|
15
|
+
request.partner_id = transaction.partner_id
|
16
|
+
request.redirect_url = transaction.redirect_url
|
17
|
+
# request.payment.total_amount = transaction.payment_details.total_amount if transaction.payment_details
|
18
|
+
|
19
|
+
if transaction.customer
|
20
|
+
internal_cust_convert = CustomerToInternalCustomer.new(false)
|
21
|
+
request.customer = internal_cust_convert.do_convert(transaction.customer)
|
22
|
+
request.customer_ip = transaction.customer.customer_device_ip
|
23
|
+
end
|
24
|
+
|
25
|
+
ship_address_convert = TransactionShippingAddress.new
|
26
|
+
request.shipping_address = ship_address_convert.do_convert(transaction)
|
27
|
+
|
28
|
+
payment_convert = TransactionToPayment.new
|
29
|
+
request.payment = payment_convert.do_convert(transaction)
|
30
|
+
|
31
|
+
if transaction.checkout_url
|
32
|
+
request.checkout_payment = transaction.checkout_payment
|
33
|
+
request.checkout_url = transaction.checkout_url
|
34
|
+
end
|
35
|
+
|
36
|
+
line_item_convert = TransactionToArrLineItem.new
|
37
|
+
request.items = line_item_convert.do_convert(transaction)
|
38
|
+
|
39
|
+
option_convert = TransactionToArrOption.new
|
40
|
+
request.options = option_convert.do_convert(transaction)
|
41
|
+
|
42
|
+
if transaction.shipping_details && transaction.shipping_details.shipping_method
|
43
|
+
request.shipping_method = transaction.shipping_details.shipping_method
|
44
|
+
end
|
45
|
+
|
46
|
+
request.method = if transaction.capture
|
47
|
+
Enums::RequestMethod::PROCESS_PAYMENT
|
48
|
+
else
|
49
|
+
Enums::RequestMethod::AUTHORISE
|
50
|
+
end
|
51
|
+
end
|
52
|
+
request
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/eway_rapid/message/convert/request/transaction_to_create_access_code_shared_request.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Request
|
5
|
+
class TransactionToCreateAccessCodeSharedRequest
|
6
|
+
|
7
|
+
# @param [Models::Transaction] input
|
8
|
+
# @return [CreateAccessCodeSharedRequest]
|
9
|
+
def do_convert(input)
|
10
|
+
request = CreateAccessCodeSharedRequest.new
|
11
|
+
|
12
|
+
if input
|
13
|
+
request.cancel_url = input.cancel_url
|
14
|
+
request.transaction_type = input.transaction_type
|
15
|
+
request.device_id = input.device_id
|
16
|
+
request.partner_id = input.partner_id
|
17
|
+
request.redirect_url = input.redirect_url
|
18
|
+
request.custom_view = input.custom_view
|
19
|
+
request.header_text = input.header_text
|
20
|
+
request.customer_ip = input.customer.customer_device_ip if input.customer
|
21
|
+
request.logo_url = input.logo_url
|
22
|
+
request.language = input.language
|
23
|
+
request.verify_customer_email = input.verify_customer_email
|
24
|
+
request.verify_customer_phone = input.verify_customer_phone
|
25
|
+
request.customer_read_only = input.customer_read_only
|
26
|
+
|
27
|
+
internal_cust_convert = CustomerToInternalCustomer.new
|
28
|
+
request.customer = internal_cust_convert.do_convert(input.customer)
|
29
|
+
|
30
|
+
ship_address_convert = TransactionShippingAddress.new
|
31
|
+
request.shipping_address = ship_address_convert.do_convert(input)
|
32
|
+
|
33
|
+
payment_convert = TransactionToPayment.new
|
34
|
+
request.payment = payment_convert.do_convert(input)
|
35
|
+
|
36
|
+
line_item_convert = TransactionToArrLineItem.new
|
37
|
+
request.items = line_item_convert.do_convert(input)
|
38
|
+
|
39
|
+
option_converter = TransactionToArrOption.new
|
40
|
+
request.options = option_converter.do_convert(input)
|
41
|
+
|
42
|
+
request.method = if input.capture
|
43
|
+
Enums::RequestMethod::PROCESS_PAYMENT
|
44
|
+
else
|
45
|
+
Enums::RequestMethod::AUTHORISE
|
46
|
+
end
|
47
|
+
end
|
48
|
+
request
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Request
|
5
|
+
class TransactionToDirectPayment
|
6
|
+
|
7
|
+
# @param [Models::Transaction] input
|
8
|
+
# @return [DirectPaymentRequest]
|
9
|
+
def do_convert(input)
|
10
|
+
request = DirectPaymentRequest.new
|
11
|
+
inter_cust_convert = CustomerToInternalCustomer.new
|
12
|
+
|
13
|
+
if input.customer
|
14
|
+
request.customer_ip = input.customer.customer_device_ip
|
15
|
+
request.customer = inter_cust_convert.do_convert(input.customer)
|
16
|
+
end
|
17
|
+
|
18
|
+
payment_convert = TransactionToPayment.new
|
19
|
+
request.payment = payment_convert.do_convert(input)
|
20
|
+
|
21
|
+
ship_converter = TransactionShippingAddress.new
|
22
|
+
request.shipping_address = ship_converter.do_convert(input)
|
23
|
+
|
24
|
+
line_item_convert = TransactionToArrLineItem.new
|
25
|
+
request.items = line_item_convert.do_convert(input)
|
26
|
+
|
27
|
+
option_converter = TransactionToArrOption.new
|
28
|
+
request.options = option_converter.do_convert(input)
|
29
|
+
|
30
|
+
request.device_id = input.device_id
|
31
|
+
request.partner_id = input.partner_id
|
32
|
+
request.transaction_type = input.transaction_type || ''
|
33
|
+
request.method = if input.capture
|
34
|
+
Enums::RequestMethod::PROCESS_PAYMENT
|
35
|
+
else
|
36
|
+
Enums::RequestMethod::AUTHORISE
|
37
|
+
end
|
38
|
+
request.redirect_url = input.redirect_url
|
39
|
+
request
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Response
|
5
|
+
class AccessCodeSharedToCreateCust
|
6
|
+
|
7
|
+
# @param [CreateAccessCodeSharedResponse] response
|
8
|
+
# @return [CreateCustomerResponse]
|
9
|
+
def do_convert(response)
|
10
|
+
customer_response = CreateCustomerResponse.new
|
11
|
+
customer_response.access_code = response.access_code
|
12
|
+
customer_response.errors = response.errors.split(/\s*,\s*/) if response.errors
|
13
|
+
|
14
|
+
cust_convert = InternalCustomerToCustomer.new
|
15
|
+
customer_response.customer = cust_convert.do_convert(response.customer)
|
16
|
+
customer_response.shared_payment_url = response.shared_payment_url
|
17
|
+
customer_response
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Response
|
5
|
+
class AccessCodeSharedToCreateTrans
|
6
|
+
|
7
|
+
# @param [CreateAccessCodeSharedResponse] response
|
8
|
+
# @return [CreateTransactionResponse]
|
9
|
+
def do_convert(response)
|
10
|
+
transaction_response = CreateTransactionResponse.new
|
11
|
+
transaction = Models::Transaction.new
|
12
|
+
cust_convert = InternalCustomerToCustomer.new
|
13
|
+
transaction.customer = cust_convert.do_convert(response.customer)
|
14
|
+
|
15
|
+
payment_convert = PaymentToPaymentDetails.new
|
16
|
+
transaction.payment_details = payment_convert.do_convert(response.payment)
|
17
|
+
|
18
|
+
transaction_response.transaction = transaction
|
19
|
+
transaction_response.errors = response.errors.split(/\s*,\s*/) if response.errors
|
20
|
+
transaction_response.shared_payment_url = response.shared_payment_url
|
21
|
+
transaction_response.access_code = response.access_code
|
22
|
+
transaction_response
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Response
|
5
|
+
class AccessCodeToCreateCust
|
6
|
+
|
7
|
+
# @param [CreateAccessCodeResponse] response
|
8
|
+
# @return [CreateCustomerResponse]
|
9
|
+
def do_convert(response)
|
10
|
+
customer_response = CreateCustomerResponse.new
|
11
|
+
customer_response.access_code = response.access_code
|
12
|
+
customer_response.form_action_url = response.form_action_url
|
13
|
+
|
14
|
+
convert = InternalCustomerToCustomer.new
|
15
|
+
customer_response.customer = convert.do_convert(response.customer)
|
16
|
+
|
17
|
+
customer_response.errors = response.errors.split(/\s*,\s*/) if response.errors
|
18
|
+
customer_response
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Response
|
5
|
+
class AccessCodeToCreateTrans
|
6
|
+
|
7
|
+
# @param [CreateAccessCodeResponse] response
|
8
|
+
# @return [CreateTransactionResponse]
|
9
|
+
def do_convert(response)
|
10
|
+
transaction_response = CreateTransactionResponse.new
|
11
|
+
transaction = Models::Transaction.new
|
12
|
+
cust_convert = InternalCustomerToCustomer.new
|
13
|
+
transaction.customer = cust_convert.do_convert(response.customer)
|
14
|
+
|
15
|
+
payment_convert = PaymentToPaymentDetails.new
|
16
|
+
transaction.payment_details = payment_convert.do_convert(response.payment)
|
17
|
+
transaction_response.transaction = transaction
|
18
|
+
transaction_response.errors = response.errors.split(/\s*,\s*/) if response.errors
|
19
|
+
transaction_response.access_code = response.access_code
|
20
|
+
transaction_response.form_action_url = response.form_action_url
|
21
|
+
transaction_response
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Response
|
5
|
+
class CancelAuthorisationToRefund
|
6
|
+
attr_reader :refund
|
7
|
+
|
8
|
+
# @param [Models::Refund] refund
|
9
|
+
def initialize(refund)
|
10
|
+
@refund = refund
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param [CancelAuthorisationResponse] cancel
|
14
|
+
# @return [RefundResponse]
|
15
|
+
def do_convert(cancel)
|
16
|
+
response = RefundResponse.new
|
17
|
+
response.refund = @refund
|
18
|
+
|
19
|
+
status = Models::TransactionStatus.new
|
20
|
+
status.status = cancel.transaction_status
|
21
|
+
|
22
|
+
detail = Models::ProcessingDetails.new
|
23
|
+
detail.response_code = cancel.errors
|
24
|
+
detail.response_code = cancel.response_code
|
25
|
+
|
26
|
+
status.processing_details = detail
|
27
|
+
status.transaction_id = Integer(cancel.transaction_id)
|
28
|
+
|
29
|
+
response.transaction_status = status
|
30
|
+
response.errors = cancel.errors.split(/\s*,\s*/) if cancel.errors
|
31
|
+
response
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module EwayRapid
|
2
|
+
module Message
|
3
|
+
module Convert
|
4
|
+
module Response
|
5
|
+
class CapturePaymentToCreateTransaction
|
6
|
+
|
7
|
+
# @param [CapturePaymentResponse] capture
|
8
|
+
# @return [CreateTransactionResponse]
|
9
|
+
def do_convert(capture)
|
10
|
+
response = CreateTransactionResponse.new
|
11
|
+
status = Models::TransactionStatus.new
|
12
|
+
begin
|
13
|
+
status.transaction_id = parse_int(capture.transaction_id) if capture.transaction_id
|
14
|
+
rescue
|
15
|
+
raise ArgumentError.new 'Convert transaction id ' + capture.transaction_id + ' to integer error'
|
16
|
+
end
|
17
|
+
|
18
|
+
status.status = capture.transaction_status
|
19
|
+
|
20
|
+
detail = Models::ProcessingDetails.new
|
21
|
+
detail.response_code = capture.errors
|
22
|
+
detail.response_code = capture.response_code
|
23
|
+
detail.response_message = capture.response_message
|
24
|
+
|
25
|
+
status.processing_details = detail
|
26
|
+
|
27
|
+
response.transaction_status = status
|
28
|
+
response.errors = capture.errors.split(/\s*,\s*/) if capture.errors
|
29
|
+
response
|
30
|
+
end
|
31
|
+
|
32
|
+
def parse_int(string)
|
33
|
+
begin
|
34
|
+
Integer(string)
|
35
|
+
rescue RuntimeError
|
36
|
+
raise ArgumentError.new 'Convert transaction id ' + capture.transaction_id + ' to integer error'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|