I am having some difficulties understanding how/when entries are added to the sale history.
I have implemented a custom payment provider, and have a partial capture example where the checkout process authorizes an amount of 370 but only captures 200. Afterwards I capture the remaining amount using the "New Payment" button in the backend.
When the total amount is captured (it seems) the 'Sale history' section becomes visible, but only displays the following entries:
We successfully captured 170
We were authorized to capture 370
There is no entry for the initial partial capture of 200. The invoice rows "Total", "Collected" and "Balance due" are working perfectly though.
My PerformAuthorizeCapturePayment looks roughly like this:
protected override IPaymentResult PerformAuthorizeCapturePayment(IInvoice invoice, decimal amount, ProcessorArgumentCollection args)
{
var payment = GatewayProviderService.CreatePayment(PaymentMethodType.CreditCard, amount, PaymentMethod.Key);
payment.Collected = false;
payment.Authorized = true;
GatewayProviderService.Save(payment);
var captureResult = Helpers.Helpers.Payment.PerformCapturePayment(currencyInfo, amount, "", merchantNumber, paymentId , ""));
payment.Collected = captureResult.Success;
GatewayProviderService.Save(payment);
var result = payment.Collected
? new PaymentResult(Attempt<IPayment>.Succeed(payment), invoice, true)
: new PaymentResult(Attempt<IPayment>.Fail(new Exception(errorMessage)), invoice, false);
if (!result.Payment.Success)
{
GatewayProviderService.ApplyPaymentToInvoice(payment.Key, invoice.Key, AppliedPaymentType.Denied, result.Payment.Exception.Message, 0);
}
else
{
GatewayProviderService.ApplyPaymentToInvoice(payment.Key, invoice.Key, AppliedPaymentType.Debit, "Payment authorized and captured", amount);
}
return result;
}
Understanding Merchellos sale history
Hello,
I am having some difficulties understanding how/when entries are added to the sale history.
I have implemented a custom payment provider, and have a partial capture example where the checkout process authorizes an amount of 370 but only captures 200. Afterwards I capture the remaining amount using the "New Payment" button in the backend. When the total amount is captured (it seems) the 'Sale history' section becomes visible, but only displays the following entries:
We successfully captured 170
We were authorized to capture 370
There is no entry for the initial partial capture of 200. The invoice rows "Total", "Collected" and "Balance due" are working perfectly though.
My
PerformAuthorizeCapturePayment
looks roughly like this:Can someone tell me what I am missing?
BR Peter
Update: The payments tab correctly displays the initial capture of 200
...but the sale tab is still not correct
is working on a reply...