connect-sdk-ruby 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f4268a4082684a120a81e66f4e9e44574811deac0902eaf521e96ff3207bcc1
4
- data.tar.gz: 748d2f68aaa10ada9a3458c2e0a96ce1a6c4612148be53085f77cfab3b112695
3
+ metadata.gz: f3d339efa2a7b867cf13cd958fb07b3ae79e80399d90e121b9cf88d02ba8828b
4
+ data.tar.gz: 39dcf66c702e29a9c70679e2e43fca6b4dcb87e2363d719148aa6612a213892a
5
5
  SHA512:
6
- metadata.gz: 2028c956fee0b36ddc2ed9cb8a941fd341a17effd11520f5dfa990fc3d5d217596a473d3378ee25f2f8e2e6336a4233df85b24ec8500da37ae2f325821c0a3b4
7
- data.tar.gz: 65379df87b193cd17bd9bf2a6d7a13626b1ed0fb83eddfef3e03c6c7541e000fd846e8e61096b2f17fb9e2eeeffa725094a3d60faae1704e9f39f774ffb9234a
6
+ metadata.gz: a660d75e164a129d273a87f2ef029e3eac7d801db9c8cdcae0227751f76dd2bc9859ee4d3b0309cff438abb0248b8dedba65cea27a7cf4d5df39497f61f0b8f0
7
+ data.tar.gz: 2fd8fb68f5b8028f5baefec7ae4a9000bdd489011ba07d138a685a0f2bd12a056973a7a0b109f285947d5b343726f140336add4d823739610a4730a7a2774978
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '2.1.0'
3
+ spec.version = '2.2.0'
4
4
  spec.authors = ['Ingenico ePayments']
5
5
  spec.email = ['github@epay.ingenico.com']
6
6
  spec.summary = %q{SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API}
@@ -17,7 +17,7 @@ Mandates = Ingenico::Connect::SDK::Domain::Mandates
17
17
  def example
18
18
  get_client do |client|
19
19
  bank_account_iban = Definitions::BankAccountIban.new
20
- bank_account_iban.iban = 'DE46940594210000012345'
20
+ bank_account_iban.iban = 'DE46720200700359736690'
21
21
 
22
22
  contact_details = Mandates::MandateContactDetails.new
23
23
  contact_details.email_address = 'wile.e.coyote@acmelabs.com'
@@ -17,7 +17,7 @@ Mandates = Ingenico::Connect::SDK::Domain::Mandates
17
17
  def example
18
18
  get_client do |client|
19
19
  bank_account_iban = Definitions::BankAccountIban.new
20
- bank_account_iban.iban = 'DE46940594210000012345'
20
+ bank_account_iban.iban = 'DE46720200700359736690'
21
21
 
22
22
  contact_details = Mandates::MandateContactDetails.new
23
23
  contact_details.email_address = 'wile.e.coyote@acmelabs.com'
@@ -10,11 +10,12 @@ require 'ingenico/connect/sdk/domain/definitions/amount_of_money'
10
10
  require 'ingenico/connect/sdk/domain/definitions/card'
11
11
  require 'ingenico/connect/sdk/domain/definitions/company_information'
12
12
  require 'ingenico/connect/sdk/domain/payment/address_personal'
13
+ require 'ingenico/connect/sdk/domain/payment/browser_data'
13
14
  require 'ingenico/connect/sdk/domain/payment/card_payment_method_specific_input'
14
15
  require 'ingenico/connect/sdk/domain/payment/contact_details'
15
16
  require 'ingenico/connect/sdk/domain/payment/create_payment_request'
16
17
  require 'ingenico/connect/sdk/domain/payment/customer'
17
- require 'ingenico/connect/sdk/domain/payment/external_cardholder_authentication_data'
18
+ require 'ingenico/connect/sdk/domain/payment/customer_device'
18
19
  require 'ingenico/connect/sdk/domain/payment/line_item'
19
20
  require 'ingenico/connect/sdk/domain/payment/line_item_invoice_data'
20
21
  require 'ingenico/connect/sdk/domain/payment/order'
@@ -22,10 +23,10 @@ require 'ingenico/connect/sdk/domain/payment/order_invoice_data'
22
23
  require 'ingenico/connect/sdk/domain/payment/order_references'
23
24
  require 'ingenico/connect/sdk/domain/payment/personal_information'
24
25
  require 'ingenico/connect/sdk/domain/payment/personal_name'
26
+ require 'ingenico/connect/sdk/domain/payment/redirection_data'
25
27
  require 'ingenico/connect/sdk/domain/payment/shipping'
26
28
  require 'ingenico/connect/sdk/domain/payment/shopping_cart'
27
29
  require 'ingenico/connect/sdk/domain/payment/three_d_secure'
28
- require 'ingenico/connect/sdk/domain/payment/three_d_secure_data'
29
30
 
30
31
  Definitions = Ingenico::Connect::SDK::Domain::Definitions
31
32
  Payment = Ingenico::Connect::SDK::Domain::Payment
@@ -38,32 +39,22 @@ def example
38
39
  card.cvv = '123'
39
40
  card.expiry_date = '1220'
40
41
 
41
- external_cardholder_authentication_data = Payment::ExternalCardholderAuthenticationData.new
42
- external_cardholder_authentication_data.cavv = 'AgAAAAAABk4DWZ4C28yUQAAAAAA='
43
- external_cardholder_authentication_data.cavv_algorithm = '1'
44
- external_cardholder_authentication_data.eci = 8
45
- external_cardholder_authentication_data.three_d_secure_version = 'v2'
46
- external_cardholder_authentication_data.three_d_server_transaction_id = '3DSTID1234'
47
- external_cardholder_authentication_data.validation_result = 'Y'
48
- external_cardholder_authentication_data.xid = 'n3h2uOQPUgnmqhCkXNfxl8pOZJA='
49
-
50
- prior_three_d_secure_data = Payment::ThreeDSecureData.new
51
- prior_three_d_secure_data.acs_transaction_id = 'empty'
52
- prior_three_d_secure_data.method = 'challenged'
53
- prior_three_d_secure_data.utc_timestamp = '201901311530'
42
+ redirection_data = Payment::RedirectionData.new
43
+ redirection_data.return_url = 'https://hostname.myownwebsite.url'
54
44
 
55
45
  three_d_secure = Payment::ThreeDSecure.new
56
46
  three_d_secure.authentication_flow = 'browser'
57
47
  three_d_secure.challenge_canvas_size = '600x400'
58
48
  three_d_secure.challenge_indicator = 'challenge-requested'
59
- three_d_secure.external_cardholder_authentication_data = external_cardholder_authentication_data
60
- three_d_secure.prior_three_d_secure_data = prior_three_d_secure_data
49
+ three_d_secure.redirection_data = redirection_data
61
50
  three_d_secure.skip_authentication = false
62
51
 
63
52
  card_payment_method_specific_input = Payment::CardPaymentMethodSpecificInput.new
64
53
  card_payment_method_specific_input.card = card
54
+ card_payment_method_specific_input.is_recurring = false
65
55
  card_payment_method_specific_input.payment_product_id = 1
66
56
  card_payment_method_specific_input.three_d_secure = three_d_secure
57
+ card_payment_method_specific_input.transaction_channel = 'ECOMMERCE'
67
58
 
68
59
  amount_of_money = Definitions::AmountOfMoney.new
69
60
  amount_of_money.amount = 2980
@@ -84,10 +75,23 @@ def example
84
75
 
85
76
  contact_details = Payment::ContactDetails.new
86
77
  contact_details.email_address = 'wile.e.coyote@acmelabs.com'
87
- contact_details.email_message_type = 'html'
88
78
  contact_details.fax_number = '+1234567891'
89
79
  contact_details.phone_number = '+1234567890'
90
80
 
81
+ browser_data = Payment::BrowserData.new
82
+ browser_data.color_depth = 24
83
+ browser_data.java_enabled = false
84
+ browser_data.screen_height = '1200'
85
+ browser_data.screen_width = '1920'
86
+
87
+ device = Payment::CustomerDevice.new
88
+ device.accept_header = 'texthtml,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
89
+ device.browser_data = browser_data
90
+ device.ip_address = '123.123.123.123'
91
+ device.locale = 'en-US'
92
+ device.timezone_offset_utc_minutes = '420'
93
+ device.user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15'
94
+
91
95
  name = Payment::PersonalName.new
92
96
  name.first_name = 'Wile'
93
97
  name.surname = 'Coyote'
@@ -100,9 +104,11 @@ def example
100
104
  personal_information.name = name
101
105
 
102
106
  customer = Payment::Customer.new
107
+ customer.account_type = 'none'
103
108
  customer.billing_address = billing_address
104
109
  customer.company_information = company_information
105
110
  customer.contact_details = contact_details
111
+ customer.device = device
106
112
  customer.locale = 'en_US'
107
113
  customer.merchant_customer_id = '1234'
108
114
  customer.personal_information = personal_information
@@ -18,6 +18,7 @@ module Ingenico::Connect::SDK
18
18
  module Capture
19
19
 
20
20
  # @attr [Integer] amount_paid
21
+ # @attr [Integer] amount_reversed
21
22
  # @attr [Ingenico::Connect::SDK::Domain::Payment::BankTransferPaymentMethodSpecificOutput] bank_transfer_payment_method_specific_output
22
23
  # @attr [Ingenico::Connect::SDK::Domain::Payment::CardPaymentMethodSpecificOutput] card_payment_method_specific_output
23
24
  # @attr [Ingenico::Connect::SDK::Domain::Payment::CashPaymentMethodSpecificOutput] cash_payment_method_specific_output
@@ -32,6 +33,8 @@ module Ingenico::Connect::SDK
32
33
 
33
34
  attr_accessor :amount_paid
34
35
 
36
+ attr_accessor :amount_reversed
37
+
35
38
  attr_accessor :bank_transfer_payment_method_specific_output
36
39
 
37
40
  attr_accessor :card_payment_method_specific_output
@@ -56,6 +59,7 @@ module Ingenico::Connect::SDK
56
59
  def to_h
57
60
  hash = super
58
61
  hash['amountPaid'] = @amount_paid unless @amount_paid.nil?
62
+ hash['amountReversed'] = @amount_reversed unless @amount_reversed.nil?
59
63
  hash['bankTransferPaymentMethodSpecificOutput'] = @bank_transfer_payment_method_specific_output.to_h unless @bank_transfer_payment_method_specific_output.nil?
60
64
  hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h unless @card_payment_method_specific_output.nil?
61
65
  hash['cashPaymentMethodSpecificOutput'] = @cash_payment_method_specific_output.to_h unless @cash_payment_method_specific_output.nil?
@@ -74,6 +78,9 @@ module Ingenico::Connect::SDK
74
78
  if hash.has_key? 'amountPaid'
75
79
  @amount_paid = hash['amountPaid']
76
80
  end
81
+ if hash.has_key? 'amountReversed'
82
+ @amount_reversed = hash['amountReversed']
83
+ end
77
84
  if hash.has_key? 'bankTransferPaymentMethodSpecificOutput'
78
85
  raise TypeError, "value '%s' is not a Hash" % [hash['bankTransferPaymentMethodSpecificOutput']] unless hash['bankTransferPaymentMethodSpecificOutput'].is_a? Hash
79
86
  @bank_transfer_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::BankTransferPaymentMethodSpecificOutput.new_from_hash(hash['bankTransferPaymentMethodSpecificOutput'])
@@ -18,6 +18,7 @@ module Ingenico::Connect::SDK
18
18
  module Payment
19
19
 
20
20
  # @attr [Integer] amount_paid
21
+ # @attr [Integer] amount_reversed
21
22
  # @attr [Ingenico::Connect::SDK::Domain::Payment::BankTransferPaymentMethodSpecificOutput] bank_transfer_payment_method_specific_output
22
23
  # @attr [Ingenico::Connect::SDK::Domain::Payment::CardPaymentMethodSpecificOutput] card_payment_method_specific_output
23
24
  # @attr [Ingenico::Connect::SDK::Domain::Payment::CashPaymentMethodSpecificOutput] cash_payment_method_specific_output
@@ -32,6 +33,8 @@ module Ingenico::Connect::SDK
32
33
 
33
34
  attr_accessor :amount_paid
34
35
 
36
+ attr_accessor :amount_reversed
37
+
35
38
  attr_accessor :bank_transfer_payment_method_specific_output
36
39
 
37
40
  attr_accessor :card_payment_method_specific_output
@@ -56,6 +59,7 @@ module Ingenico::Connect::SDK
56
59
  def to_h
57
60
  hash = super
58
61
  hash['amountPaid'] = @amount_paid unless @amount_paid.nil?
62
+ hash['amountReversed'] = @amount_reversed unless @amount_reversed.nil?
59
63
  hash['bankTransferPaymentMethodSpecificOutput'] = @bank_transfer_payment_method_specific_output.to_h unless @bank_transfer_payment_method_specific_output.nil?
60
64
  hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h unless @card_payment_method_specific_output.nil?
61
65
  hash['cashPaymentMethodSpecificOutput'] = @cash_payment_method_specific_output.to_h unless @cash_payment_method_specific_output.nil?
@@ -74,6 +78,9 @@ module Ingenico::Connect::SDK
74
78
  if hash.has_key? 'amountPaid'
75
79
  @amount_paid = hash['amountPaid']
76
80
  end
81
+ if hash.has_key? 'amountReversed'
82
+ @amount_reversed = hash['amountReversed']
83
+ end
77
84
  if hash.has_key? 'bankTransferPaymentMethodSpecificOutput'
78
85
  raise TypeError, "value '%s' is not a Hash" % [hash['bankTransferPaymentMethodSpecificOutput']] unless hash['bankTransferPaymentMethodSpecificOutput'].is_a? Hash
79
86
  @bank_transfer_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::BankTransferPaymentMethodSpecificOutput.new_from_hash(hash['bankTransferPaymentMethodSpecificOutput'])
@@ -7,7 +7,7 @@ module Ingenico::Connect::SDK
7
7
  #
8
8
  # @attr_reader [Array<Ingenico::Connect::SDK::RequestHeader>] meta_data_headers List of headers that should be used in all requests.
9
9
  class MetaDataProvider
10
- @@SDK_VERSION = '2.1.0'
10
+ @@SDK_VERSION = '2.2.0'
11
11
  @@SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo'
12
12
  @@PROHIBITED_HEADERS = [@@SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key',
13
13
  'Date', 'Content-Type', 'Authorization'].sort!.freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connect-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ingenico ePayments
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-04 00:00:00.000000000 Z
11
+ date: 2019-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient