From a553d74f48078a346c400d5f60c8bfc47efba9f9 Mon Sep 17 00:00:00 2001 From: cbeauvoi Date: Fri, 19 Jul 2019 18:14:21 +0200 Subject: [PATCH] add method to confirm payment --- BillingBundle/Service/BillingSrv.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BillingBundle/Service/BillingSrv.php b/BillingBundle/Service/BillingSrv.php index 39d65f0..28e01e1 100644 --- a/BillingBundle/Service/BillingSrv.php +++ b/BillingBundle/Service/BillingSrv.php @@ -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();