/** * Handle card delete event * * @param StripeEventType $event * * @throws StripeException */ public function onCardDeleteEvent(StripeEventType $event) { $stripeCard = $event->getEvent()['data']['object']; if ($stripeCard['object'] != StripeCard::STRIPE_OBJECT) { throw new StripeException(sprintf('Invalid object type "%s". Expected type is "%s".', $stripeCard['object'], StripeCard::STRIPE_OBJECT)); } $this->cardManager->remove($stripeCard, true); }
/** * Handle subscription delete event * * @param StripeEventType $event * * @throws StripeException */ public function onSubscriptionDeleteEvent(StripeEventType $event) { $stripeSubscription = $event->getEvent()['data']['object']; if ($stripeSubscription['object'] != StripeSubscription::STRIPE_OBJECT) { throw new StripeException(sprintf('Invalid object type "%s". Expected type is "%s".', $stripeSubscription['object'], StripeSubscription::STRIPE_OBJECT)); } $this->subscriptionManager->remove($stripeSubscription['id'], true); }
/** * Handle delete coupon event * * @param StripeEventType $event * * @throws StripeException */ public function onCouponDeleteEvent(StripeEventType $event) { $stripeCoupon = $event->getEvent()['data']['object']; $this->validateEventObject($stripeCoupon, StripeCoupon::STRIPE_OBJECT); $this->couponManager->remove($stripeCoupon['id'], true); }