mastercard_merchant_checkout 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
  SHA1:
3
- metadata.gz: 27bbe228d523693b4108b56ea63ff0dc4fd02772
4
- data.tar.gz: e5bb3b93176a29f51303de61dc0a2487a8c0269c
3
+ metadata.gz: dab63f207cbed513649f21f961ba0725a323b0f7
4
+ data.tar.gz: febc89187d29f3e41fd31b37035f9904185c24af
5
5
  SHA512:
6
- metadata.gz: a4868a2b3b844b7b8edc95ef40749c2b4ba3e2c27276b18becbd5f8dc3105a56f2eff8591b0e7c0a148ed45cf4fc2a6c932d5424dee58cbed8b290c57650df19
7
- data.tar.gz: 491ba2af42fd52ad8115e46c83769a5d5fcc786c559683be9f3183547135ce6ee3ef810edbfb19e4cd2fb86cd7e72d46d03dd27060a51c2b477132dba025db85
6
+ metadata.gz: 4ecf26a20f6ed61ee95827814ba32dd43bcdeb30c1a451c223664d91a8d655f07fc26b5e8bea3e9022bcf527067adb4f7711e3eefd0417413d4f8a140b187eb2
7
+ data.tar.gz: 0907968c68683b8d4d240fa45a8becb7d56f9d7dc2e246ce6b712217c716f2d25c2b0e3de36c2b91fa7e4dfc389b0a86b502c23f61d8ab8b424cf385f21dcef0
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017, MasterCard International Incorporated
1
+ Copyright (c) 2018, Mastercard International Incorporated
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are
data/README.md CHANGED
@@ -7,14 +7,6 @@
7
7
  From a cardholder's perspective, Masterpass significantly speeds up the checkout process, removing the need
8
8
  to re-enter payment, shipping or loyalty program details during checkout.
9
9
  The Masterpass solution is simple, secure and easy for merchants to integrate into their existing website or application.
10
-
11
- For more information, refer [Masterpass Merchant Integration](https://developer.mastercard.com/documentation/masterpass-merchant-integration).
12
-
13
- ## Features
14
-
15
- Simplified merchant checkout flow with new Masterpass checkout API services.
16
-
17
- Supports Masterpass Standard and Express checkout.
18
10
 
19
11
  ## Installation
20
12
 
@@ -32,23 +24,11 @@ Or install it yourself as:
32
24
 
33
25
  $ gem install mastercard_merchant_checkout
34
26
 
35
- ## Usage
36
- Set configurations for Consumer Key & Private Key from [Mastercard's developer's site](https://developer.mastercard.com/) to call Mastercard's checkout APIs:
37
-
38
- ```
39
- require 'mastercard_core_sdk'
40
- require 'mastercard_merchant_checkout'
41
-
42
- MasterCardApiConfiguration.consumer_key = <Consumer Key>
43
- MasterCardApiConfiguration.private_key = OpenSSL::PKCS12.new(File.open(<Path to P12 file>), <Password>).key
44
- MasterCardApiConfiguration.sandbox = false #By default Sandbox environment is set to true, Set sandbox to false to use Production environment.
45
- ```
46
-
47
27
  ## Copyright
48
- Copyright (c) 2017, Mastercard International Incorporated. See LICENSE for details.
28
+ Copyright (c) 2018, Mastercard International Incorporated. See LICENSE for details.
49
29
 
50
30
  ## LICENSE
51
- Copyright (c) 2017, Mastercard International Incorporated. All rights reserved.
31
+ Copyright (c) 2018, Mastercard International Incorporated. All rights reserved.
52
32
 
53
33
  Redistribution and use in source and binary forms, with or without modification, are
54
34
  permitted provided that the following conditions are met:
@@ -34,10 +34,14 @@ require_relative 'mastercard_merchant_checkout/models/shipping_address'
34
34
 
35
35
  require_relative 'mastercard_merchant_checkout/models/pre_checkout_card'
36
36
 
37
+ require_relative 'mastercard_merchant_checkout/models/encrypted_payment_data_response'
38
+
37
39
 
38
40
  # APIs
39
41
 
40
42
 
43
+ require_relative 'mastercard_merchant_checkout/api/encrypted_payment_data_api'
44
+
41
45
  require_relative 'mastercard_merchant_checkout/api/pre_checkout_data_api'
42
46
 
43
47
  require_relative 'mastercard_merchant_checkout/api/express_checkout_api'
@@ -0,0 +1,40 @@
1
+ require 'uri'
2
+ require 'mastercard_core_sdk'
3
+ require_relative '../../mastercard_merchant_checkout/models/encrypted_payment_data_response'
4
+
5
+
6
+ module MastercardMerchantCheckout
7
+ module Api
8
+
9
+ class EncryptedPaymentDataApi
10
+ include MastercardCoreSdk::Core, MastercardCoreSdk::Client, MastercardCoreSdk::Exceptions
11
+ include MastercardMerchantCheckout::Tracker
12
+
13
+
14
+ # EncryptedPaymentData Service
15
+ # Use this service to retrieve the encrypted consumer's payment card, and shipping details from Masterpass. API URL: /masterpass/encrypted-paymentdata/transaction_id
16
+ # @param transaction_id Identifies the transaction for which to return the consumer’s payment data. This is the oauth_verifier value sent by Masterpass in the callback URL after the Masterpass UI is closed.
17
+ # @param query_params The query parameters.
18
+ # @param api_config Optional ApiConfig object specifying configuration : consumer key, private key, host URL.
19
+ # @return [EncryptedPaymentDataResponse]
20
+ def self.show(transaction_id, query_params, api_config = nil)
21
+ path = "/masterpass/encrypted-paymentdata/{transactionId}"
22
+ service_request = ServiceRequest.new
23
+ service_request.path_params["transactionId"] = transaction_id
24
+
25
+
26
+ service_request.query_params = query_params
27
+ service_request.content_type = "application/json"
28
+ api_client = ApiClient.new(api_config)
29
+ api_client.api_tracker = SdkApiTracker.new
30
+ api_client.error_handler = ErrorHandler.new
31
+ return api_client.call(path, service_request, "GET",EncryptedPaymentDataResponse)
32
+ end
33
+
34
+ end
35
+
36
+ end
37
+ end
38
+
39
+
40
+
@@ -13,7 +13,8 @@ module MastercardMerchantCheckout
13
13
 
14
14
 
15
15
  # ExpressCheckout Service
16
- # Use this service to retrieve the consumer's full payment card, shipping address, and recipient personal information from Masterpass when performing an Express Checkout. If the merchant is PCI-compliant, then this API will return the complete payload. If the merchant is not PCI-compliant, then this API will only return non-PCI data. In both cases, a new pairingId will be returned to the merchant. API URL: /masterpass/expresscheckout
16
+ # Use this service to retrieve the consumer's full payment card, shipping address, and recipient personal information from Masterpass when performing an Express Checkout.
17
+ # If the merchant is PCI-compliant, then this API will return the complete payload. If the merchant is not PCI-compliant, then this API will only return non-PCI data. In both cases, a new pairingId will be returned to the merchant. API URL: /masterpass/expresscheckout
17
18
  # @param express_checkout_request Express Checkout Request.
18
19
  # @param api_config Optional ApiConfig object specifying configuration : consumer key, private key, host URL.
19
20
  # @return [PaymentData]
@@ -12,7 +12,7 @@ module MastercardMerchantCheckout
12
12
 
13
13
 
14
14
  # PaymentData Service
15
- # Use this service to retrieve the consumer's payment card, and shipping details from Masterpass. New or existing Brazil merchants looking for the house number and street name as separate fields should leverage these two additional extension points in their Masterpass checkout integration. Line 4 will provide the house number and line 5 will provide the street name. Brazil merchants should first look for data in lines 4 and 5, and in the case that no data is found there, merchants should then look for data in line 1. API URL: /masterpass/paymentdata/:transaction_id
15
+ # Use this service to retrieve the consumer's payment card, and shipping details from Masterpass. New or existing Brazil merchants looking for the house number and street name as separate fields should leverage these two additional extension points in their Masterpass checkout integration. Line 4 will provide the house number and line 5 will provide the street name. Brazil merchants should first look for data in lines 4 and 5, and in the case that no data is found there, merchants should then look for data in line 1. API URL: /masterpass/paymentdata/transaction_id
16
16
  # @param transaction_id Identifies the transaction for which to return the consumer’s payment data. This is the oauth_verifier value sent by Masterpass in the callback URL after the Masterpass UI is closed.
17
17
  # @param query_params The query parameters.
18
18
  # @param api_config Optional ApiConfig object specifying configuration : consumer key, private key, host URL.
@@ -12,7 +12,7 @@ module MastercardMerchantCheckout
12
12
 
13
13
 
14
14
  # PreCheckout Data Service
15
- # Use the consumer’s pairingID to retrieve their shipping and payment information prior to complete an Express Checkout. You can use the data returned from this service to confirm the user’s payment selections before completing the checkout. API URL: /masterpass/precheckoutdata/:pairing_id
15
+ # Use the consumer’s pairingID to retrieve their shipping and payment information prior to complete an Express Checkout. You can use the data returned from this service to confirm the user’s payment selections before completing the checkout. API URL: /masterpass/precheckoutdata/pairing_id
16
16
  # @param pairing_id The unique pairing token identifier used to fetch pre-checkout data for a wallet that is paired with a merchant.
17
17
  # @param api_config Optional ApiConfig object specifying configuration : consumer key, private key, host URL.
18
18
  # @return [PreCheckoutData]
@@ -19,7 +19,7 @@ module MastercardMerchantCheckout
19
19
  xml_accessor :brand_name, :from =>"brandName"
20
20
 
21
21
  # @!attribute account_number
22
- # @return [String] the card number, also known as Primary Account Number (PAN)
22
+ # @return [String] the card number, also known as Primary Account Number (PAN).
23
23
  xml_accessor :account_number, :from =>"accountNumber"
24
24
 
25
25
  # @!attribute card_holder_name
@@ -27,11 +27,11 @@ module MastercardMerchantCheckout
27
27
  xml_accessor :card_holder_name, :from =>"cardHolderName"
28
28
 
29
29
  # @!attribute expiry_month
30
- # @return [Integer] the PAN expiration month, returned as a two-digit string.
30
+ # @return [Integer] the PAN expiration month, returned as a one or two digit integer. No leading zero is required for single digit months e.g. April is 4.
31
31
  xml_accessor :expiry_month, :from =>"expiryMonth"
32
32
 
33
33
  # @!attribute expiry_year
34
- # @return [Integer] the PAN expiration year, returned as a two-digit string (for the year 2020, Masterpass will return 20).
34
+ # @return [Integer] the PAN expiration year, returned as a four digit integer.
35
35
  xml_accessor :expiry_year, :from =>"expiryYear"
36
36
 
37
37
  # @!attribute billing_address
@@ -42,6 +42,10 @@ module MastercardMerchantCheckout
42
42
  # @return [String] the last four digits of the PAN.
43
43
  xml_accessor :last_four, :from =>"lastFour"
44
44
 
45
+ # @!attribute card_type
46
+ # @return [String] the card type (CREDIT/DEBIT) used in checkout. Available only for combo card transactions.
47
+ xml_accessor :card_type, :from =>"cardType"
48
+
45
49
 
46
50
  # Attribute mapping from ruby-style variable name to JSON key.
47
51
  def self.attribute_map
@@ -53,7 +57,8 @@ module MastercardMerchantCheckout
53
57
  :expiry_month => :expiryMonth ,
54
58
  :expiry_year => :expiryYear ,
55
59
  :billing_address => :billingAddress ,
56
- :last_four => :lastFour
60
+ :last_four => :lastFour ,
61
+ :card_type => :cardType
57
62
 
58
63
  }
59
64
  end
@@ -97,6 +102,10 @@ module MastercardMerchantCheckout
97
102
  self.last_four = attributes[:last_four]
98
103
  end
99
104
 
105
+ if attributes.has_key?(:card_type)
106
+ self.card_type = attributes[:card_type]
107
+ end
108
+
100
109
  end
101
110
 
102
111
 
@@ -113,7 +122,8 @@ module MastercardMerchantCheckout
113
122
  expiry_month == o.expiry_month &&
114
123
  expiry_year == o.expiry_year &&
115
124
  billing_address == o.billing_address &&
116
- last_four == o.last_four
125
+ last_four == o.last_four &&
126
+ card_type == o.card_type
117
127
  end
118
128
 
119
129
  # @see the `==` method
@@ -123,7 +133,7 @@ module MastercardMerchantCheckout
123
133
 
124
134
  # Calculate hash code according to all attributes.
125
135
  def hash
126
- [brand_id, brand_name, account_number, card_holder_name, expiry_month, expiry_year, billing_address, last_four].hash
136
+ [brand_id, brand_name, account_number, card_holder_name, expiry_month, expiry_year, billing_address, last_four, card_type].hash
127
137
  end
128
138
 
129
139
  # build the object from hash
@@ -235,7 +245,8 @@ module MastercardMerchantCheckout
235
245
  :expiry_month => 'Integer',
236
246
  :expiry_year => 'Integer',
237
247
  :billing_address => 'Address',
238
- :last_four => 'String'
248
+ :last_four => 'String',
249
+ :card_type => 'String'
239
250
 
240
251
  }
241
252
  end
@@ -0,0 +1,167 @@
1
+ require 'date'
2
+ require 'roxml'
3
+
4
+
5
+ module MastercardMerchantCheckout
6
+ # This class contains paymentData response parameters returned by EncryptedPaymentDataApi.
7
+ class EncryptedPaymentDataResponse
8
+ include ROXML
9
+
10
+ xml_name "EncryptedPaymentDataResponse"
11
+
12
+ # @!attribute encrypted_payment_data
13
+ # @return [String] the encrypted payment details.
14
+ xml_accessor :encrypted_payment_data, :from =>"encryptedPaymentData"
15
+
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :encrypted_payment_data => :encryptedPaymentData
21
+
22
+ }
23
+ end
24
+
25
+ def initialize(attributes = {})
26
+ return unless attributes.is_a?(Hash)
27
+
28
+ # convert string to symbol for hash key
29
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
30
+
31
+
32
+ if attributes.has_key?(:encrypted_payment_data)
33
+ self.encrypted_payment_data = attributes[:encrypted_payment_data]
34
+ end
35
+
36
+ end
37
+
38
+
39
+
40
+
41
+ # Check equality by comparing each attribute.
42
+ def ==(o)
43
+ return true if self.equal?(o)
44
+ self.class == o.class &&
45
+ encrypted_payment_data == o.encrypted_payment_data
46
+ end
47
+
48
+ # @see the `==` method
49
+ def eql?(o)
50
+ self == o
51
+ end
52
+
53
+ # Calculate hash code according to all attributes.
54
+ def hash
55
+ [encrypted_payment_data].hash
56
+ end
57
+
58
+ # build the object from hash
59
+ def build_from_hash(attributes)
60
+ return nil unless attributes.is_a?(Hash)
61
+ self.class.datatype_map.each_pair do |key, type|
62
+ if type =~ /^Array<(.*)>/i
63
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
64
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
65
+ else
66
+ #TODO show warning in debug mode
67
+ end
68
+ elsif !attributes[self.class.attribute_map[key]].nil?
69
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
70
+ else
71
+ # data not found in attributes(hash), not an issue as the data can be optional
72
+ end
73
+ end
74
+
75
+ self
76
+ end
77
+
78
+ def _deserialize(type, value)
79
+ case type.to_sym
80
+ when :DateTime
81
+ DateTime.parse(value)
82
+ when :Date
83
+ Date.parse(value)
84
+ when :String
85
+ value.to_s
86
+ when :Integer
87
+ value.to_i
88
+ when :Float
89
+ value.to_f
90
+ when :BOOLEAN
91
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
92
+ true
93
+ else
94
+ false
95
+ end
96
+ when /\AArray<(?<inner_type>.+)>\z/
97
+ inner_type = Regexp.last_match[:inner_type]
98
+ value.map { |v| _deserialize(inner_type, v) }
99
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
100
+ k_type = Regexp.last_match[:k_type]
101
+ v_type = Regexp.last_match[:v_type]
102
+ {}.tap do |hash|
103
+ value.each do |k, v|
104
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
105
+ end
106
+ end
107
+ else # model
108
+ _model = MastercardMerchantCheckout.const_get(type).new
109
+ _model.build_from_hash(value)
110
+ end
111
+ end
112
+
113
+ def to_s
114
+ to_hash.to_s
115
+ end
116
+
117
+ # to_body is an alias to to_body (backward compatibility))
118
+ def to_body
119
+ to_hash
120
+ end
121
+
122
+ # return the object in the form of hash
123
+ def to_hash(include_root = false)
124
+ attributes_hash = {}
125
+ hash = {}
126
+ self.class.attribute_map.each_pair do |attr, param|
127
+ value = self.send(attr)
128
+ next if value.nil?
129
+ hash[param] = _to_hash(value)
130
+ end
131
+ attributes_hash = include_root ? { "EncryptedPaymentDataResponse" => hash } : hash
132
+ return attributes_hash
133
+ end
134
+
135
+ # Method to output non-array value in the form of hash
136
+ # For object, use to_hash. Otherwise, just return the value
137
+ def _to_hash(value)
138
+ if value.is_a?(Array)
139
+ value.compact.map{ |v| _to_hash(v) }
140
+ elsif value.is_a?(Hash)
141
+ {}.tap do |hash|
142
+ value.each { |k, v| hash[k] = _to_hash(v) }
143
+ end
144
+ elsif value.respond_to? :to_hash
145
+ value.to_hash
146
+ else
147
+ value
148
+ end
149
+ end
150
+
151
+
152
+ private
153
+ def after_parse
154
+ self.send(:remove_instance_variable, :@roxml_references) if defined? self.roxml_references
155
+ end
156
+
157
+ # Attribute datatype mapping.
158
+ def self.datatype_map
159
+ {
160
+ :encrypted_payment_data => 'String'
161
+
162
+ }
163
+ end
164
+ end
165
+
166
+
167
+ end
@@ -22,7 +22,7 @@ module MastercardMerchantCheckout
22
22
  xml_accessor :pre_checkout_transaction_id, :from =>"preCheckoutTransactionId"
23
23
 
24
24
  # @!attribute amount
25
- # @return [Float] the transaction amount.
25
+ # @return [Float] the transaction amount as a decimal (100.50 for $100.50).
26
26
  xml_accessor :amount, :from =>"amount"
27
27
 
28
28
  # @!attribute currency
@@ -41,6 +41,10 @@ module MastercardMerchantCheckout
41
41
  # @return [BOOLEAN] the flag to indicate digital goods are being purchased so a shipping address is not required for the transaction.
42
42
  xml_accessor :digital_goods, :from =>"digitalGoods"
43
43
 
44
+ # @!attribute psp_id
45
+ # @return [String] the pspId passed by merchant to select PSP for pushing payment data.
46
+ xml_accessor :psp_id, :from =>"pspId"
47
+
44
48
 
45
49
  # Attribute mapping from ruby-style variable name to JSON key.
46
50
  def self.attribute_map
@@ -52,7 +56,8 @@ module MastercardMerchantCheckout
52
56
  :currency => :currency ,
53
57
  :card_id => :cardId ,
54
58
  :shipping_address_id => :shippingAddressId ,
55
- :digital_goods => :digitalGoods
59
+ :digital_goods => :digitalGoods ,
60
+ :psp_id => :pspId
56
61
 
57
62
  }
58
63
  end
@@ -96,6 +101,10 @@ module MastercardMerchantCheckout
96
101
  self.digital_goods = attributes[:digital_goods]
97
102
  end
98
103
 
104
+ if attributes.has_key?(:psp_id)
105
+ self.psp_id = attributes[:psp_id]
106
+ end
107
+
99
108
  end
100
109
 
101
110
 
@@ -112,7 +121,8 @@ module MastercardMerchantCheckout
112
121
  currency == o.currency &&
113
122
  card_id == o.card_id &&
114
123
  shipping_address_id == o.shipping_address_id &&
115
- digital_goods == o.digital_goods
124
+ digital_goods == o.digital_goods &&
125
+ psp_id == o.psp_id
116
126
  end
117
127
 
118
128
  # @see the `==` method
@@ -122,7 +132,7 @@ module MastercardMerchantCheckout
122
132
 
123
133
  # Calculate hash code according to all attributes.
124
134
  def hash
125
- [checkout_id, pairing_id, pre_checkout_transaction_id, amount, currency, card_id, shipping_address_id, digital_goods].hash
135
+ [checkout_id, pairing_id, pre_checkout_transaction_id, amount, currency, card_id, shipping_address_id, digital_goods, psp_id].hash
126
136
  end
127
137
 
128
138
  # build the object from hash
@@ -234,7 +244,8 @@ module MastercardMerchantCheckout
234
244
  :currency => 'String',
235
245
  :card_id => 'String',
236
246
  :shipping_address_id => 'String',
237
- :digital_goods => 'BOOLEAN'
247
+ :digital_goods => 'BOOLEAN',
248
+ :psp_id => 'String'
238
249
 
239
250
  }
240
251
  end
@@ -46,6 +46,10 @@ module MastercardMerchantCheckout
46
46
  # @return [String] the new pairingId.
47
47
  xml_accessor :pairing_id, :from =>"pairingId"
48
48
 
49
+ # @!attribute psp_transaction_id
50
+ # @return [String] the new pspTransactionId.
51
+ xml_accessor :psp_transaction_id, :from =>"pspTransactionId"
52
+
49
53
 
50
54
  # Attribute mapping from ruby-style variable name to JSON key.
51
55
  def self.attribute_map
@@ -57,7 +61,8 @@ module MastercardMerchantCheckout
57
61
  :wallet_id => :walletId ,
58
62
  :wallet_name => :walletName ,
59
63
  :authentication_options => :authenticationOptions ,
60
- :pairing_id => :pairingId
64
+ :pairing_id => :pairingId ,
65
+ :psp_transaction_id => :pspTransactionId
61
66
 
62
67
  }
63
68
  end
@@ -101,6 +106,10 @@ module MastercardMerchantCheckout
101
106
  self.pairing_id = attributes[:pairing_id]
102
107
  end
103
108
 
109
+ if attributes.has_key?(:psp_transaction_id)
110
+ self.psp_transaction_id = attributes[:psp_transaction_id]
111
+ end
112
+
104
113
  end
105
114
 
106
115
 
@@ -117,7 +126,8 @@ module MastercardMerchantCheckout
117
126
  wallet_id == o.wallet_id &&
118
127
  wallet_name == o.wallet_name &&
119
128
  authentication_options == o.authentication_options &&
120
- pairing_id == o.pairing_id
129
+ pairing_id == o.pairing_id &&
130
+ psp_transaction_id == o.psp_transaction_id
121
131
  end
122
132
 
123
133
  # @see the `==` method
@@ -127,7 +137,7 @@ module MastercardMerchantCheckout
127
137
 
128
138
  # Calculate hash code according to all attributes.
129
139
  def hash
130
- [card, shipping_address, personal_info, tokenization, wallet_id, wallet_name, authentication_options, pairing_id].hash
140
+ [card, shipping_address, personal_info, tokenization, wallet_id, wallet_name, authentication_options, pairing_id, psp_transaction_id].hash
131
141
  end
132
142
 
133
143
  # build the object from hash
@@ -239,7 +249,8 @@ module MastercardMerchantCheckout
239
249
  :wallet_id => 'String',
240
250
  :wallet_name => 'String',
241
251
  :authentication_options => 'AuthenticationOptions',
242
- :pairing_id => 'String'
252
+ :pairing_id => 'String',
253
+ :psp_transaction_id => 'String'
243
254
 
244
255
  }
245
256
  end
@@ -21,13 +21,18 @@ module MastercardMerchantCheckout
21
21
  # @return [String] the recipient's email address.
22
22
  xml_accessor :recipient_email_address, :from =>"recipientEmailAddress"
23
23
 
24
+ # @!attribute national_id
25
+ # @return [String] the recipient's nationalId.
26
+ xml_accessor :national_id, :from =>"nationalId"
27
+
24
28
 
25
29
  # Attribute mapping from ruby-style variable name to JSON key.
26
30
  def self.attribute_map
27
31
  {
28
32
  :recipient_name => :recipientName ,
29
33
  :recipient_phone => :recipientPhone ,
30
- :recipient_email_address => :recipientEmailAddress
34
+ :recipient_email_address => :recipientEmailAddress ,
35
+ :national_id => :nationalId
31
36
 
32
37
  }
33
38
  end
@@ -51,6 +56,10 @@ module MastercardMerchantCheckout
51
56
  self.recipient_email_address = attributes[:recipient_email_address]
52
57
  end
53
58
 
59
+ if attributes.has_key?(:national_id)
60
+ self.national_id = attributes[:national_id]
61
+ end
62
+
54
63
  end
55
64
 
56
65
 
@@ -62,7 +71,8 @@ module MastercardMerchantCheckout
62
71
  self.class == o.class &&
63
72
  recipient_name == o.recipient_name &&
64
73
  recipient_phone == o.recipient_phone &&
65
- recipient_email_address == o.recipient_email_address
74
+ recipient_email_address == o.recipient_email_address &&
75
+ national_id == o.national_id
66
76
  end
67
77
 
68
78
  # @see the `==` method
@@ -72,7 +82,7 @@ module MastercardMerchantCheckout
72
82
 
73
83
  # Calculate hash code according to all attributes.
74
84
  def hash
75
- [recipient_name, recipient_phone, recipient_email_address].hash
85
+ [recipient_name, recipient_phone, recipient_email_address, national_id].hash
76
86
  end
77
87
 
78
88
  # build the object from hash
@@ -179,7 +189,8 @@ module MastercardMerchantCheckout
179
189
  {
180
190
  :recipient_name => 'String',
181
191
  :recipient_phone => 'String',
182
- :recipient_email_address => 'String'
192
+ :recipient_email_address => 'String',
193
+ :national_id => 'String'
183
194
 
184
195
  }
185
196
  end
@@ -18,7 +18,7 @@ module MastercardMerchantCheckout
18
18
  xml_accessor :currency, :from =>"currency"
19
19
 
20
20
  # @!attribute amount
21
- # @return [Float] the transaction amount as an integer (10050 for $100.50).
21
+ # @return [Float] the transaction amount as a decimal (100.50 for $100.50).
22
22
  xml_accessor :amount, :from =>"amount"
23
23
 
24
24
  # @!attribute payment_successful
@@ -26,11 +26,11 @@ module MastercardMerchantCheckout
26
26
  xml_accessor :default, :from =>"default"
27
27
 
28
28
  # @!attribute expiry_year
29
- # @return [Integer] the PAN expiration year, returned as a two-digit string (for the year 2020, Masterpass will return 20).
29
+ # @return [Integer] the PAN expiration year, returned as a four digit integer.
30
30
  xml_accessor :expiry_year, :from =>"expiryYear"
31
31
 
32
32
  # @!attribute expiry_month
33
- # @return [Integer] the PAN expiration month, returned as a two-digit string.
33
+ # @return [Integer] the PAN expiration month, returned as a one or two digit integer. No leading zero is required for single digit months e.g. April is 4.
34
34
  xml_accessor :expiry_month, :from =>"expiryMonth"
35
35
 
36
36
  # @!attribute last_four
@@ -2,7 +2,7 @@ require 'mastercard_core_sdk'
2
2
 
3
3
  module MastercardMerchantCheckout
4
4
  module Tracker
5
- # Provides tracking API information and user-agent information.
5
+ # Provides tracking api information and user-agent information.
6
6
  class SdkApiTracker
7
7
  include MastercardCoreSdk, MastercardCoreSdk::Core, MastercardCoreSdk::Tracker::ApiTracker
8
8
 
@@ -1,3 +1,3 @@
1
1
  module MastercardMerchantCheckout
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mastercard_merchant_checkout
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
  - Mastercard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-05 00:00:00.000000000 Z
11
+ date: 2018-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mastercard_core_sdk
@@ -124,9 +124,8 @@ dependencies:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '5.0'
127
- description: Mastercard Masterpass Merchant Checkout SDK. See https://developer.mastercard.com/documentation/masterpass-merchant-integration
127
+ description: Mastercard Masterpass Merchant Checkout Integration SDK.
128
128
  email:
129
- - support@masterpass.com
130
129
  - merchant_support@masterpass.com
131
130
  executables: []
132
131
  extensions: []
@@ -137,6 +136,7 @@ files:
137
136
  - LICENSE.txt
138
137
  - README.md
139
138
  - lib/mastercard_merchant_checkout.rb
139
+ - lib/mastercard_merchant_checkout/api/encrypted_payment_data_api.rb
140
140
  - lib/mastercard_merchant_checkout/api/express_checkout_api.rb
141
141
  - lib/mastercard_merchant_checkout/api/pairing_id_api.rb
142
142
  - lib/mastercard_merchant_checkout/api/payment_data_api.rb
@@ -147,6 +147,7 @@ files:
147
147
  - lib/mastercard_merchant_checkout/models/card.rb
148
148
  - lib/mastercard_merchant_checkout/models/contact_info.rb
149
149
  - lib/mastercard_merchant_checkout/models/cryptogram.rb
150
+ - lib/mastercard_merchant_checkout/models/encrypted_payment_data_response.rb
150
151
  - lib/mastercard_merchant_checkout/models/express_checkout_request.rb
151
152
  - lib/mastercard_merchant_checkout/models/pairing.rb
152
153
  - lib/mastercard_merchant_checkout/models/payment_data.rb
@@ -159,7 +160,7 @@ files:
159
160
  - lib/mastercard_merchant_checkout/models/tokenization.rb
160
161
  - lib/mastercard_merchant_checkout/tracker/sdk_api_tracker.rb
161
162
  - lib/mastercard_merchant_checkout/version.rb
162
- homepage: https://developer.mastercard.com/documentation/masterpass-merchant-integration
163
+ homepage: https://developer.mastercard.com/documentation/masterpass-merchant-integration-v7/7
163
164
  licenses:
164
165
  - Mastercard
165
166
  metadata: {}