Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Truncate enhancedData customerReference to 17 characters due to limit…
Browse files Browse the repository at this point in the history
…ations by Litle library
  • Loading branch information
Denis Odorcic committed Dec 17, 2013
1 parent e38d083 commit fa0825d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_merchant/billing/gateways/litle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def create_hash(money, options)
end

if options[:description]
enhanced_data['customerReference'] = options[:description]
enhanced_data['customerReference'] = options[:description][0..16]
end

if options[:billing_address]
Expand Down
14 changes: 14 additions & 0 deletions test/unit/gateways/litle_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,20 @@ def test_deprecated_credit
end
end

def test_refund_should_not_error_on_customer_reference_length
return_object = {
'response' => '0',
'creditResponse' => {
'response' => '000',
'message' => 'pass',
'litleTxnId' =>'123456789012345678'
}
}
LitleOnline::Communications.expects(:http_post => return_object.to_xml(:root => 'litleOnlineResponse'))
response = @gateway.refund(0, "1234;credit", {:description => 'A lengthy refund description'})
assert response.success?
end

private

def with_litle_configuration_restoration(&block)
Expand Down

0 comments on commit fa0825d

Please sign in to comment.