Payment using stripe in Salesforce
Payment using stripe in Salesforce
The project’s goal
Make payment for self-registration in the community.
When registering for the community website, a new user must make a payment. The user is taken to the Stripe Payment page after clicking the “sign up” button. Then only we can access the community website after the payment has been made.
Use Cases
We must first make a payment before we can create an account on the community website. Only after that can we subscribe to the website and register.
Once payment has been received, you will be redirected to the signup page to enter your user information. A new account will be created for paid users after a successful email for creating the new password has been sent to that registered email address.
The URL has been encrypted to prevent the creation of a new account on the community website without making a payment, and the user’s information is completely secure.
Approach
- We are using a custom aura component for the registration form as we cannot edit the default registration component.
- After modifying the aura component, we placed it on the community registration page and published it.
- For payment, we are using the Stripe API. We have generated a payment link using the Stripe API when clicking the signup button. We are asking for a confirmation popup to redirect to the payment page. If yes, it will redirect to the Stripe payment page.
- We are passing the user details to the Stripe payment link we entered in the registration form, as it is required to create an account after payment.
- We are using a success url in Stripe, which will redirect to the page after successful Payment. The success URL will contain a session ID that contains Stripe payment details.
Self Registration:
Community site URL login page.Â

Payment confirmation:

Stripe payment page:

Once the payment has been made, the user will be taken to the success page and sent an email with instructions on how to change their password.
Final Result:
