Skip to content

Commit

Permalink
Use just name instead of firstname & lastname.
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Simpson committed Jun 3, 2013
1 parent 828d4b2 commit 8bd6010
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ def build_reference_request(action, money, authorization, options)
def add_address(xml, tag, address, options)
return if address.nil?
xml.tag! tag do
xml.tag! 'FirstName', address[:first_name] unless address[:first_name].blank?
xml.tag! 'LastName', address[:last_name] unless address[:last_name].blank?
xml.tag! 'Name', address[:name] unless address[:name].blank?
xml.tag! 'EMail', options[:email] unless options[:email].blank?
xml.tag! 'Phone', address[:phone] unless address[:phone].blank?
xml.tag! 'CustCode', options[:customer] if !options[:customer].blank? && tag == 'BillTo'
Expand Down
4 changes: 2 additions & 2 deletions test/unit/gateways/payflow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ def test_timeout_is_same_in_header_and_xml
assert_match /Timeout="#{timeout}"/, xml
end

def test_first_and_last_name_fields_are_included
def test_name_field_are_included_instead_of_first_and_last
@gateway.expects(:ssl_post).returns(successful_authorization_response).with do |url, data|
data =~ /FirstName/ && data =~ /LastName/
data !~ /FirstName/ && data !~ /LastName/ && data =~ /<Name>/
end
response = @gateway.authorize(@amount, @credit_card, @options)
assert_success response
Expand Down

0 comments on commit 8bd6010

Please sign in to comment.