: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace WPForms\Integrations\Stripe\Api\Webhooks;
* Webhook customer.subscription.created class.
class CustomerSubscriptionCreated extends Base {
* Handle the Webhook's data.
* @throws RuntimeException If payment not found or not updated.
public function handle() {
$payment = wpforms()->get( 'payment' )->get_by( 'subscription_id', $this->data->id );
if ( ! wpforms()->get( 'payment' )->update( $payment->id, [ 'subscription_status' => 'active' ] ) ) {
throw new RuntimeException( 'Payment not updated' );
wpforms()->get( 'payment_meta' )->add_log(
'Stripe subscription was set to active.'