braintree 4.13.0 → 4.14.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: 44371fa440317aa474b358a279682d0e79ad05565d4b1f583dabb77c237a5d34
4
- data.tar.gz: 8487685b45da286097e7f366ca1b26820f89da15008a1f6555409e1c2605f61a
3
+ metadata.gz: 4b00fbf3fe7587ce0788471b730caa3db11f9b574a0077d83e03a9c0aef54e01
4
+ data.tar.gz: 3dd4395b7ca564f1ac454a290451c9716953b9297ad3b9101d7d6e07f3cc1972
5
5
  SHA512:
6
- metadata.gz: '0584f71fb953b0b73071bb368481873e3948fb55a3de2cc91b8d2c443aaf2544b739534d4283e6d50ad85d532eb3cfe2126338eebb92359c74f19185f55ceaf9'
7
- data.tar.gz: 2d98c343dd94fdb128fdc09bd1e1688e12b82f0055b9666869c9f88c5fe74d9accf736f8ec3876e8d6ef6965874a3a8618a8bbe63df0e5146e30d2c7d723956e
6
+ metadata.gz: 665d8cef94dfe888f82c1b50c65bad773f5c6b4600937118b37cdc68f92b47150c148d6c0c45130e8e867f7507f13929975f3357ac769c8b9e982f1d7988cab6
7
+ data.tar.gz: 3555eb3944bf02f23912d17c323250d7112722f09bd825b7e6a5571fa44470d52800a7e92d4d738e6ab8f69c6a2fb98adddf626139b4ec78d39679beea0fee86
@@ -0,0 +1,36 @@
1
+ module Braintree
2
+ class Transaction
3
+ class PaymentReceipt
4
+ class CardPresentData
5
+ include BaseModule
6
+
7
+ attr_reader :application_cryptogram
8
+ attr_reader :application_identifier
9
+ attr_reader :application_interchange_profile
10
+ attr_reader :application_name
11
+ attr_reader :application_transaction_counter
12
+ attr_reader :application_usage_control
13
+ attr_reader :authorization_mode
14
+ attr_reader :authorization_response_code
15
+ attr_reader :card_entry_method
16
+ attr_reader :card_sequence_number
17
+ attr_reader :cardholder_verification_method_results
18
+ attr_reader :cashback_amount
19
+ attr_reader :cryptogram_information_data
20
+ attr_reader :issuer_action_code_default
21
+ attr_reader :issuer_action_code_denial
22
+ attr_reader :issuer_action_code_online
23
+ attr_reader :issuer_authentication_data
24
+ attr_reader :terminal_country_code
25
+ attr_reader :terminal_transaction_date
26
+ attr_reader :terminal_transaction_type
27
+ attr_reader :terminal_verification_result
28
+ attr_reader :unpredictable_number
29
+
30
+ def initialize(attributes)
31
+ set_instance_variables_from_hash attributes unless attributes.nil?
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,19 @@
1
+ module Braintree
2
+ class Transaction
3
+ class PaymentReceipt
4
+ class MerchantAddress
5
+ include BaseModule
6
+
7
+ attr_reader :locality
8
+ attr_reader :phone
9
+ attr_reader :postal_code
10
+ attr_reader :region
11
+ attr_reader :street_address
12
+
13
+ def initialize(attributes)
14
+ set_instance_variables_from_hash attributes unless attributes.nil?
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,31 @@
1
+ module Braintree
2
+ class Transaction
3
+ class PaymentReceipt
4
+ include BaseModule
5
+
6
+ attr_reader :account_balance
7
+ attr_reader :amount
8
+ attr_reader :card_last_4
9
+ attr_reader :card_present_data
10
+ attr_reader :card_type
11
+ attr_reader :currency_iso_code
12
+ attr_reader :global_id
13
+ attr_reader :id
14
+ attr_reader :merchant_address
15
+ attr_reader :merchant_identification_number
16
+ attr_reader :merchant_name
17
+ attr_reader :pin_verified
18
+ attr_reader :processor_authorization_code
19
+ attr_reader :processor_response_code
20
+ attr_reader :processor_response_text
21
+ attr_reader :terminal_identification_number
22
+ attr_reader :type
23
+
24
+ def initialize(attributes)
25
+ set_instance_variables_from_hash attributes unless attributes.nil?
26
+ @card_present_data = CardPresentData.new(attributes[:card_present_date]) if attributes[:card_present_data]
27
+ @merchant_address = MerchantAddress.new(attributes[:merchant_address]) if attributes[:merchant_address]
28
+ end
29
+ end
30
+ end
31
+ end
@@ -7,6 +7,7 @@ module Braintree
7
7
  attr_reader :account_type
8
8
  attr_reader :ach_mandate
9
9
  attr_reader :bank_name
10
+ attr_reader :global_id
10
11
  attr_reader :image_url
11
12
  attr_reader :last_4
12
13
  attr_reader :routing_number
@@ -136,6 +136,7 @@ module Braintree
136
136
  attr_reader :order_id
137
137
  attr_reader :partial_settlement_transaction_ids
138
138
  attr_reader :payment_instrument_type
139
+ attr_reader :payment_receipt
139
140
  attr_reader :paypal_details
140
141
  attr_reader :paypal_here_details
141
142
  attr_reader :plan_id
@@ -312,6 +313,7 @@ module Braintree
312
313
  @google_pay_details = GooglePayDetails.new(@google_pay_card)
313
314
  @local_payment_details = LocalPaymentDetails.new(@local_payment)
314
315
  @payment_instrument_type = attributes[:payment_instrument_type]
316
+ @payment_receipt = PaymentReceipt.new(attributes[:payment_receipt]) if attributes[:payment_receipt]
315
317
  @paypal_details = PayPalDetails.new(@paypal)
316
318
  @paypal_here_details = PayPalHereDetails.new(@paypal_here)
317
319
  @samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card])
@@ -1,7 +1,7 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 4
4
- Minor = 13
4
+ Minor = 14
5
5
  Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
data/lib/braintree.rb CHANGED
@@ -150,6 +150,9 @@ require "braintree/transaction/disbursement_details"
150
150
  require "braintree/transaction/google_pay_details"
151
151
  require "braintree/transaction/installment"
152
152
  require "braintree/transaction/installment/adjustment"
153
+ require "braintree/transaction/payment_receipt"
154
+ require "braintree/transaction/payment_receipt/card_present_data.rb"
155
+ require "braintree/transaction/payment_receipt/merchant_address.rb"
153
156
  require "braintree/transaction/paypal_details"
154
157
  require "braintree/transaction/paypal_here_details"
155
158
  require "braintree/transaction/samsung_pay_card_details"
@@ -7175,7 +7175,8 @@ describe Braintree::Transaction do
7175
7175
  :payment_method_token => "network_tokenized_credit_card",
7176
7176
  )
7177
7177
  transaction = result.transaction
7178
- transaction.retried.should == nil
7178
+
7179
+ expect(transaction.retried).to be_falsey
7179
7180
  end
7180
7181
 
7181
7182
  it "creates a transaction that is ineligible for retries" do
@@ -7188,7 +7189,8 @@ describe Braintree::Transaction do
7188
7189
  :amount => Braintree::Test::TransactionAmounts::Authorize,
7189
7190
  )
7190
7191
  transaction = result.transaction
7191
- transaction.retried.should == nil
7192
+
7193
+ expect(transaction.retried).to be_falsey
7192
7194
  end
7193
7195
  end
7194
7196
 
@@ -0,0 +1,73 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
2
+
3
+ describe Braintree::Transaction::PaymentReceipt do
4
+ describe "inspect" do
5
+ it "assigns all fields" do
6
+ details = Braintree::Transaction::PaymentReceipt.new(
7
+ :account_balance => "2.00",
8
+ :amount => "10.00",
9
+ :card_last_4 => "1111",
10
+ :card_present_data => {
11
+ :application_cryptogram => "application-cryptogram",
12
+ :application_identifier => "application-id",
13
+ :application_interchange_profile => "application-interchange",
14
+ :application_name => "application-name",
15
+ :application_transaction_counter => "application-transaction-counter",
16
+ :application_usage_control => "application-usage-control",
17
+ :authorization_mode => "Issuer",
18
+ :authorization_response_code => "auth-response-code",
19
+ :card_entry_method => "card-entry-method",
20
+ :card_sequence_number => "card-sequence-number",
21
+ :cardholder_verification_method_results => "cardholder-verification-method-results",
22
+ :cashback_amount => "20.00",
23
+ :cryptogram_information_data => "cryptogram-information-data",
24
+ :issuer_action_code_default => "issuer-action-code-default",
25
+ :issuer_action_code_denial => "issuer-action-code-denial",
26
+ :issuer_action_code_online => "issuer-action-code-online",
27
+ :issuer_authentication_data => "issuer-authentication-data",
28
+ :terminal_country_code => "USA",
29
+ :terminal_transaction_date => "2023-04-03",
30
+ :terminal_transaction_type => "terminal-transaction-type",
31
+ :terminal_verification_result => "terminal-verification-result",
32
+ :unpredictable_number => "unpredictable-number",
33
+ },
34
+ :card_type => "VISA",
35
+ :currency_iso_code => "USD",
36
+ :global_id => "global-id",
37
+ :id => "id",
38
+ :merchant_address => {
39
+ :locality => "Chicago",
40
+ :phone => "7708675309",
41
+ :postal_code => "60652",
42
+ :region => "IL",
43
+ :street_address => "123 Sesame St",
44
+ },
45
+ :merchant_identification_number => "merchant-id-number",
46
+ :merchant_name => "merchant-name",
47
+ :pin_verified => true,
48
+ :processor_authorization_code => "processor-auth-code",
49
+ :processor_response_code => "processor-response-code",
50
+ :processor_response_text => "processor-response-text",
51
+ :terminal_identification_number => "terminal-id",
52
+ :type => "sale",
53
+ )
54
+
55
+ expect(details.account_balance).to eq("2.00")
56
+ expect(details.amount).to eq("10.00")
57
+ expect(details.card_last_4).to eq("1111")
58
+ expect(details.card_present_data).to eq({application_cryptogram: "application-cryptogram", application_identifier: "application-id", application_interchange_profile: "application-interchange", application_name: "application-name", application_transaction_counter: "application-transaction-counter", application_usage_control: "application-usage-control", authorization_mode: "Issuer", authorization_response_code: "auth-response-code", card_entry_method: "card-entry-method", card_sequence_number: "card-sequence-number", cardholder_verification_method_results: "cardholder-verification-method-results", cashback_amount: "20.00", cryptogram_information_data: "cryptogram-information-data", issuer_action_code_default: "issuer-action-code-default", issuer_action_code_denial: "issuer-action-code-denial", issuer_action_code_online: "issuer-action-code-online", issuer_authentication_data: "issuer-authentication-data", terminal_country_code: "USA", terminal_transaction_date: "2023-04-03", terminal_transaction_type: "terminal-transaction-type", terminal_verification_result: "terminal-verification-result", unpredictable_number: "unpredictable-number"})
59
+ expect(details.card_type).to eq("VISA")
60
+ expect(details.currency_iso_code).to eq("USD")
61
+ expect(details.global_id).to eq("global-id")
62
+ expect(details.id).to eq("id")
63
+ expect(details.merchant_address).to eq({locality: "Chicago", phone: "7708675309", postal_code: "60652", region: "IL", street_address: "123 Sesame St"})
64
+ expect(details.merchant_identification_number).to eq("merchant-id-number")
65
+ expect(details.merchant_name).to eq("merchant-name")
66
+ expect(details.pin_verified).to be_truthy
67
+ expect(details.processor_authorization_code).to be("processor-auth-code")
68
+ expect(details.processor_response_text).to be("processor-response-text")
69
+ expect(details.terminal_identification_number).to be("terminal-id")
70
+ expect(details.type).to be("sale")
71
+ end
72
+ end
73
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.13.0
4
+ version: 4.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Braintree
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-29 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -177,6 +177,9 @@ files:
177
177
  - lib/braintree/transaction/installment.rb
178
178
  - lib/braintree/transaction/installment/adjustment.rb
179
179
  - lib/braintree/transaction/local_payment_details.rb
180
+ - lib/braintree/transaction/payment_receipt.rb
181
+ - lib/braintree/transaction/payment_receipt/card_present_data.rb
182
+ - lib/braintree/transaction/payment_receipt/merchant_address.rb
180
183
  - lib/braintree/transaction/paypal_details.rb
181
184
  - lib/braintree/transaction/paypal_here_details.rb
182
185
  - lib/braintree/transaction/samsung_pay_card_details.rb
@@ -321,6 +324,7 @@ files:
321
324
  - spec/unit/braintree/transaction/customer_details_spec.rb
322
325
  - spec/unit/braintree/transaction/deposit_details_spec.rb
323
326
  - spec/unit/braintree/transaction/installment_spec.rb
327
+ - spec/unit/braintree/transaction/payment_receipt_spec.rb
324
328
  - spec/unit/braintree/transaction/paypal_details_spec.rb
325
329
  - spec/unit/braintree/transaction/sepa_direct_debit_account_details_spec.rb
326
330
  - spec/unit/braintree/transaction_gateway_spec.rb