add method to confirm payment

This commit is contained in:
Cyprian Beauvois 2019-07-19 18:14:21 +02:00
parent 8578b07f7e
commit a553d74f48
1 changed files with 7 additions and 0 deletions

View File

@ -41,6 +41,13 @@ class BillingSrv
);
}
public function confirmPayment($paimentIntent)
{
$infoIntent = $this->retrievePurchase($paimentIntent);
return ($infoIntent['amount'] == $infoIntent['amount_received'] && $infoIntent['amount_capturable'] == 0);
}
public function retrievePurchase($paimentIntent)
{
$this->setApiKey();