Skip to content

Commit 30e14fe

Browse files
authored
Fix allocations (#101)
1 parent 2a86921 commit 30e14fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/hellgate/src/hg_invoice_payment.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -994,13 +994,13 @@ capture(St, Reason, Cost, Cart, AllocationPrototype, Opts) ->
994994
VS = collect_validation_varset(St, Opts),
995995
MerchantTerms = get_merchant_payments_terms(Opts, Revision, Timestamp, VS),
996996
CaptureCost = genlib:define(Cost, get_payment_cost(Payment)),
997-
#domain_Invoice{allocation = Allocation} = get_invoice(Opts),
998-
Allocation = genlib:define(maybe_allocation(AllocationPrototype, CaptureCost, MerchantTerms, Opts), Allocation),
997+
#domain_Invoice{allocation = Allocation0} = get_invoice(Opts),
998+
Allocation1 = genlib:define(maybe_allocation(AllocationPrototype, CaptureCost, MerchantTerms, Opts), Allocation0),
999999
case check_equal_capture_cost_amount(Cost, Payment) of
10001000
true ->
1001-
total_capture(St, Reason, Cart, Allocation);
1001+
total_capture(St, Reason, Cart, Allocation1);
10021002
false ->
1003-
partial_capture(St, Reason, Cost, Cart, Opts, MerchantTerms, Timestamp, Allocation)
1003+
partial_capture(St, Reason, Cost, Cart, Opts, MerchantTerms, Timestamp, Allocation1)
10041004
end.
10051005

10061006
maybe_allocation(undefined, _Cost, _MerchantTerms, _Opts) ->

0 commit comments

Comments
 (0)