six_saferpay 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb +38 -0
  4. data/lib/six_saferpay/api/six_transaction/requests/assert_refund.rb +36 -0
  5. data/lib/six_saferpay/api/six_transaction/requests/authorize.rb +6 -1
  6. data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +54 -0
  7. data/lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb +50 -0
  8. data/lib/six_saferpay/api/six_transaction/requests/cancel.rb +4 -0
  9. data/lib/six_saferpay/api/six_transaction/requests/capture.rb +4 -4
  10. data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +4 -0
  11. data/lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb +55 -0
  12. data/lib/six_saferpay/api/six_transaction/requests/query_payment_means.rb +39 -0
  13. data/lib/six_saferpay/api/six_transaction/requests/refund.rb +45 -0
  14. data/lib/six_saferpay/api/six_transaction/responses/adjust_amount_response.rb +23 -0
  15. data/lib/six_saferpay/api/six_transaction/responses/assert_refund_response.rb +39 -0
  16. data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +39 -0
  17. data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +2 -1
  18. data/lib/six_saferpay/api/six_transaction/responses/authorized_referenced_response.rb +40 -0
  19. data/lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb +33 -0
  20. data/lib/six_saferpay/api/six_transaction/responses/query_payment_means_response.rb +38 -0
  21. data/lib/six_saferpay/api/six_transaction/responses/refund_response.rb +34 -0
  22. data/lib/six_saferpay/models/capture_reference.rb +33 -0
  23. data/lib/six_saferpay/models/refund.rb +27 -0
  24. data/lib/six_saferpay/version.rb +1 -1
  25. metadata +17 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ceaa6770af2ef4601171a3712aa2eb140392c1b44ce467e27ba2854a0b8fcca3
4
- data.tar.gz: 836723987b8b80de63418413e5a7e32c446f27f0fbb1fc1c5f13e2301605bcf4
3
+ metadata.gz: 6b301e45634eb8d65b0fca368b23c5fe5e06458b4cda1ee5a346324f9685d636
4
+ data.tar.gz: 1540d244e96c044ac79d7c9ae23f6d9d12e4b76c12edc239d79ae214ab1deb6e
5
5
  SHA512:
6
- metadata.gz: 5c54b4d3b7e6f4572dd3a783ac8de905e5abf915198c7a8a5a4b28f8d92340882a90efacad5cbc5b9c827296cb71395cfa8bf2cd9587a0da11f63ef202260380
7
- data.tar.gz: 409044750e116e69a0c4be1d417a6272c5f189d36933fe2d5203f08857614c6909c8cf5e82ab6436c5b35f654d8023eb90ec9d40cf9f9f4fa82a9489e683e47f
6
+ metadata.gz: 37cd5eeffbbb9578fc08ba551aa04581e34a9cb77cd0aaa04f4d6bfd8ed0f4f67ebd34455623bfd38f8811bde22b94efc25cf99c6a6cb136cf7df16bff2c5d1a
7
+ data.tar.gz: bbc8353cc6846bf2c768c6339d1905090b94f35c036cb0b72b8ae26f21e485ad42d594101851f65c15508e1fdf450c0012486d4edb8191e8379909371d9b4241
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- six_saferpay (0.1.10)
4
+ six_saferpay (1.0.0)
5
5
  activesupport (~> 5.0, >= 5.0.0.0)
6
6
 
7
7
  GEM
@@ -0,0 +1,38 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class AdjustAmount
4
+
5
+ attr_accessor(:request_header,
6
+ :token,
7
+ :amount
8
+ )
9
+
10
+
11
+
12
+ def initialize(request_header: nil,
13
+ token: ,
14
+ amount: )
15
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
16
+ @token = token
17
+ @amount = SixSaferpay::Amount.new(amount.to_h) if amount
18
+ end
19
+
20
+ def to_hash
21
+ hash = Hash.new
22
+ hash.merge!(request_header: @request_header.to_h) if @request_header
23
+ hash.merge!(token: @token) if @token
24
+ hash.merge!(amount: @amount.to_h) if @amount
25
+ hash
26
+ end
27
+ alias_method :to_h, :to_hash
28
+
29
+ def to_json
30
+ to_hash.to_json
31
+ end
32
+
33
+ def url
34
+ '/Payment/v1/Transaction/AdjustAmount'
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,36 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class AssertRefund
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/AssertRefund'
29
+ end
30
+
31
+ def response_class
32
+ SixSaferpay::SixTransaction::AssertRefundResponse
33
+ end
34
+ end
35
+ end
36
+ end
@@ -2,11 +2,12 @@ module SixSaferpay
2
2
  module SixTransaction
3
3
  class Authorize
4
4
 
5
- attr_accessor :request_header,
5
+ attr_accessor(:request_header,
6
6
  :token,
7
7
  :condition,
8
8
  :verification_code,
9
9
  :register_alias
10
+ )
10
11
 
11
12
 
12
13
  def initialize(request_header: nil,
@@ -40,6 +41,10 @@ module SixSaferpay
40
41
  def url
41
42
  '/Payment/v1/Transaction/Authorize'
42
43
  end
44
+
45
+ def response_class
46
+ SixSaferpay::SixTransaction::AuthorizeResponse
47
+ end
43
48
  end
44
49
  end
45
50
  end
@@ -0,0 +1,54 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class AuthorizeDirect
4
+
5
+ attr_accessor(:request_header,
6
+ :terminal_id,
7
+ :payment,
8
+ :payment_means,
9
+ :register_alias,
10
+ :payer
11
+ )
12
+
13
+
14
+ def initialize(request_header: nil,
15
+ terminal_id: nil,
16
+ payment:,
17
+ payment_means:,
18
+ register_alias: nil,
19
+ payer: nil
20
+ )
21
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
22
+ @terminal_id = SixSaferpay.config.terminal_id || terminal_id
23
+ @payment = SixSaferpay::Payment.new(payment.to_h) if payment
24
+ @payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
25
+ @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
26
+ @payer = SixSaferpay::Payer.new(payer.to_h) if payer
27
+ end
28
+
29
+ def to_hash
30
+ hash = Hash.new
31
+ hash.merge!(request_header: @request_header.to_h) if @register_alias
32
+ hash.merge!(terminal_id: @terminal_id) if @terminal_id
33
+ hash.merge!(payment: @payment.to_h) if @payment
34
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
35
+ hash.merge!(register_alias: @register_alias.to_h) if @register_alias
36
+ hash.merge!(payer: @payer.to_h) if @payer
37
+ hash
38
+ end
39
+ alias_method :to_h, :to_hash
40
+
41
+ def to_json
42
+ to_hash.to_json
43
+ end
44
+
45
+ def url
46
+ '/Payment/v1/Transaction/AuthorizeDirect'
47
+ end
48
+
49
+ def response_class
50
+ SixSaferpay::SixTransaction::AuthorizeDirectResponse
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,50 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class AuthorizeReferenced
4
+
5
+ attr_accessor(:request_header,
6
+ :terminal_id,
7
+ :payment,
8
+ :transaction_reference,
9
+ :suppress_dcc
10
+ )
11
+
12
+
13
+ def initialize(request_header: nil,
14
+ terminal_id: nil,
15
+ payment:,
16
+ transaction_reference:,
17
+ suppress_dcc:
18
+ )
19
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
20
+ @terminal_id = terminal_id || SixSaferpay.config.terminal_id
21
+ @payment = SixSaferpay::Payment.new(payment.to_h) if payment
22
+ @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
23
+ @suppress_dcc = suppress_dcc
24
+ end
25
+
26
+ def to_hash
27
+ hash = Hash.new
28
+ hash.merge!(request_header: @request_header.to_h) if @request_header
29
+ hash.merge!(terminal_id: @terminal_id) if @terminal_id
30
+ hash.merge!(payment: @payment.to_h) if @payment
31
+ hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
32
+ hash.merge!(suppress_dcc: @suppress_dcc) if !@suppress_dcc.nil?
33
+ hash
34
+ end
35
+ alias_method :to_h, :to_hash
36
+
37
+ def to_json
38
+ to_hash.to_json
39
+ end
40
+
41
+ def url
42
+ '/Payment/v1/Transaction/AuthorizeReferenced'
43
+ end
44
+
45
+ def response_class
46
+ SixSaferpay::SixTransaction::AuthorizeReferencedResponse
47
+ end
48
+ end
49
+ end
50
+ end
@@ -26,6 +26,10 @@ module SixSaferpay
26
26
  def url
27
27
  '/Payment/v1/Transaction/Cancel'
28
28
  end
29
+
30
+ def response_class
31
+ SixSaferpay::SixTransaction::CancelResponse
32
+ end
29
33
  end
30
34
  end
31
35
  end
@@ -6,7 +6,7 @@ module SixSaferpay
6
6
  :transaction_reference,
7
7
  :amount,
8
8
  :billpay,
9
- :pending_notifiction,
9
+ :pending_notification,
10
10
  :marketplace
11
11
  )
12
12
 
@@ -15,14 +15,14 @@ module SixSaferpay
15
15
  transaction_reference:,
16
16
  amount: nil,
17
17
  billpay: nil,
18
- pending_notifiction: nil,
18
+ pending_notification: nil,
19
19
  marketplace: nil
20
20
  )
21
21
  @request_header = request_header || SixSaferpay::RequestHeader.new()
22
22
  @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
23
23
  @amount = SixSaferpay::Amount.new(amount.to_h) if amount
24
24
  @billpay = SixSaferpay::Billpay.new(billpay.to_h) if billpay
25
- @pending_notifiction = SixSaferpay::PendingNotification.new(pending_notifiction.to_h) if pending_notifiction
25
+ @pending_notification = SixSaferpay::PendingNotification.new(pending_notification.to_h) if pending_notification
26
26
  @marketplace = SixSaferpay::Marketplace.new(marketplace.to_h) if marketplace
27
27
  end
28
28
 
@@ -32,7 +32,7 @@ module SixSaferpay
32
32
  hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
33
33
  hash.merge!(amount: @amount.to_h) if @amount
34
34
  hash.merge!(billpay: @billpay.to_h) if @billpay
35
- hash.merge!(pending_notifiction: @pending_notifiction.to_h) if @pending_notifiction
35
+ hash.merge!(pending_notification: @pending_notification.to_h) if @pending_notification
36
36
  hash.merge!(marketplace: @marketplace.to_h) if @marketplace
37
37
  hash
38
38
  end
@@ -67,6 +67,10 @@ module SixSaferpay
67
67
  '/Payment/v1/Transaction/Initialize'
68
68
  end
69
69
 
70
+ def response_class
71
+ SixSaferpay::SixTransaction::InitializeResponse
72
+ end
73
+
70
74
  end
71
75
  end
72
76
  end
@@ -0,0 +1,55 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class MultipartCapture
4
+
5
+ attr_accessor(:request_header,
6
+ :transaction_reference,
7
+ :amount,
8
+ :type,
9
+ :order_part_id,
10
+ :marketplace
11
+ )
12
+
13
+
14
+ def initialize(request_header: nil,
15
+ transaction_reference:,
16
+ amount: nil,
17
+ type:,
18
+ order_part_id:,
19
+ marketplace: nil
20
+ )
21
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
22
+ @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
23
+ @amount = SixSaferpay::Amount.new(amount.to_h) if amount
24
+ @type = type
25
+ @order_part_id = order_part_id
26
+ @marketplace = SixSaferpay::Marketplace.new(marketplace.to_h) if marketplace
27
+ end
28
+
29
+ def to_hash
30
+ hash = Hash.new
31
+ hash.merge!(request_header: @request_header.to_h) if @request_header
32
+ hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
33
+ hash.merge!(amount: @amount.to_h) if @amount
34
+ hash.merge!(type: @type) if @type
35
+ hash.merge!(order_part_id: @order_part_id) if @order_part_id
36
+ hash.merge!(marketplace: @marketplace.to_h) if @marketplace
37
+ hash
38
+ end
39
+ alias_method :to_h, :to_hash
40
+
41
+ def to_json
42
+ to_hash.to_json
43
+ end
44
+
45
+ def url
46
+ '/Payment/v1/Transaction/MultipartCapture'
47
+ end
48
+
49
+ def response_class
50
+ SixSaferpay::SixTransaction::MultipartCaptureResponse
51
+ end
52
+
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,39 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class QueryPaymentMeans
4
+
5
+ attr_accessor :request_header, :token, :return_urls
6
+
7
+
8
+
9
+ def initialize(request_header: nil,
10
+ token: ,
11
+ return_urls: nil)
12
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
13
+ @token = token
14
+ @return_urls = SixSaferpay::ReturnUrls.new(return_urls.to_h) if return_urls
15
+ end
16
+
17
+ def to_hash
18
+ hash = Hash.new
19
+ hash.merge!(request_header: @request_header.to_h) if @request_header
20
+ hash.merge!(token: @token) if @token
21
+ hash.merge!(return_urls: @return_urls.to_h) if @return_urls
22
+ hash
23
+ end
24
+ alias_method :to_h, :to_hash
25
+
26
+ def to_json
27
+ to_hash.to_json
28
+ end
29
+
30
+ def url
31
+ '/Payment/v1/Transaction/QueryPaymentMeans'
32
+ end
33
+
34
+ def response_class
35
+ SixSaferpay::SixTransaction::QueryPaymentMeansResponse
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,45 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class Refund
4
+
5
+ attr_accessor :request_header,
6
+ :refund,
7
+ :capture_reference,
8
+ :pending_notification
9
+
10
+
11
+
12
+ def initialize(request_header: nil,
13
+ refund: ,
14
+ capture_reference: ,
15
+ pending_notification: nil)
16
+ @request_header = request_header || SixSaferpay::RequestHeader.new()
17
+ @refund = SixSaferpay::Refund.new(refund.to_h) if refund
18
+ @capture_reference = SixSaferpay::CaptureReference.new(capture_reference.to_h) if capture_reference
19
+ @pending_notification = SixSaferpay::PendingNotification.new(pending_notification.to_h) if pending_notification
20
+ end
21
+
22
+ def to_hash
23
+ hash = Hash.new
24
+ hash.merge!(request_header: @request_header.to_h) if @request_header
25
+ hash.merge!(refund: @refund.to_h) if @refund
26
+ hash.merge!(capture_reference: @capture_reference.to_h) if @capture_reference
27
+ hash.merge!(pending_notification: @pending_notification.to_h) if @pending_notification
28
+ hash
29
+ end
30
+ alias_method :to_h, :to_hash
31
+
32
+ def to_json
33
+ to_hash.to_json
34
+ end
35
+
36
+ def url
37
+ '/Payment/v1/Transaction/QueryPaymentMeans'
38
+ end
39
+
40
+ def response_class
41
+ SixSaferpay::SixTransaction::RefundRespose
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,23 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class AdjustAmountResponse
4
+
5
+ attr_accessor(:response_header,
6
+ )
7
+
8
+
9
+
10
+ def initialize(response_header: )
11
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
12
+ end
13
+
14
+ def to_hash
15
+ hash = Hash.new
16
+ hash.merge!(response_header: @response_header.to_h) if @response_header
17
+ hash
18
+ end
19
+ alias_method :to_h, :to_hash
20
+
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,39 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class AssertRefundResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :transaction_id,
7
+ :order_id,
8
+ :status,
9
+ :date
10
+ )
11
+
12
+
13
+
14
+ def initialize(response_header:,
15
+ transaction_id: ,
16
+ order_id: nil,
17
+ status: ,
18
+ date: )
19
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
20
+ @transaction_id = transaction_id
21
+ @order_id = order_id
22
+ @status = status
23
+ @date = date
24
+ end
25
+
26
+ def to_hash
27
+ hash = Hash.new
28
+ hash.merge!(response_header: @response_header.to_h) if @response_header
29
+ hash.merge!(transaction_id: @transaction_id) if @transaction_id
30
+ hash.merge!(order_id: @order_id) if @order_id
31
+ hash.merge!(status: @status) if @status
32
+ hash.merge!(date: @date) if @date
33
+ hash
34
+ end
35
+ alias_method :to_h, :to_hash
36
+
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,39 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class AuthorizeDirectResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :transaction,
7
+ :payment_means,
8
+ :payer,
9
+ :registration_result
10
+ )
11
+
12
+
13
+ def initialize(response_header:,
14
+ transaction:,
15
+ payment_means:,
16
+ payer: nil,
17
+ registration_result: nil
18
+ )
19
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
20
+ @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
21
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
22
+ @payer = SixSaferpay::Payer.new(payer.to_h) if payer
23
+ @registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
24
+ end
25
+
26
+ def to_hash
27
+ hash = Hash.new
28
+ hash.merge!(response_header: @response_header.to_h) if @response_header
29
+ hash.merge!(transaction: @transaction.to_h) if @transaction
30
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
31
+ hash.merge!(payer: @payer.to_h) if @payer
32
+ hash.merge!(registration_result: @registration_result.to_h) if @registration_result
33
+ hash
34
+ end
35
+ alias_method :to_h, :to_hash
36
+
37
+ end
38
+ end
39
+ end
@@ -2,13 +2,14 @@ module SixSaferpay
2
2
  module SixTransaction
3
3
  class AuthorizeResponse
4
4
 
5
- attr_accessor :response_header,
5
+ attr_accessor(:response_header,
6
6
  :transaction,
7
7
  :payment_means,
8
8
  :payer,
9
9
  :registration_result,
10
10
  :liability,
11
11
  :dcc
12
+ )
12
13
 
13
14
 
14
15
  def initialize(response_header:,
@@ -0,0 +1,40 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class AuthorizeReferencedResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :transaction,
7
+ :payment_means,
8
+ :payer,
9
+ :dcc
10
+ )
11
+
12
+
13
+ def initialize(response_header:,
14
+ transaction:,
15
+ payment_means:,
16
+ payer: nil,
17
+ dcc: nil
18
+
19
+ )
20
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
21
+ @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
22
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
23
+ @payer = SixSaferpay::Payer.new(payer.to_h) if payer
24
+ @dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
25
+ end
26
+
27
+ def to_hash
28
+ hash = Hash.new
29
+ hash.merge!(response_header: @response_header.to_h) if @response_header
30
+ hash.merge!(transaction: @transaction.to_h) if @transaction
31
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
32
+ hash.merge!(payer: @payer.to_h) if @payer
33
+ hash.merge!(dcc: @dcc.to_h) if @dcc
34
+ hash
35
+ end
36
+ alias_method :to_h, :to_hash
37
+
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,33 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class MultipartCaptureResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :capture_id,
7
+ :status,
8
+ :date
9
+ )
10
+
11
+ def initialize(response_header: ,
12
+ capture_id: nil,
13
+ status: ,
14
+ date: )
15
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
16
+ @capture_id = capture_id
17
+ @status = status
18
+ @date = date
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!(capture_id: @capture_id) if @capture_id
25
+ hash.merge!(status: @status) if @status
26
+ hash.merge!(date: @date) if @date
27
+ hash
28
+ end
29
+ alias_method :to_h, :to_hash
30
+
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,38 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class QueryPaymentMeansResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :payment_means,
7
+ :payer,
8
+ :redirect_required,
9
+ :redirect_url
10
+ )
11
+
12
+ def initialize(response_header: ,
13
+ payment_means: ,
14
+ payer: nil,
15
+ redirect_required: ,
16
+ redirect_url:)
17
+
18
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
19
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
20
+ @payer = SixSaferpay::Payer.new(payer.to_h) if payer
21
+ @redirect_required = redirect_required
22
+ @redirect_url = redirect_url
23
+ end
24
+
25
+ def to_hash
26
+ hash = Hash.new
27
+ hash.merge!(response_header: @response_header.to_h) if @response_header
28
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
29
+ hash.merge!(payer: @payer.to_h) if @payer
30
+ hash.merge!(redirect_required: @redirect_required) if !@redirect_required.nil?
31
+ hash.merge!(redirect_url: @redirect_url) if @redirect_url
32
+ hash
33
+ end
34
+ alias_method :to_h, :to_hash
35
+
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,34 @@
1
+ module SixSaferpay
2
+ module SixTransaction
3
+ class RefundResponse
4
+
5
+ attr_accessor(:response_header,
6
+ :transaction,
7
+ :payment_means,
8
+ :dcc
9
+ )
10
+
11
+ def initialize(response_header: ,
12
+ transaction:,
13
+ payment_means: ,
14
+ dcc: nil)
15
+
16
+ @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
17
+ @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
18
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
19
+ @dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
20
+ end
21
+
22
+ def to_hash
23
+ hash = Hash.new
24
+ hash.merge!(response_header: @response_header.to_h) if @response_header
25
+ hash.merge!(transaction: @transaction.to_h) if @transaction
26
+ hash.merge!(payment_means: @payment_means.to_h) if @payment_means
27
+ hash.merge!(dcc: @dcc.to_h) if @dcc
28
+ hash
29
+ end
30
+ alias_method :to_h, :to_hash
31
+
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,33 @@
1
+ module SixSaferpay
2
+ class CaptureReference
3
+
4
+ attr_accessor(:capture_id,
5
+ :transaction_id,
6
+ :order_id,
7
+ :order_part_id
8
+ )
9
+
10
+ def initialize(capture_id: nil,
11
+ transaction_id: nil,
12
+ order_id: nil,
13
+ order_part_id: nil
14
+ )
15
+ @capture_id = capture_id
16
+ @transaction_id = transaction_id
17
+ @order_id = order_id
18
+ @order_part_id = order_part_id
19
+
20
+ end
21
+
22
+ def to_hash
23
+ hash = Hash.new
24
+ hash.merge!(capture_id: @capture_id) if @capture_id
25
+ hash.merge!(transaction_id: @transaction_id) if @transaction_id
26
+ hash.merge!(order_id: @order_id) if @order_id
27
+ hash.merge!(order_part_id: @order_part_id) if @order_part_id
28
+ hash
29
+ end
30
+ alias_method :to_h, :to_hash
31
+
32
+ end
33
+ end
@@ -0,0 +1,27 @@
1
+ module SixSaferpay
2
+ class Refund
3
+
4
+ attr_accessor(:amount,
5
+ :order_id,
6
+ :description
7
+ )
8
+
9
+ def initialize(amount:,
10
+ order_id: nil,
11
+ description: nil)
12
+ @amount = SixSaferpay::Amount.new(amount.to_h) if amount
13
+ @order_id = order_id
14
+ @description = description
15
+ end
16
+
17
+ def to_hash
18
+ hash = Hash.new
19
+ hash.merge!(amount: @amount.to_h) if @amount
20
+ hash.merge!(order_id: @order_id) if @order_id
21
+ hash.merge!(description: @description) if @description
22
+ hash
23
+ end
24
+ alias_method :to_h, :to_hash
25
+ end
26
+
27
+ end
@@ -1,3 +1,3 @@
1
1
  module SixSaferpay
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six_saferpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Langenegger
@@ -213,14 +213,28 @@ files:
213
213
  - lib/six_saferpay/api/six_payment_page/requests/initialize.rb
214
214
  - lib/six_saferpay/api/six_payment_page/responses/assert_response.rb
215
215
  - lib/six_saferpay/api/six_payment_page/responses/initalize_response.rb
216
+ - lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb
217
+ - lib/six_saferpay/api/six_transaction/requests/assert_refund.rb
216
218
  - lib/six_saferpay/api/six_transaction/requests/authorize.rb
219
+ - lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb
220
+ - lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb
217
221
  - lib/six_saferpay/api/six_transaction/requests/cancel.rb
218
222
  - lib/six_saferpay/api/six_transaction/requests/capture.rb
219
223
  - lib/six_saferpay/api/six_transaction/requests/initialize.rb
224
+ - lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb
225
+ - lib/six_saferpay/api/six_transaction/requests/query_payment_means.rb
226
+ - lib/six_saferpay/api/six_transaction/requests/refund.rb
227
+ - lib/six_saferpay/api/six_transaction/responses/adjust_amount_response.rb
228
+ - lib/six_saferpay/api/six_transaction/responses/assert_refund_response.rb
229
+ - lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb
220
230
  - lib/six_saferpay/api/six_transaction/responses/authorize_response.rb
231
+ - lib/six_saferpay/api/six_transaction/responses/authorized_referenced_response.rb
221
232
  - lib/six_saferpay/api/six_transaction/responses/cancel_response.rb
222
233
  - lib/six_saferpay/api/six_transaction/responses/capture_response.rb
223
234
  - lib/six_saferpay/api/six_transaction/responses/initialize_response.rb
235
+ - lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb
236
+ - lib/six_saferpay/api/six_transaction/responses/query_payment_means_response.rb
237
+ - lib/six_saferpay/api/six_transaction/responses/refund_response.rb
224
238
  - lib/six_saferpay/client.rb
225
239
  - lib/six_saferpay/errors/error.rb
226
240
  - lib/six_saferpay/models/address.rb
@@ -232,6 +246,7 @@ files:
232
246
  - lib/six_saferpay/models/billing_address_form.rb
233
247
  - lib/six_saferpay/models/billpay.rb
234
248
  - lib/six_saferpay/models/brand.rb
249
+ - lib/six_saferpay/models/capture_reference.rb
235
250
  - lib/six_saferpay/models/card_form.rb
236
251
  - lib/six_saferpay/models/client_info.rb
237
252
  - lib/six_saferpay/models/dcc.rb
@@ -257,6 +272,7 @@ files:
257
272
  - lib/six_saferpay/models/pending_notification.rb
258
273
  - lib/six_saferpay/models/recurring.rb
259
274
  - lib/six_saferpay/models/redirect.rb
275
+ - lib/six_saferpay/models/refund.rb
260
276
  - lib/six_saferpay/models/register_alias.rb
261
277
  - lib/six_saferpay/models/registration_alias.rb
262
278
  - lib/six_saferpay/models/registration_error.rb