How to remove a role after a user adds a payment method in Commerce? I am trying to set up a subscription-based site in Drupal 8/Commerce 2.
I'm using Commerce Stripe to process payments.  I want to remove a role from a user (&quot;needs to add new card&quot; role) when the user adds a new payment method (credit card via Stripe) on the payment method page (user/UID/payment-methods).
I assume I need to write an event subscriber, but I don't know which event to use for adding a payment method.
I tried to read through the code in commerce/modules/payment/src/EventSubscriber, but I couldn't find the event I need to hook into to remove the role.
Background
When a user's credit card has expired, they need to add a new card (add a new payment method).  In this case, I have flagged the users with a role, Add new card role.
Then I show a block to users with the Add new card role that says &quot;Please update your card info.&quot; with a link to add a card.
However, when the user adds a new card, they still see the block asking them to add a new card, which is confusing.  So I want to immediately remove the Add new card role (to hide the block) as soon as the user adds a new card.
commerce doesn't offer the (content-)entity create event. You could use a hook ..

hook_ENTITY_TYPE_create -&gt; after the entity was created 8will suit your need I guess)
hook_ENTITY_TYPE_presave -&gt; before the entity will be created

Or setup events for entity creation, see Does Drupal 8 entities have any events I can listen to?