Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2.10.1

  • Loading branch information...
commit e2f9950aa6904f14c63742e9c0a76024e9187aec 1 parent 393be08
@braintreeps braintreeps authored
View
5 CHANGELOG.rdoc
@@ -1,3 +1,8 @@
+== 2.10.1
+
+* Support builder >= 2.0
+* Changed comments to point to new doc site
+
== 2.10.0
* Added subscription_details to Transaction
View
2  README.rdoc
@@ -67,7 +67,7 @@ Otherwise, we recommend using the non-bang methods.
== More Information
-* Documentation[http://www.braintreepaymentsolutions.com/docs/ruby]
+* Documentation[http://www.braintreepayments.com/docs/ruby]
== Tests
View
8 Rakefile
@@ -24,13 +24,13 @@ gem_spec = Gem::Specification.new do |s|
s.summary = "Braintree Gateway Ruby Client Library"
s.description = "Ruby library for integrating with the Braintree Gateway"
s.version = Braintree::Version::String
- s.author = "Braintree Payment Solutions"
- s.email = "devs@getbraintree.com"
- s.homepage = "http://www.braintreepaymentsolutions.com/gateway"
+ s.author = "Braintree"
+ s.email = "code@getbraintree.com"
+ s.homepage = "http://www.braintreepayments.com/"
s.rubyforge_project = "braintree"
s.has_rdoc = false
s.files = FileList["README.rdoc", "LICENSE", "{lib,spec}/**/*.rb", "lib/**/*.crt"]
- s.add_dependency "builder"
+ s.add_dependency "builder", ">= 2.0.0"
end
task :gem do
View
2  lib/braintree/address.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/addresses/details
+ # See http://www.braintreepayments.com/docs/ruby/addresses/details
class Address
include BaseModule # :nodoc:
View
2  lib/braintree/configuration.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby
+ # See http://www.braintreepayments.com/docs/ruby
class Configuration
API_VERSION = "2" # :nodoc:
View
48 lib/braintree/credit_card.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby
+ # See http://www.braintreepayments.com/docs/ruby
class CreditCard
include BaseModule # :nodoc:
@@ -29,83 +29,83 @@ module CustomerLocation
attr_reader :billing_address, :bin, :card_type, :cardholder_name, :created_at, :customer_id, :expiration_month,
:expiration_year, :last_4, :subscriptions, :token, :updated_at
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/create
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/create
def self.create(attributes)
Configuration.gateway.credit_card.create(attributes)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/create
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/create
def self.create!(attributes)
return_object_or_raise(:credit_card) { create(attributes) }
end
# Deprecated. Use Braintree::TransparentRedirect.url
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/create_tr
def self.create_credit_card_url
warn "[DEPRECATED] CreditCard.create_credit_card_url is deprecated. Please use TransparentRedirect.url"
Configuration.gateway.credit_card.create_credit_card_url
end
# Deprecated. Use Braintree::TransparentRedirect.confirm
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/create_tr
def self.create_from_transparent_redirect(query_string)
warn "[DEPRECATED] CreditCard.create_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
Configuration.gateway.credit_card.create_from_transparent_redirect(query_string)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def self.credit(token, transaction_attributes)
Transaction.credit(transaction_attributes.merge(:payment_method_token => token))
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def self.credit!(token, transaction_attributes)
return_object_or_raise(:transaction) { credit(token, transaction_attributes) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/delete
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/delete
def self.delete(token)
Configuration.gateway.credit_card.delete(token)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/search
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/search
def self.expired(options = {})
Configuration.gateway.credit_card.expired(options)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/search
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/search
def self.expiring_between(start_date, end_date, options = {})
Configuration.gateway.credit_card.expiring_between(start_date, end_date, options)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/search
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/search
def self.find(token)
Configuration.gateway.credit_card.find(token)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def self.sale(token, transaction_attributes)
Configuration.gateway.transaction.sale(transaction_attributes.merge(:payment_method_token => token))
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def self.sale!(token, transaction_attributes)
return_object_or_raise(:transaction) { sale(token, transaction_attributes) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/update
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/update
def self.update(token, attributes)
Configuration.gateway.credit_card.update(token, attributes)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/update
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/update
def self.update!(token, attributes)
return_object_or_raise(:credit_card) { update(token, attributes) }
end
# Deprecated. Use Braintree::TransparentRedirect.confirm
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/update_tr
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/update_tr
def self.update_from_transparent_redirect(query_string)
warn "[DEPRECATED] CreditCard.update_via_transparent_redirect_request is deprecated. Please use TransparentRedirect.confirm"
Configuration.gateway.credit_card.update_from_transparent_redirect(query_string)
@@ -113,7 +113,7 @@ def self.update_from_transparent_redirect(query_string)
# Deprecated. Use Braintree::TransparentRedirect.url
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/update_tr
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/update_tr
def self.update_credit_card_url
warn "[DEPRECATED] CreditCard.update_credit_card_url is deprecated. Please use TransparentRedirect.url"
Configuration.gateway.credit_card.update_credit_card_url
@@ -128,7 +128,7 @@ def initialize(gateway, attributes) # :nodoc:
# Deprecated. Use Braintree::CreditCard.credit
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def credit(transaction_attributes)
warn "[DEPRECATED] credit as an instance method is deprecated. Please use CreditCard.credit"
@gateway.transaction.credit(transaction_attributes.merge(:payment_method_token => token))
@@ -136,7 +136,7 @@ def credit(transaction_attributes)
# Deprecated. Use Braintree::CreditCard.credit!
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def credit!(transaction_attributes)
warn "[DEPRECATED] credit! as an instance method is deprecated. Please use CreditCard.credit!"
return_object_or_raise(:transaction) { credit(transaction_attributes) }
@@ -144,7 +144,7 @@ def credit!(transaction_attributes)
# Deprecated. Use Braintree::CreditCard.delete
#
- # http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/delete
+ # http://www.braintreepayments.com/docs/ruby/credit_cards/delete
def delete
warn "[DEPRECATED] delete as an instance method is deprecated. Please use CreditCard.delete"
@gateway.credit_card.delete(token)
@@ -180,7 +180,7 @@ def masked_number
# Deprecated. Use Braintree::CreditCard.sale
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def sale(transaction_attributes)
warn "[DEPRECATED] sale as an instance method is deprecated. Please use CreditCard.sale"
@gateway.transaction.sale(transaction_attributes.merge(:payment_method_token => token))
@@ -188,7 +188,7 @@ def sale(transaction_attributes)
# Deprecated. Use Braintree::CreditCard.sale!
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def sale!(transaction_attributes)
warn "[DEPRECATED] sale! as an instance method is deprecated. Please use CreditCard.sale!"
return_object_or_raise(:transaction) { sale(transaction_attributes) }
@@ -196,7 +196,7 @@ def sale!(transaction_attributes)
# Deprecated. Use Braintree::CreditCard.update
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/update
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/update
def update(attributes)
warn "[DEPRECATED] update as an instance method is deprecated. Please use CreditCard.update"
result = @gateway.credit_card.update(token, attributes)
@@ -208,7 +208,7 @@ def update(attributes)
# Deprecated. Use Braintree::CreditCard.update!
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/update
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/update
def update!(attributes)
warn "[DEPRECATED] update! as an instance method is deprecated. Please use CreditCard.update!"
return_object_or_raise(:credit_card) { update(attributes) }
View
2  lib/braintree/credit_card_verification.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/card_verification
+ # See http://www.braintreepayments.com/docs/ruby/general/card_verification
class CreditCardVerification
include BaseModule
View
48 lib/braintree/customer.rb
@@ -1,29 +1,29 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby
+ # See http://www.braintreepayments.com/docs/ruby
class Customer
include BaseModule
attr_reader :addresses, :company, :created_at, :credit_cards, :email, :fax, :first_name, :id, :last_name,
:phone, :updated_at, :website, :custom_fields
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/search
+ # See http://www.braintreepayments.com/docs/ruby/customers/search
def self.all
Configuration.gateway.customer.all
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/create
+ # See http://www.braintreepayments.com/docs/ruby/customers/create
def self.create(attributes = {})
Configuration.gateway.customer.create(attributes)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/create
+ # See http://www.braintreepayments.com/docs/ruby/customers/create
def self.create!(attributes = {})
return_object_or_raise(:customer) { create(attributes) }
end
# Deprecated. Use Braintree::TransparentRedirect.url
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/customers/create_tr
def self.create_customer_url
warn "[DEPRECATED] Customer.create_customer_url is deprecated. Please use TransparentRedirect.url"
Configuration.gateway.customer.create_customer_url
@@ -31,43 +31,43 @@ def self.create_customer_url
# Deprecated. Use Braintree::TransparentRedirect.confirm
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/customers/create_tr
def self.create_from_transparent_redirect(query_string)
warn "[DEPRECATED] Customer.create_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
Configuration.gateway.customer.create_from_transparent_redirect(query_string)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def self.credit(customer_id, transaction_attributes)
Transaction.credit(transaction_attributes.merge(:customer_id => customer_id))
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def self.credit!(customer_id, transaction_attributes)
return_object_or_raise(:transaction){ credit(customer_id, transaction_attributes) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/delete
+ # See http://www.braintreepayments.com/docs/ruby/customers/delete
def self.delete(customer_id)
Configuration.gateway.customer.delete(customer_id)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/search
+ # See http://www.braintreepayments.com/docs/ruby/customers/search
def self.find(customer_id)
Configuration.gateway.customer.find(customer_id)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def self.sale(customer_id, transaction_attributes)
Transaction.sale(transaction_attributes.merge(:customer_id => customer_id))
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def self.sale!(customer_id, transaction_attributes)
return_object_or_raise(:transaction) { sale(customer_id, transaction_attributes) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/search
+ # See http://www.braintreepayments.com/docs/ruby/customers/search
def self.search(&block)
Configuration.gateway.customer.search(&block)
end
@@ -77,19 +77,19 @@ def self.transactions(customer_id, options = {})
Configuration.gateway.customer.transactions(customer_id, options = {})
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/update
+ # See http://www.braintreepayments.com/docs/ruby/customers/update
def self.update(customer_id, attributes)
Configuration.gateway.customer.update(customer_id, attributes)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/update
+ # See http://www.braintreepayments.com/docs/ruby/customers/update
def self.update!(customer_id, attributes)
return_object_or_raise(:customer) { update(customer_id, attributes) }
end
# Deprecated. Use Braintree::TransparentRedirect.url
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/update_tr
+ # See http://www.braintreepayments.com/docs/ruby/customers/update_tr
def self.update_customer_url
warn "[DEPRECATED] Customer.update_customer_url is deprecated. Please use TransparentRedirect.url"
Configuration.gateway.customer.update_customer_url
@@ -97,7 +97,7 @@ def self.update_customer_url
# Deprecated. Use Braintree::TransparentRedirect.confirm
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/update_tr
+ # See http://www.braintreepayments.com/docs/ruby/customers/update_tr
def self.update_from_transparent_redirect(query_string)
warn "[DEPRECATED] Customer.update_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
Configuration.gateway.customer.update_from_transparent_redirect(query_string)
@@ -110,17 +110,17 @@ def initialize(gateway, attributes) # :nodoc:
@addresses = (@addresses || []).map { |addr| Address._new gateway, addr }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def credit(transaction_attributes)
@gateway.transaction.credit(transaction_attributes.merge(:customer_id => id))
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def credit!(transaction_attributes)
return_object_or_raise(:transaction) { credit(transaction_attributes) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/delete
+ # See http://www.braintreepayments.com/docs/ruby/customers/delete
def delete
@gateway.customer.delete(id)
end
@@ -137,7 +137,7 @@ def inspect # :nodoc:
# Deprecated. Use Braintree::Customer.sale
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def sale(transaction_attributes)
warn "[DEPRECATED] sale as an instance method is deprecated. Please use Customer.sale"
@gateway.transaction.sale(transaction_attributes.merge(:customer_id => id))
@@ -145,7 +145,7 @@ def sale(transaction_attributes)
# Deprecated. Use Braintree::Customer.sale!
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_from_vault
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_from_vault
def sale!(transaction_attributes)
warn "[DEPRECATED] sale! as an instance method is deprecated. Please use Customer.sale!"
return_object_or_raise(:transaction) { sale(transaction_attributes) }
@@ -158,7 +158,7 @@ def transactions(options = {})
# Deprecated. Use Braintree::Customer.update
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/update
+ # See http://www.braintreepayments.com/docs/ruby/customers/update
def update(attributes)
warn "[DEPRECATED] update as an instance method is deprecated. Please use Customer.update"
result = @gateway.customer.update(id, attributes)
@@ -170,7 +170,7 @@ def update(attributes)
# Deprecated. Use Braintree::Customer.update!
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/update
+ # See http://www.braintreepayments.com/docs/ruby/customers/update
def update!(attributes)
warn "[DEPRECATED] update! as an instance method is deprecated. Please use Customer.update!"
return_object_or_raise(:customer) { update(attributes) }
View
10 lib/braintree/error_codes.rb
@@ -3,7 +3,7 @@ module Braintree
# The constants should be used to check for a specific validation error in a ValidationErrorCollection.
# The error messages returned from the server may change, but the codes will remain the same.
module ErrorCodes
- # See http://www.braintreepaymentsolutions.com/docs/ruby/addresses/validations
+ # See http://www.braintreepayments.com/docs/ruby/addresses/validations
module Address
CannotBeBlank = "81801"
CompanyIsTooLong = "81802"
@@ -25,7 +25,7 @@ module Address
TooManyAddressesPerCustomer = "91818"
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/validations
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/validations
module CreditCard
BillingAddressConflict = "91701"
BillingAddressIdIsInvalid = "91702"
@@ -57,7 +57,7 @@ module Options
end
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/validations
+ # See http://www.braintreepayments.com/docs/ruby/customers/validations
module Customer
CompanyIsTooLong = "81601"
CustomFieldIsInvalid = "91602"
@@ -84,7 +84,7 @@ module Descriptor
NameFormatIsInvalid = "92201"
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/subscriptions/validations
+ # See http://www.braintreepayments.com/docs/ruby/subscriptions/validations
module Subscription
BillingDayOfMonthCannotBeUpdated = "91918"
BillingDayOfMonthIsInvalid = "91914"
@@ -142,7 +142,7 @@ module Modification
end
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/validations
+ # See http://www.braintreepayments.com/docs/ruby/transactions/validations
module Transaction
AmountCannotBeNegative = "81501"
AmountIsInvalid = "81503"
View
2  lib/braintree/error_result.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/result_objects
+ # See http://www.braintreepayments.com/docs/ruby/general/result_objects
class ErrorResult
attr_reader :credit_card_verification, :transaction, :subscription, :errors, :params, :message
View
2  lib/braintree/errors.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/validation_errors
+ # See http://www.braintreepayments.com/docs/ruby/general/validation_errors
class Errors
include Enumerable
View
22 lib/braintree/exceptions.rb
@@ -2,41 +2,41 @@ module Braintree # :nodoc:
# Super class for all Braintree exceptions.
class BraintreeError < ::StandardError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class AuthenticationError < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class AuthorizationError < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class ConfigurationError < BraintreeError
def initialize(setting, message) # :nodoc:
super "Braintree::Configuration.#{setting} #{message}"
end
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class DownForMaintenanceError < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class ForgedQueryString < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class NotFoundError < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class ServerError < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class SSLCertificateError < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class UnexpectedError < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class UpgradeRequiredError < BraintreeError; end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/exceptions
+ # See http://www.braintreepayments.com/docs/ruby/general/exceptions
class ValidationsFailed < BraintreeError
attr_reader :error_result
View
12 lib/braintree/subscription.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/subscriptions/overview
+ # See http://www.braintreepayments.com/docs/ruby/subscriptions/overview
class Subscription
include BaseModule
@@ -29,12 +29,12 @@ module TrialDurationUnit
attr_reader :add_ons, :discounts
attr_reader :descriptor
- # See http://www.braintreepaymentsolutions.com/docs/ruby/subscriptions/cancel
+ # See http://www.braintreepayments.com/docs/ruby/subscriptions/cancel
def self.cancel(subscription_id)
Configuration.gateway.subscription.cancel(subscription_id)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/subscriptions/create
+ # See http://www.braintreepayments.com/docs/ruby/subscriptions/create
def self.create(attributes)
Configuration.gateway.subscription.create(attributes)
end
@@ -43,7 +43,7 @@ def self.create!(attributes)
return_object_or_raise(:subscription) { create(attributes) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/subscriptions/search
+ # See http://www.braintreepayments.com/docs/ruby/subscriptions/search
def self.find(id)
Configuration.gateway.subscription.find(id)
end
@@ -52,12 +52,12 @@ def self.retry_charge(subscription_id, amount=nil)
Configuration.gateway.transaction.retry_subscription_charge(subscription_id, amount)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/subscriptions/search
+ # See http://www.braintreepayments.com/docs/ruby/subscriptions/search
def self.search(&block)
Configuration.gateway.subscription.search(&block)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/subscriptions/update
+ # See http://www.braintreepayments.com/docs/ruby/subscriptions/update
def self.update(subscription_id, attributes)
Configuration.gateway.subscription.update(subscription_id, attributes)
end
View
2  lib/braintree/successful_result.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/result_objects
+ # See http://www.braintreepayments.com/docs/ruby/general/result_objects
class SuccessfulResult
include BaseModule
View
2  lib/braintree/test/credit_card_numbers.rb
@@ -4,7 +4,7 @@ module Test # :nodoc:
# credit card numbers that should be used when working in the sandbox environment. The sandbox
# will not accept any credit card numbers other than the ones listed below.
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/reference/sandbox
+ # See http://www.braintreepayments.com/docs/ruby/reference/sandbox
module CreditCardNumbers
AmExes = %w[
378282246310005
View
2  lib/braintree/test/transaction_amounts.rb
@@ -3,7 +3,7 @@ module Test # :nodoc:
# The constants in this module can be used to create transactions with
# the desired status in the sandbox environment.
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/reference/sandbox
+ # See http://www.braintreepayments.com/docs/ruby/reference/sandbox
module TransactionAmounts
Authorize = "1000.00"
Decline = "2000.00"
View
38 lib/braintree/transaction.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/overview
+ # See http://www.braintreepayments.com/docs/ruby/transactions/overview
class Transaction
include BaseModule
@@ -71,19 +71,19 @@ module Type # :nodoc:
attr_reader :updated_at
attr_reader :add_ons, :discounts
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create
def self.create(attributes)
Configuration.gateway.transaction.create(attributes)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create
def self.create!(attributes)
return_object_or_raise(:transaction) { create(attributes) }
end
# Deprecated. Use Braintree::TransparentRedirect.confirm
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_tr
def self.create_from_transparent_redirect(query_string)
warn "[DEPRECATED] Transaction.create_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
Configuration.gateway.transaction.create_from_transparent_redirect(query_string)
@@ -91,7 +91,7 @@ def self.create_from_transparent_redirect(query_string)
# Deprecated. Use Braintree::TransparentRedirect.url
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_tr
def self.create_transaction_url
warn "[DEPRECATED] Transaction.create_transaction_url is deprecated. Please use TransparentRedirect.url"
Configuration.gateway.transaction.create_transaction_url
@@ -105,47 +105,47 @@ def self.credit!(attributes)
return_object_or_raise(:transaction) { credit(attributes) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/search
+ # See http://www.braintreepayments.com/docs/ruby/transactions/search
def self.find(id)
Configuration.gateway.transaction.find(id)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/refund
+ # See http://www.braintreepayments.com/docs/ruby/transactions/refund
def self.refund(id, amount = nil)
Configuration.gateway.transaction.refund(id, amount)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create
def self.sale(attributes)
Configuration.gateway.transaction.sale(attributes)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create
def self.sale!(attributes)
return_object_or_raise(:transaction) { sale(attributes) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/search
+ # See http://www.braintreepayments.com/docs/ruby/transactions/search
def self.search(&block)
Configuration.gateway.transaction.search(&block)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/submit_for_settlement
+ # See http://www.braintreepayments.com/docs/ruby/transactions/submit_for_settlement
def self.submit_for_settlement(transaction_id, amount = nil)
Configuration.gateway.transaction.submit_for_settlement(transaction_id, amount)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/submit_for_settlement
+ # See http://www.braintreepayments.com/docs/ruby/transactions/submit_for_settlement
def self.submit_for_settlement!(transaction_id, amount = nil)
return_object_or_raise(:transaction) { submit_for_settlement(transaction_id, amount) }
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/void
+ # See http://www.braintreepayments.com/docs/ruby/transactions/void
def self.void(transaction_id)
Configuration.gateway.transaction.void(transaction_id)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/void
+ # See http://www.braintreepayments.com/docs/ruby/transactions/void
def self.void!(transaction_id)
return_object_or_raise(:transaction) { void(transaction_id) }
end
@@ -187,7 +187,7 @@ def inspect # :nodoc:
# Deprecated. Use Braintree::Transaction.refund
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/refund
+ # See http://www.braintreepayments.com/docs/ruby/transactions/refund
def refund(amount = nil)
warn "[DEPRECATED] refund as an instance method is deprecated. Please use Transaction.refund"
result = @gateway.transaction.refund(id, amount)
@@ -211,7 +211,7 @@ def refund_id
# Deprecated. Use Braintree::Transaction.submit_for_settlement
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/submit_for_settlement
+ # See http://www.braintreepayments.com/docs/ruby/transactions/submit_for_settlement
def submit_for_settlement(amount = nil)
warn "[DEPRECATED] submit_for_settlement as an instance method is deprecated. Please use Transaction.submit_for_settlement"
result = @gateway.transaction.submit_for_settlement(id, amount)
@@ -223,7 +223,7 @@ def submit_for_settlement(amount = nil)
# Deprecated. Use Braintree::Transaction.submit_for_settlement!
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/submit_for_settlement
+ # See http://www.braintreepayments.com/docs/ruby/transactions/submit_for_settlement
def submit_for_settlement!(amount = nil)
warn "[DEPRECATED] submit_for_settlement! as an instance method is deprecated. Please use Transaction.submit_for_settlement!"
return_object_or_raise(:transaction) { submit_for_settlement(amount) }
@@ -267,7 +267,7 @@ def vault_shipping_address
# Deprecated. Use Braintree::Transaction.void
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/void
+ # See http://www.braintreepayments.com/docs/ruby/transactions/void
def void
warn "[DEPRECATED] void as an instance method is deprecated. Please use Transaction.void"
result = @gateway.transaction.void(id)
@@ -279,7 +279,7 @@ def void
# Deprecated. Use Braintree::Transaction.void!
#
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/void
+ # See http://www.braintreepayments.com/docs/ruby/transactions/void
def void!
warn "[DEPRECATED] void! as an instance method is deprecated. Please use Transaction.void!"
return_object_or_raise(:transaction) { void }
View
20 lib/braintree/transparent_redirect.rb
@@ -1,10 +1,10 @@
module Braintree
# See:
- # * http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_tr
- # * http://www.braintreepaymentsolutions.com/docs/ruby/customers/create_tr
- # * http://www.braintreepaymentsolutions.com/docs/ruby/customers/update_tr
- # * http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/create_tr
- # * http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/update_tr
+ # * http://www.braintreepayments.com/docs/ruby/transactions/create_tr
+ # * http://www.braintreepayments.com/docs/ruby/customers/create_tr
+ # * http://www.braintreepayments.com/docs/ruby/customers/update_tr
+ # * http://www.braintreepayments.com/docs/ruby/credit_cards/create_tr
+ # * http://www.braintreepayments.com/docs/ruby/credit_cards/update_tr
module TransparentRedirect
module Kind # :nodoc:
CreateCustomer = "create_customer"
@@ -18,27 +18,27 @@ def self.confirm(query_string)
Configuration.gateway.transparent_redirect.confirm(query_string)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/create_tr
def self.create_credit_card_data(params)
Configuration.gateway.transparent_redirect.create_credit_card_data(params)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/customers/create_tr
def self.create_customer_data(params)
Configuration.gateway.transparent_redirect.create_customer_data(params)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/transactions/create_tr
+ # See http://www.braintreepayments.com/docs/ruby/transactions/create_tr
def self.transaction_data(params)
Configuration.gateway.transparent_redirect.transaction_data(params)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/credit_cards/update_tr
+ # See http://www.braintreepayments.com/docs/ruby/credit_cards/update_tr
def self.update_credit_card_data(params)
Configuration.gateway.transparent_redirect.update_credit_card_data(params)
end
- # See http://www.braintreepaymentsolutions.com/docs/ruby/customers/update_tr
+ # See http://www.braintreepayments.com/docs/ruby/customers/update_tr
def self.update_customer_data(params)
Configuration.gateway.transparent_redirect.update_customer_data(params)
end
View
2  lib/braintree/validation_error.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/validation_errors
+ # See http://www.braintreepayments.com/docs/ruby/general/validation_errors
class ValidationError
include BaseModule
View
2  lib/braintree/validation_error_collection.rb
@@ -1,5 +1,5 @@
module Braintree
- # See http://www.braintreepaymentsolutions.com/docs/ruby/general/validation_errors
+ # See http://www.braintreepayments.com/docs/ruby/general/validation_errors
class ValidationErrorCollection
include Enumerable
View
2  lib/braintree/version.rb
@@ -2,7 +2,7 @@ module Braintree
module Version
Major = 2
Minor = 10
- Tiny = 0
+ Tiny = 1
String = "#{Major}.#{Minor}.#{Tiny}"
end
View
8 lib/braintree/xml/generator.rb
@@ -97,7 +97,13 @@ def self._array_to_xml(array, options = {})
end
def self._xml_escape(key)
- key.to_s.tr("_", "-").to_xs
+ dasherized_key = key.to_s.tr("_", "-")
+
+ if Builder::XChar.respond_to?(:encode)
+ Builder::XChar.encode(dasherized_key)
+ else
+ dasherized_key.to_xs
+ end
end
end
end
View
16 spec/integration/braintree/http_spec.rb
@@ -113,20 +113,6 @@
end
end
- it "accepts the certificate on the QA server" do
- begin
- original_env = Braintree::Configuration.environment
- Braintree::Configuration.environment = :qa
- Braintree::Configuration.stub(:base_merchant_path).and_return("/")
-
- expect do
- Braintree::Configuration.instantiate.http._http_do(Net::HTTP::Get, "/login")
- end.to_not raise_error
- ensure
- Braintree::Configuration.environment = original_env
- end
- end
-
it "accepts the certificate on the sandbox server" do
begin
original_env = Braintree::Configuration.environment
@@ -158,7 +144,7 @@
it "raises an appropriate error if certificate fails validation" do
begin
original_env = Braintree::Configuration.environment
- Braintree::Configuration.environment = :qa
+ Braintree::Configuration.environment = :sandbox
config = Braintree::Configuration.instantiate
config.stub(:base_merchant_path).and_return("/")
config.stub(:ca_file).and_return("does_not_exist")
View
8 spec/integration/braintree/transaction_spec.rb
@@ -811,7 +811,7 @@
:email => "dan@example.com",
:phone => "419-555-1234",
:fax => "419-555-1235",
- :website => "http://braintreepaymentsolutions.com"
+ :website => "http://braintreepayments.com"
},
:billing => {
:first_name => "Carl",
@@ -862,7 +862,7 @@
transaction.customer_details.email.should == "dan@example.com"
transaction.customer_details.phone.should == "419-555-1234"
transaction.customer_details.fax.should == "419-555-1235"
- transaction.customer_details.website.should == "http://braintreepaymentsolutions.com"
+ transaction.customer_details.website.should == "http://braintreepayments.com"
transaction.billing_details.first_name.should == "Carl"
transaction.billing_details.last_name.should == "Jones"
transaction.billing_details.company.should == "Braintree"
@@ -1390,7 +1390,7 @@
:email => "dan@example.com",
:phone => "419-555-1234",
:fax => "419-555-1235",
- :website => "http://braintreepaymentsolutions.com"
+ :website => "http://braintreepayments.com"
},
:billing => {
:first_name => "Carl",
@@ -1444,7 +1444,7 @@
transaction.customer_details.email.should == "dan@example.com"
transaction.customer_details.phone.should == "419-555-1234"
transaction.customer_details.fax.should == "419-555-1235"
- transaction.customer_details.website.should == "http://braintreepaymentsolutions.com"
+ transaction.customer_details.website.should == "http://braintreepayments.com"
transaction.billing_details.first_name.should == "Carl"
transaction.billing_details.last_name.should == "Jones"
transaction.billing_details.company.should == "Braintree"
View
2  spec/spec.opts
@@ -1,4 +1,4 @@
--format progress
--loadby mtime
--reverse
---backtrace
+--backtrace
Please sign in to comment.
Something went wrong with that request. Please try again.