Created
March 5, 2024 10:33
-
-
Save ichaykin/8d795dfbf9a8a66afecfabfed760983f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Payments/StripeConnect.php b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Payments/StripeConnect.php | |
index 9001807f26..49474dfad7 100644 | |
--- a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Payments/StripeConnect.php | |
+++ b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Payments/StripeConnect.php | |
@@ -206,7 +206,7 @@ class StripeConnect | |
$this->order_info = $order_info; | |
$orders_queue = $this->getOrdersToCharge($order_info); | |
- | |
+ Logger::log(Logger::ACTION_INFO, 'start_charge', [$order_info['order_id'], $order_info['status'], $orders_queue]); | |
// Check that all receivers are valid accounts | |
if (!$this->validateOrdersQueueReceivers($orders_queue)) { | |
$pp_response['order_status'] = 'F'; | |
@@ -975,6 +975,7 @@ class StripeConnect | |
*/ | |
protected function transferFundsToVendors(array $orders, Charge $charge) | |
{ | |
+ Logger::log(Logger::ACTION_INFO, 'start_transfers', [$orders]); | |
$transfers = []; | |
foreach ($orders as $order_id => $company_id) { | |
if (!$company_id) { | |
@@ -983,7 +984,7 @@ class StripeConnect | |
} | |
$suborder_info = fn_get_order_info($order_id); | |
- | |
+ Logger::log(Logger::ACTION_INFO, 'transfer_suborder', ['subo_id' => $suborder_info['order_id']]); | |
if (!$suborder_info) { | |
continue; | |
} | |
@@ -1023,6 +1024,7 @@ class StripeConnect | |
} | |
$transfer = $this->transferFunds($suborder_info, $payouts_manager, $charge); | |
+ Logger::log(Logger::ACTION_INFO, 'transfer_created', ['t_id' => $transfer->id]); | |
if (!$transfer) { | |
continue; | |
} | |
@@ -1040,7 +1042,7 @@ class StripeConnect | |
if (!$withdrawal) { | |
continue; | |
} | |
- | |
+ Logger::log(Logger::ACTION_INFO, 'create_withdrawal', ['o_id' => $order_id, 'c_id' => $company_id, 'withdrawal' => $withdrawal]); | |
$payouts_manager->createWithdrawal($withdrawal, $order_id, $this->getWithdrawalDescription($order_id, $company_id, $transfer->metadata['stripe_fee'])); | |
if (!$this->addon_settings['collect_payouts']) { | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentSucceeded.php b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentSucceeded.php | |
index 21f6291cb8..0dbc90245d 100644 | |
--- a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentSucceeded.php | |
+++ b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Webhook/Handlers/PaymentIntentSucceeded.php | |
@@ -17,6 +17,7 @@ namespace Tygh\Addons\StripeConnect\Webhook\Handlers; | |
use Exception; | |
//phpcs:ignore | |
use Stripe\PaymentIntent; | |
+use Tygh\Addons\StripeConnect\Logger; | |
use Tygh\Addons\StripeConnect\ServiceProvider; | |
use Tygh\Addons\StripeConnect\Webhook\Handler; | |
use Stripe\Event; | |
@@ -61,7 +62,7 @@ class PaymentIntentSucceeded implements Handler | |
$lock->wait(); | |
} while (!$lock->acquire()); | |
} | |
- | |
+ Logger::log(Logger::ACTION_INFO, 'handle_webhook', ['o_id' => $order_info['order_id']]); | |
$changed_order_status = fn_change_order_status((int) $payment_intent->metadata['order_id'], OrderStatuses::PAID); | |
if ($changed_order_status) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment