Assign Membership to user based on web-hook received

I have integrated wix with Stripe (via Velo code as Stripe integration is not supported by wix in India).

I am in testing phase and successfully receiving web-hook sent by stripe in wix. Here is my code:

How can I assign Gold membership to the user inside IF block?

Please give me some reference code as I have already looked at Wix Membership API and unable to comprehend it.