Файловый менеджер - Редактировать - /home/avadvi5/public_html/wp-content/plugins/wpforms/src/Integrations/Stripe/Api/Webhooks/CustomerSubscriptionDeleted.php
Ðазад
<?php namespace WPForms\Integrations\Stripe\Api\Webhooks; use RuntimeException; use WPForms\Db\Payments\UpdateHelpers; /** * Webhook customer.subscription.deleted class. * * @since 1.8.4 */ class CustomerSubscriptionDeleted extends Base { /** * Handle the Webhook's data. * * @since 1.8.4 * * @throws RuntimeException If payment not found or not updated. * * @return bool */ public function handle() { $payment = wpforms()->obj( 'payment' )->get_by( 'subscription_id', $this->data->object->id ); if ( ! $payment ) { return false; } if ( isset( $this->data->object->metadata->canceled_by ) && $this->data->object->metadata->canceled_by === 'wpforms_dashboard' ) { return false; } if ( ! UpdateHelpers::cancel_subscription( $payment->id, 'Stripe subscription cancelled from the Stripe dashboard.' ) ) { throw new RuntimeException( 'Payment not updated' ); } return true; } }
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка