I am facing below issue in magento 220.127.116.11.
1) Invoice created but email not sent.
2) Double total bug.
I found solution everywhere to put
$invoice->register()->capture(); instead of $invoice->register()->pay();
put two line below it.
with this double total paid issued solved, but invoice not created & mail not received.
so can you please help me.