Skip to content

Commit

Permalink
Litle: Fix commodity code placement in enhanced data fields
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnydang committed May 3, 2024
1 parent 4b0ee60 commit f89d548
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
* Worldpay: Remove default ECI value [aenand] #5103
* CyberSource: Update NT flow [almalee24] #5106
* Litle: Update enhanced data fields to pass integers [yunnydang] #5113
* Litle: Update commodity code and line item total fields [yunnydang] #5115


== Version 1.135.0 (August 24, 2023)
Expand Down
3 changes: 2 additions & 1 deletion lib/active_merchant/billing/gateways/litle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,14 @@ def add_line_item_information_for_level_three_visa(doc, payment_method, level_3_
doc.lineItemData do
level_3_data[:line_items].each do |line_item|
doc.itemSequenceNumber(line_item[:item_sequence_number]) if line_item[:item_sequence_number]
doc.commodityCode(line_item[:commodity_code]) if line_item[:commodity_code]
doc.itemDescription(line_item[:item_description]) if line_item[:item_description]
doc.productCode(line_item[:product_code]) if line_item[:product_code]
doc.quantity(line_item[:quantity]) if line_item[:quantity]
doc.unitOfMeasure(line_item[:unit_of_measure]) if line_item[:unit_of_measure]
doc.taxAmount(line_item[:tax_amount]) if line_item[:tax_amount]
doc.lineItemTotal(line_item[:line_item_total]) if line_item[:line_item_total]
doc.itemDiscountAmount(line_item[:discount_per_line_item].to_i) unless line_item[:discount_per_line_item].to_i < 0
doc.commodityCode(line_item[:commodity_code]) if line_item[:commodity_code]
doc.unitCost(line_item[:unit_cost].to_i) unless line_item[:unit_cost].to_i < 0
doc.detailTax do
doc.taxIncludedInTotal(line_item[:tax_included_in_total]) if line_item[:tax_included_in_total]
Expand Down
3 changes: 2 additions & 1 deletion test/remote/gateways/remote_litle_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def test_successful_purchase_with_level_three_data_visa
card_acceptor_tax_id: '361531321',
line_items: [{
item_sequence_number: 1,
item_commodity_code: 300,
commodity_code: '041235',
item_description: 'ramdom-object',
product_code: 'TB123',
quantity: 2,
Expand Down Expand Up @@ -347,6 +347,7 @@ def test_successful_purchase_with_level_three_data_master
customer_code: 'PO12345',
card_acceptor_tax_id: '011234567',
tax_amount: 50,
tax_included_in_total: true,
line_items: [{
item_description: 'ramdom-object',
product_code: 'TB123',
Expand Down

0 comments on commit f89d548

Please sign in to comment.