six_saferpay 1.2.1 → 1.16.2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.test.env +1 -1
- data/.travis.yml +4 -2
- data/Gemfile.lock +70 -85
- data/README.md +120 -3
- data/lib/six_saferpay/api.rb +1 -1
- data/lib/six_saferpay/api/six_batch/requests/close.rb +37 -0
- data/lib/six_saferpay/api/six_batch/responses/close_response.rb +20 -0
- data/lib/six_saferpay/api/six_omni_channel/requests/acquire_transaction.rb +46 -0
- data/lib/six_saferpay/api/six_omni_channel/requests/insert_alias.rb +40 -0
- data/lib/six_saferpay/api/six_omni_channel/responses/acquire_transaction_response.rb +30 -0
- data/lib/six_saferpay/api/six_omni_channel/responses/insert_alias_response.rb +34 -0
- data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +4 -0
- data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +11 -2
- data/lib/six_saferpay/api/six_payment_page/responses/{initalize_response.rb → initialize_response.rb} +0 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/assert_insert.rb +37 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/delete.rb +37 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/insert.rb +66 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/insert_direct.rb +46 -0
- data/lib/six_saferpay/api/six_secure_card_data/requests/update.rb +42 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/assert_insert_response.rb +33 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/delete_response.rb +20 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/insert_direct_response.rb +33 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb +33 -0
- data/lib/six_saferpay/api/six_secure_card_data/responses/update_response.rb +29 -0
- data/lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb +61 -0
- data/lib/six_saferpay/api/six_secure_pay_gate_offer/responses/create_offer_response.rb +26 -0
- data/lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb +59 -0
- data/lib/six_saferpay/api/six_transaction/requests/authorize.rb +1 -1
- data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +4 -0
- data/lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb +4 -0
- data/lib/six_saferpay/api/six_transaction/requests/capture.rb +11 -2
- data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +4 -0
- data/lib/six_saferpay/api/six_transaction/requests/inquire.rb +36 -0
- data/lib/six_saferpay/api/six_transaction/requests/multipart_finalize.rb +38 -0
- data/lib/six_saferpay/api/six_transaction/requests/query_alternative_payment.rb +35 -0
- data/lib/six_saferpay/api/six_transaction/requests/refund.rb +7 -7
- data/lib/six_saferpay/api/six_transaction/requests/refund_direct.rb +46 -0
- data/lib/six_saferpay/api/six_transaction/responses/adjust_amount_response.rb +1 -4
- data/lib/six_saferpay/api/six_transaction/responses/alternative_payment_response.rb +35 -0
- data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +11 -2
- data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +11 -3
- data/lib/six_saferpay/api/six_transaction/responses/cancel_response.rb +1 -1
- data/lib/six_saferpay/api/six_transaction/responses/inquire_response.rb +44 -0
- data/lib/six_saferpay/api/six_transaction/responses/multipart_finalize_response.rb +20 -0
- data/lib/six_saferpay/api/six_transaction/responses/query_alternative_payment_response.rb +39 -0
- data/lib/six_saferpay/api/six_transaction/responses/refund_direct_response.rb +34 -0
- data/lib/six_saferpay/client.rb +8 -2
- data/lib/six_saferpay/clients/secure_pay_gate_api/client.rb +23 -0
- data/lib/six_saferpay/models/address.rb +4 -4
- data/lib/six_saferpay/models/alias.rb +22 -0
- data/lib/six_saferpay/models/alias_card.rb +20 -0
- data/lib/six_saferpay/models/authentication.rb +36 -0
- data/lib/six_saferpay/models/authentication_result.rb +20 -0
- data/lib/six_saferpay/models/bancontact.rb +20 -0
- data/lib/six_saferpay/models/bankcontact.rb +21 -0
- data/lib/six_saferpay/models/check.rb +22 -0
- data/lib/six_saferpay/models/check_result.rb +27 -0
- data/lib/six_saferpay/models/chosen_plan.rb +62 -0
- data/lib/six_saferpay/models/custom_plan.rb +4 -0
- data/lib/six_saferpay/models/error.rb +0 -28
- data/lib/six_saferpay/models/first_installment_amount.rb +4 -0
- data/lib/six_saferpay/models/ideal.rb +18 -0
- data/lib/six_saferpay/models/installment_fee.rb +4 -0
- data/lib/six_saferpay/models/installment_plans.rb +73 -0
- data/lib/six_saferpay/models/mastercard_issuer_installments.rb +49 -0
- data/lib/six_saferpay/models/notification.rb +4 -4
- data/lib/six_saferpay/models/payment_method_options.rb +18 -0
- data/lib/six_saferpay/models/payment_methods_options.rb +4 -2
- data/lib/six_saferpay/models/pending_notification.rb +4 -4
- data/lib/six_saferpay/models/processing_data.rb +18 -0
- data/lib/six_saferpay/models/registration_result.rb +11 -2
- data/lib/six_saferpay/models/request_payment_means.rb +6 -2
- data/lib/six_saferpay/models/response_card.rb +0 -4
- data/lib/six_saferpay/models/saferpay_fields.rb +18 -0
- data/lib/six_saferpay/models/subsequent_installment_amount.rb +4 -0
- data/lib/six_saferpay/models/total_amont_due.rb +4 -0
- data/lib/six_saferpay/models/update_alias.rb +20 -0
- data/lib/six_saferpay/models/update_payment_means.rb +18 -0
- data/lib/six_saferpay/version.rb +1 -1
- data/six_saferpay.gemspec +12 -14
- metadata +81 -28
@@ -0,0 +1,20 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixSecureData
|
3
|
+
class DeleteResponse
|
4
|
+
|
5
|
+
attr_accessor(:response_header)
|
6
|
+
|
7
|
+
def initialize(response_header: )
|
8
|
+
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_hash
|
12
|
+
hash = Hash.new
|
13
|
+
hash.merge!(response_header: @response_header.to_h) if @response_header
|
14
|
+
hash
|
15
|
+
end
|
16
|
+
alias_method :to_h, :to_hash
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixSecureData
|
3
|
+
class InsertDirectResponse
|
4
|
+
|
5
|
+
attr_accessor(:response_header,
|
6
|
+
:fd_alias,
|
7
|
+
:payment_means,
|
8
|
+
:check_result
|
9
|
+
)
|
10
|
+
|
11
|
+
def initialize(response_header:,
|
12
|
+
fd_alias:,
|
13
|
+
payment_means:,
|
14
|
+
check_result: nil)
|
15
|
+
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
|
16
|
+
@fd_alias = SixSaferpay::Alias.new(fd_alias.to_h) if fd_alias
|
17
|
+
@payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
|
18
|
+
@check_result = SixSaferpay::CheckResult.new(check_result.to_h) if check_result
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_hash
|
22
|
+
hash = Hash.new
|
23
|
+
hash.merge!(response_header: @response_header.to_h) if @response_header
|
24
|
+
hash.merge!(fd_alias: @fd_alias.to_h) if @fd_alias
|
25
|
+
hash.merge!(payment_means: @payment_means.to_h) if @payment_means
|
26
|
+
hash.merge!(check_result: @check_result.to_h) if @check_result
|
27
|
+
hash
|
28
|
+
end
|
29
|
+
alias_method :to_h, :to_hash
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixSecureData
|
3
|
+
class InsertResponse
|
4
|
+
|
5
|
+
attr_accessor(:response_header,
|
6
|
+
:token,
|
7
|
+
:expiration,
|
8
|
+
:redirect_url
|
9
|
+
)
|
10
|
+
|
11
|
+
def initialize(response_header:,
|
12
|
+
token:,
|
13
|
+
expiration:,
|
14
|
+
redirect_url: )
|
15
|
+
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
|
16
|
+
@token = token
|
17
|
+
@expiration = expiration
|
18
|
+
@redirect_url = redirect_url
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_hash
|
22
|
+
hash = Hash.new
|
23
|
+
hash.merge!(response_header: @response_header.to_h) if @response_header
|
24
|
+
hash.merge!(token: @token) if @token
|
25
|
+
hash.merge!(expiration: @expiration) if @expiration
|
26
|
+
hash.merge!(redirect_url: @redirect_url) if @redirect_url
|
27
|
+
hash
|
28
|
+
end
|
29
|
+
alias_method :to_h, :to_hash
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixSecureData
|
3
|
+
class UpdateResponse
|
4
|
+
|
5
|
+
attr_accessor(:response_header,
|
6
|
+
:fd_alias,
|
7
|
+
:payment_means
|
8
|
+
)
|
9
|
+
|
10
|
+
def initialize(response_header:,
|
11
|
+
fd_alias:,
|
12
|
+
payment_means: )
|
13
|
+
@response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
|
14
|
+
@fd_alias = SixSaferpay::Alias.new(fd_alias.to_h)
|
15
|
+
@payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h)
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_hash
|
19
|
+
hash = Hash.new
|
20
|
+
hash.merge!(response_header: @response_header.to_h) if @response_header
|
21
|
+
hash.merge!(fd_alias: @fd_alias.to_h) if @fd_alias
|
22
|
+
hash.merge!(payment_means: @payment_means.to_h) if @payment_means
|
23
|
+
hash
|
24
|
+
end
|
25
|
+
alias_method :to_h, :to_hash
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixSecurePayGateOffer
|
3
|
+
class CreateOffer
|
4
|
+
|
5
|
+
attr_accessor(:payment,
|
6
|
+
:expiration_date,
|
7
|
+
:config_set,
|
8
|
+
:payer,
|
9
|
+
:billing_address_form
|
10
|
+
)
|
11
|
+
|
12
|
+
def initialize(payment: ,
|
13
|
+
expiration_date: ,
|
14
|
+
config_set: nil,
|
15
|
+
payer: ,
|
16
|
+
billing_address_form: nil
|
17
|
+
)
|
18
|
+
|
19
|
+
@payment = SixSaferpay::Payment.new(payment.to_h) if payment
|
20
|
+
@expiration_date = expiration_date
|
21
|
+
@config_set = config_set
|
22
|
+
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
23
|
+
@billing_address_form =
|
24
|
+
SixSaferpay::BillingAddressForm.new(billing_address_form) if billing_address_form
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_hash
|
28
|
+
hash = Hash.new
|
29
|
+
hash.merge!(payment: @payment.to_h) if @payment
|
30
|
+
hash.merge!(expiration_date: @expiration_date) if @expiration_date
|
31
|
+
hash.merge!(config_set: @config_set) if @config_set
|
32
|
+
hash.merge!(payer: @payer.to_h) if @payer
|
33
|
+
hash.merge!(billing_address_form: @billing_address_form.to_h) if @billing_address_form
|
34
|
+
hash
|
35
|
+
end
|
36
|
+
alias_method :to_h, :to_hash
|
37
|
+
|
38
|
+
def to_json
|
39
|
+
to_hash.to_json
|
40
|
+
end
|
41
|
+
|
42
|
+
def url
|
43
|
+
"/rest/customers/#{customer_id}/terminals/#{terminal_id}/spg-offers"
|
44
|
+
end
|
45
|
+
|
46
|
+
def response_class
|
47
|
+
SixSaferpay::SixSecurePayGateOffer::CreateOfferResponse
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def customer_id
|
53
|
+
SixSaferpay.config.customer_id
|
54
|
+
end
|
55
|
+
|
56
|
+
def terminal_id
|
57
|
+
SixSaferpay.config.terminal_id
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixSecurePayGateOffer
|
3
|
+
class CreateOfferResponse
|
4
|
+
|
5
|
+
attr_accessor(:offer_id,
|
6
|
+
:payment_link
|
7
|
+
)
|
8
|
+
|
9
|
+
def initialize(offer_id:,
|
10
|
+
payment_link: )
|
11
|
+
|
12
|
+
@offer_id = offer_id if offer_id
|
13
|
+
@payment_link = payment_link if payment_link
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_hash
|
17
|
+
hash = Hash.new
|
18
|
+
hash.merge!(offer_id: @offer_id) if @offer_id
|
19
|
+
hash.merge!(payment_link: @payment_link) if @payment_link
|
20
|
+
hash
|
21
|
+
end
|
22
|
+
alias_method :to_h, :to_hash
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixTransaction
|
3
|
+
class AlternativePayment
|
4
|
+
|
5
|
+
attr_accessor(:request_header,
|
6
|
+
:terminal_id,
|
7
|
+
:payment,
|
8
|
+
:payment_method,
|
9
|
+
:payment_method_options,
|
10
|
+
:payer,
|
11
|
+
:notification
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
def initialize(request_header: nil,
|
17
|
+
terminal_id:,
|
18
|
+
payment:,
|
19
|
+
payment_method:,
|
20
|
+
payment_method_options: nil,
|
21
|
+
payer: nil,
|
22
|
+
notification: )
|
23
|
+
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
24
|
+
@terminal_id = terminal_id
|
25
|
+
@payment = SixSaferpay::Payment.new(payment.to_h)
|
26
|
+
@payment_method = payment_method
|
27
|
+
@payment_method_options = SixSaferpay::PaymentMethodOptions.new(payment_method_options.to_h) if payment_method_options
|
28
|
+
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
29
|
+
@notification = SixSaferpay::Notification.new(notification.to_h)
|
30
|
+
end
|
31
|
+
|
32
|
+
def to_hash
|
33
|
+
hash = Hash.new
|
34
|
+
hash.merge!(request_header: @request_header.to_h) if @request_header
|
35
|
+
hash.merge!(terminal_id: @terminal_id)
|
36
|
+
hash.merge!(payment: @payment.to_h)
|
37
|
+
hash.merge!(payment_method: @payment_method)
|
38
|
+
hash.merge!(payment_method_options: @payment_method_options.to_h) if @payment_method_options
|
39
|
+
hash.merge!(payer: @payer.to_h) if @payer
|
40
|
+
hash.merge!(notification: @notification.to_h)
|
41
|
+
hash
|
42
|
+
end
|
43
|
+
alias_method :to_h, :to_hash
|
44
|
+
|
45
|
+
def to_json
|
46
|
+
to_hash.to_json
|
47
|
+
end
|
48
|
+
|
49
|
+
def url
|
50
|
+
'/Payment/v1/Transaction/AlternativePayment'
|
51
|
+
end
|
52
|
+
|
53
|
+
def response_class
|
54
|
+
SixSaferpay::SixTransaction::AlternativePaymentResponse
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -25,7 +25,7 @@ module SixSaferpay
|
|
25
25
|
|
26
26
|
def to_hash
|
27
27
|
hash = Hash.new
|
28
|
-
hash.merge!(request_header: @request_header.to_h) if @
|
28
|
+
hash.merge!(request_header: @request_header.to_h) if @request_header
|
29
29
|
hash.merge!(token: @token) if @token
|
30
30
|
hash.merge!(condition: @condition) if @condition
|
31
31
|
hash.merge!(verification_code: @verification_code) if @verification_code
|
@@ -6,6 +6,7 @@ module SixSaferpay
|
|
6
6
|
:terminal_id,
|
7
7
|
:payment,
|
8
8
|
:payment_means,
|
9
|
+
:authentication,
|
9
10
|
:register_alias,
|
10
11
|
:payer
|
11
12
|
)
|
@@ -15,6 +16,7 @@ module SixSaferpay
|
|
15
16
|
terminal_id: nil,
|
16
17
|
payment:,
|
17
18
|
payment_means:,
|
19
|
+
authentication: nil,
|
18
20
|
register_alias: nil,
|
19
21
|
payer: nil
|
20
22
|
)
|
@@ -22,6 +24,7 @@ module SixSaferpay
|
|
22
24
|
@terminal_id = SixSaferpay.config.terminal_id || terminal_id
|
23
25
|
@payment = SixSaferpay::Payment.new(payment.to_h) if payment
|
24
26
|
@payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
|
27
|
+
@authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
|
25
28
|
@register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
|
26
29
|
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
27
30
|
end
|
@@ -32,6 +35,7 @@ module SixSaferpay
|
|
32
35
|
hash.merge!(terminal_id: @terminal_id) if @terminal_id
|
33
36
|
hash.merge!(payment: @payment.to_h) if @payment
|
34
37
|
hash.merge!(payment_means: @payment_means.to_h) if @payment_means
|
38
|
+
hash.merge!(authentication: @authentication.to_h) if @authentication
|
35
39
|
hash.merge!(register_alias: @register_alias.to_h) if @register_alias
|
36
40
|
hash.merge!(payer: @payer.to_h) if @payer
|
37
41
|
hash
|
@@ -6,6 +6,7 @@ module SixSaferpay
|
|
6
6
|
:terminal_id,
|
7
7
|
:payment,
|
8
8
|
:transaction_reference,
|
9
|
+
:authentication,
|
9
10
|
:suppress_dcc
|
10
11
|
)
|
11
12
|
|
@@ -14,12 +15,14 @@ module SixSaferpay
|
|
14
15
|
terminal_id: nil,
|
15
16
|
payment:,
|
16
17
|
transaction_reference:,
|
18
|
+
authentication: nil,
|
17
19
|
suppress_dcc:
|
18
20
|
)
|
19
21
|
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
20
22
|
@terminal_id = terminal_id || SixSaferpay.config.terminal_id
|
21
23
|
@payment = SixSaferpay::Payment.new(payment.to_h) if payment
|
22
24
|
@transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
|
25
|
+
@authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
|
23
26
|
@suppress_dcc = suppress_dcc
|
24
27
|
end
|
25
28
|
|
@@ -29,6 +32,7 @@ module SixSaferpay
|
|
29
32
|
hash.merge!(terminal_id: @terminal_id) if @terminal_id
|
30
33
|
hash.merge!(payment: @payment.to_h) if @payment
|
31
34
|
hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
|
35
|
+
hash.merge!(authentication: @authentication.to_h) if @authentication
|
32
36
|
hash.merge!(suppress_dcc: @suppress_dcc) if !@suppress_dcc.nil?
|
33
37
|
hash
|
34
38
|
end
|
@@ -7,7 +7,8 @@ module SixSaferpay
|
|
7
7
|
:amount,
|
8
8
|
:billpay,
|
9
9
|
:pending_notification,
|
10
|
-
:marketplace
|
10
|
+
:marketplace,
|
11
|
+
:mastercard_issuer_installments
|
11
12
|
)
|
12
13
|
|
13
14
|
|
@@ -16,7 +17,8 @@ module SixSaferpay
|
|
16
17
|
amount: nil,
|
17
18
|
billpay: nil,
|
18
19
|
pending_notification: nil,
|
19
|
-
marketplace: nil
|
20
|
+
marketplace: nil,
|
21
|
+
mastercard_issuer_installments: nil
|
20
22
|
)
|
21
23
|
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
22
24
|
@transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
|
@@ -24,6 +26,10 @@ module SixSaferpay
|
|
24
26
|
@billpay = SixSaferpay::Billpay.new(billpay.to_h) if billpay
|
25
27
|
@pending_notification = SixSaferpay::PendingNotification.new(pending_notification.to_h) if pending_notification
|
26
28
|
@marketplace = SixSaferpay::Marketplace.new(marketplace.to_h) if marketplace
|
29
|
+
if mastercard_issuer_installments
|
30
|
+
@mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
|
31
|
+
.new(mastercard_issuer_installments.to_h)
|
32
|
+
end
|
27
33
|
end
|
28
34
|
|
29
35
|
def to_hash
|
@@ -34,6 +40,9 @@ module SixSaferpay
|
|
34
40
|
hash.merge!(billpay: @billpay.to_h) if @billpay
|
35
41
|
hash.merge!(pending_notification: @pending_notification.to_h) if @pending_notification
|
36
42
|
hash.merge!(marketplace: @marketplace.to_h) if @marketplace
|
43
|
+
if @mastercard_issuer_installments
|
44
|
+
hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
|
45
|
+
end
|
37
46
|
hash
|
38
47
|
end
|
39
48
|
alias_method :to_h, :to_hash
|
@@ -8,6 +8,7 @@ module SixSaferpay
|
|
8
8
|
:terminal_id,
|
9
9
|
:payment,
|
10
10
|
:payment_means,
|
11
|
+
:authentication,
|
11
12
|
:payer,
|
12
13
|
:return_urls,
|
13
14
|
:styling,
|
@@ -22,6 +23,7 @@ module SixSaferpay
|
|
22
23
|
terminal_id: nil,
|
23
24
|
payment:,
|
24
25
|
payment_means: nil,
|
26
|
+
authentication: nil,
|
25
27
|
payer: nil,
|
26
28
|
return_urls: nil,
|
27
29
|
styling: nil,
|
@@ -34,6 +36,7 @@ module SixSaferpay
|
|
34
36
|
@terminal_id = terminal_id || SixSaferpay.config.terminal_id
|
35
37
|
@payment = SixSaferpay::Payment.new(payment.to_h) if payment
|
36
38
|
@payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
|
39
|
+
@authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
|
37
40
|
@payer = SixSaferpay::Payer.new(payer.to_h) if payer
|
38
41
|
@return_urls = return_urls || SixSaferpay::ReturnUrls.new()
|
39
42
|
@styling = SixSaferpay::Styling.new(styling.to_h) if styling
|
@@ -49,6 +52,7 @@ module SixSaferpay
|
|
49
52
|
hash.merge!(terminal_id: @terminal_id) if @terminal_id
|
50
53
|
hash.merge!(payment: @payment.to_h) if @payment
|
51
54
|
hash.merge!(payment_means: @payment_means.to_h) if @payment_means
|
55
|
+
hash.merge!(authentication: @authentication.to_h) if @authentication
|
52
56
|
hash.merge!(payer: @payer.to_h) if @payer
|
53
57
|
hash.merge!(return_urls: @return_urls.to_h ) if @return_urls
|
54
58
|
hash.merge!(styling: @styling.to_h) if @styling
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module SixSaferpay
|
2
|
+
module SixTransaction
|
3
|
+
class Inquire
|
4
|
+
|
5
|
+
attr_accessor(:request_header,
|
6
|
+
:transaction_reference)
|
7
|
+
|
8
|
+
|
9
|
+
def initialize(request_header: nil,
|
10
|
+
transaction_reference: )
|
11
|
+
@request_header = request_header || SixSaferpay::RequestHeader.new()
|
12
|
+
@transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_hash
|
16
|
+
hash = Hash.new
|
17
|
+
hash.merge!(request_header: @request_header.to_h) if @request_header
|
18
|
+
hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
|
19
|
+
hash
|
20
|
+
end
|
21
|
+
alias_method :to_h, :to_hash
|
22
|
+
|
23
|
+
def to_json
|
24
|
+
to_hash.to_json
|
25
|
+
end
|
26
|
+
|
27
|
+
def url
|
28
|
+
'/Payment/v1/Transaction/Inquire'
|
29
|
+
end
|
30
|
+
|
31
|
+
def response_class
|
32
|
+
SixSaferpay::SixTransaction::InquireResponse
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|