braintree 2.80.1 → 2.81.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +7 -0
  2. data/lib/braintree.rb +4 -1
  3. data/lib/braintree/account_updater_daily_report.rb +1 -1
  4. data/lib/braintree/ach_mandate.rb +2 -1
  5. data/lib/braintree/address.rb +16 -3
  6. data/lib/braintree/amex_express_checkout_card.rb +14 -2
  7. data/lib/braintree/android_pay_card.rb +16 -3
  8. data/lib/braintree/apple_pay_card.rb +15 -3
  9. data/lib/braintree/bin_data.rb +9 -2
  10. data/lib/braintree/coinbase_account.rb +10 -1
  11. data/lib/braintree/connected_merchant_paypal_status_changed.rb +3 -1
  12. data/lib/braintree/connected_merchant_status_transitioned.rb +3 -1
  13. data/lib/braintree/credentials_parser.rb +5 -1
  14. data/lib/braintree/credit_card.rb +25 -10
  15. data/lib/braintree/credit_card_verification.rb +32 -14
  16. data/lib/braintree/customer.rb +24 -11
  17. data/lib/braintree/descriptor.rb +3 -1
  18. data/lib/braintree/disbursement.rb +9 -1
  19. data/lib/braintree/dispute.rb +1 -6
  20. data/lib/braintree/dispute/transaction_details.rb +2 -1
  21. data/lib/braintree/document_upload.rb +6 -7
  22. data/lib/braintree/error_codes.rb +30 -0
  23. data/lib/braintree/error_result.rb +8 -1
  24. data/lib/braintree/europe_bank_account.rb +3 -1
  25. data/lib/braintree/facilitated_details.rb +3 -1
  26. data/lib/braintree/facilitator_details.rb +2 -1
  27. data/lib/braintree/gateway.rb +4 -0
  28. data/lib/braintree/granted_payment_instrument_update.rb +5 -1
  29. data/lib/braintree/ideal_payment.rb +15 -2
  30. data/lib/braintree/masterpass_card.rb +26 -11
  31. data/lib/braintree/merchant.rb +8 -1
  32. data/lib/braintree/merchant_account.rb +8 -3
  33. data/lib/braintree/merchant_account/address_details.rb +4 -1
  34. data/lib/braintree/merchant_account/business_details.rb +4 -1
  35. data/lib/braintree/merchant_account/funding_details.rb +6 -1
  36. data/lib/braintree/merchant_account/individual_details.rb +7 -2
  37. data/lib/braintree/oauth_credentials.rb +4 -1
  38. data/lib/braintree/paginated_result.rb +3 -1
  39. data/lib/braintree/payment_method_nonce.rb +5 -1
  40. data/lib/braintree/paypal_account.rb +8 -1
  41. data/lib/braintree/plan.rb +4 -4
  42. data/lib/braintree/risk_data.rb +3 -1
  43. data/lib/braintree/settlement_batch_summary.rb +1 -0
  44. data/lib/braintree/subscription.rb +27 -17
  45. data/lib/braintree/subscription/status_details.rb +8 -1
  46. data/lib/braintree/successful_result.rb +19 -1
  47. data/lib/braintree/three_d_secure_info.rb +5 -1
  48. data/lib/braintree/transaction.rb +54 -48
  49. data/lib/braintree/transaction/address_details.rb +13 -4
  50. data/lib/braintree/transaction/amex_express_checkout_details.rb +9 -2
  51. data/lib/braintree/transaction/android_pay_details.rb +10 -3
  52. data/lib/braintree/transaction/apple_pay_details.rb +7 -2
  53. data/lib/braintree/transaction/coinbase_details.rb +4 -1
  54. data/lib/braintree/transaction/credit_card_details.rb +40 -6
  55. data/lib/braintree/transaction/customer_details.rb +8 -1
  56. data/lib/braintree/transaction/disbursement_details.rb +5 -1
  57. data/lib/braintree/transaction/ideal_payment_details.rb +5 -1
  58. data/lib/braintree/transaction/masterpass_card_details.rb +18 -4
  59. data/lib/braintree/transaction/paypal_details.rb +18 -4
  60. data/lib/braintree/transaction/status_details.rb +5 -1
  61. data/lib/braintree/transaction/subscription_details.rb +2 -1
  62. data/lib/braintree/transaction/us_bank_account_details.rb +8 -1
  63. data/lib/braintree/transaction/venmo_account_details.rb +5 -1
  64. data/lib/braintree/transaction/visa_checkout_card_details.rb +19 -4
  65. data/lib/braintree/transaction_gateway.rb +1 -0
  66. data/lib/braintree/transaction_line_item.rb +34 -0
  67. data/lib/braintree/transaction_line_item_gateway.rb +19 -0
  68. data/lib/braintree/unknown_payment_method.rb +2 -1
  69. data/lib/braintree/us_bank_account.rb +9 -1
  70. data/lib/braintree/util.rb +14 -0
  71. data/lib/braintree/validation_error.rb +3 -1
  72. data/lib/braintree/venmo_account.rb +10 -3
  73. data/lib/braintree/version.rb +2 -2
  74. data/lib/braintree/visa_checkout_card.rb +27 -11
  75. data/lib/braintree/webhook_notification.rb +9 -9
  76. data/spec/httpsd.pid +1 -0
  77. data/spec/integration/braintree/apple_pay_spec.rb +2 -31
  78. data/spec/integration/braintree/http_spec.rb +1 -1
  79. data/spec/integration/braintree/transaction_spec.rb +1142 -0
  80. metadata +205 -207
  81. data/README.rdoc +0 -102
@@ -1,102 +0,0 @@
1
- = Braintree Ruby library
2
-
3
- The Braintree gem provides integration access to the Braintree Gateway.
4
-
5
- = Please Note
6
- <b>The Payment Card Industry (PCI) Council has {mandated}[http://blog.pcisecuritystandards.org/migrating-from-ssl-and-early-tls] that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, Braintree is updating its services to require TLS 1.2 for all HTTPS connections. Braintree will also require HTTP/1.1 for all connections. Please see our {technical documentation}[https://github.com/paypal/tls-update] for more information.</b>
7
-
8
- == Dependencies
9
-
10
- * builder
11
- * libxml-ruby
12
-
13
- == Installation
14
-
15
- gem install braintree
16
-
17
- Or add to your Gemfile:
18
-
19
- gem 'braintree'
20
-
21
- == Quick Start Example
22
-
23
- require "rubygems"
24
- require "braintree"
25
-
26
- Braintree::Configuration.environment = :sandbox
27
- Braintree::Configuration.merchant_id = "your_merchant_id"
28
- Braintree::Configuration.public_key = "your_public_key"
29
- Braintree::Configuration.private_key = "your_private_key"
30
-
31
- result = Braintree::Transaction.sale(
32
- :amount => "1000.00",
33
- :payment_method_nonce => nonce_from_the_client,
34
- :options => {
35
- :submit_for_settlement => true
36
- }
37
- )
38
-
39
- if result.success?
40
- puts "success!: #{result.transaction.id}"
41
- elsif result.transaction
42
- puts "Error processing transaction:"
43
- puts " code: #{result.transaction.processor_response_code}"
44
- puts " text: #{result.transaction.processor_response_text}"
45
- else
46
- p result.errors
47
- end
48
-
49
- You retrieve your <tt>merchant_id</tt>, <tt>public_key</tt>, and <tt>private_key</tt> when {signing up}[https://braintreepayments.com/get-started] for Braintree. Signing up for a sandbox account is easy, free, and instant.
50
-
51
- == Bang Methods
52
-
53
- Most methods have a bang and a non-bang version (e.g. <tt>Braintree::Customer.create</tt> and <tt>Braintree::Customer.create!</tt>).
54
- The non-bang version will either return a +SuccessfulResult+ or an +ErrorResult+. The bang version will either return
55
- the created or updated resource, or it will raise a ValidationsFailed exception.
56
-
57
- Example of using non-bang method:
58
-
59
- result = Braintree::Customer.create(:first_name => "Josh")
60
- if result.success?
61
- puts "Created customer #{result.customer.id}"
62
- else
63
- puts "Validations failed"
64
- result.errors.for(:customer).each do |error|
65
- puts error.message
66
- end
67
- end
68
-
69
- Example of using bang method:
70
-
71
- begin
72
- customer = Braintree::Customer.create!(:first_name => "Josh")
73
- puts "Created customer #{customer.id}"
74
- rescue Braintree::ValidationsFailed
75
- puts "Validations failed"
76
- end
77
-
78
- We recommend using the bang methods when you assume that the data is valid and do not expect validations to fail.
79
- Otherwise, we recommend using the non-bang methods.
80
-
81
- == More Information
82
-
83
- * Documentation[https://developers.braintreepayments.com/ruby/sdk/server/overview]
84
-
85
- == Tests
86
-
87
- The unit specs can be run by anyone on any system, but the integration specs are meant to be run against a local development
88
- server of our gateway code. These integration specs are not meant for public consumption and will likely fail if run on
89
- your system. To run unit tests use rake: <tt>rake test:unit</tt>.
90
-
91
- == Suppress Braintree Logs
92
-
93
- To suppress logs from Braintree on environments where they are considered noise
94
- (e.g. test) use the following configuration:
95
-
96
- logger = Logger.new("/dev/null")
97
- logger.level = Logger::INFO
98
- Braintree::Configuration.logger = logger
99
-
100
- == License
101
-
102
- See the LICENSE[https://github.com/braintree/braintree_ruby/blob/master/LICENSE] file for more info.