Skip to content
Browse files

* Don't use billing_address for shipping_address in CyberSourceGateway

git-svn-id: https://activemerchant.googlecode.com/svn/trunk/active_merchant@612 6513ea26-6c20-0410-8a68-89cd7235086d
  • Loading branch information...
1 parent 6001ca8 commit 8f92fd9545a1cfb426087a9f44d320a0ce86744c codyfauser committed
View
1 CHANGELOG
@@ -1,5 +1,6 @@
= ActiveMerchant CHANGELOG
+* Don't use billing_address for shipping_address in CyberSourceGateway [cody]
* Remove @response instance variable from CardStreamGateway [cody]
* Remove @response instance variable from BrainTreeGateway [cody]
* Remove unused deal_with_cc method from BogusGateway [cody]
View
8 lib/active_merchant/billing/gateways/cyber_source.rb
@@ -162,7 +162,7 @@ def calculate_tax(creditcard, options)
# Create all address hash key value pairs so that we still function if we were only provided with one or two of them
def setup_address_hash(options)
options[:billing_address] = options[:billing_address] || options[:address] || {}
- options[:shipping_address] = options[:shipping_address] || options[:billing_address]
+ options[:shipping_address] = options[:shipping_address] || {}
end
def build_auth_request(money, creditcard, options)
@@ -329,11 +329,7 @@ def build_request(body, options)
# Contact CyberSource, make the SOAP request, and parse the reply into a Response object
def commit(request, options)
- request_body = build_request(request, options)
-
- url = test? ? TEST_URL : LIVE_URL
- data = ssl_post(url, request_body)
- response = parse(data)
+ response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, build_request(request, options)))
success = response[:decision] == "ACCEPT"
message = @@response_codes[('r' + response[:reasonCode]).to_sym] rescue response[:message]
View
11 test/remote/gateways/remote_cyber_source_test.rb
@@ -12,16 +12,7 @@ def setup
@amount = 100
@options = {
- :billing_address => {
- :address1 => '1234 My Street',
- :address2 => 'Apt 1',
- :company => 'Widgets Inc',
- :city => 'Ottawa',
- :state => 'ON',
- :zip => 'K1C2N6',
- :country => 'Canada',
- :phone => '(555)555-5555'
- },
+ :billing_address => address,
:order_id => generate_unique_id,
:line_items => [

0 comments on commit 8f92fd9

Please sign in to comment.
Something went wrong with that request. Please try again.