If you have a current Stripe Account, the first step to do is to connect it to PosiPay. In PosiPay, a Gateway Account record holds the authenticated credentials of a merchant account from a certain gateway service provider.
A Gateway Account record is a crucial object that stores and protects the authenticated credentials of a merchant account from a specific gateway service provider, such as Stripe. This record holds essential information that is required to initiate any API calls from and to the gateway API. It includes various fields such as tokens, and other relevant information necessary for secure communication between the merchant's payment processing system and the gateway service provider. In summary, a Gateway Account record is a fundamental component that enables merchants to process secure transactions and manage their payment processing systems effectively. This is necessary for initiating payment processing, tokenizing Credit Card/Bank Account details, generating invoices, refunding a payment, and settlement reconciliation.
The steps below will guide you on creating and authenticating a Gateway Account record.
Note: If you have multiple Stripe Accounts, create a separate Gateway Account record for each individual account.
Create a Gateway Account Record
Follow the steps on how to create a Gateway Account record:
Click the App Launcher and search for Gateway Accounts.
Go to the Gateway Accounts tab.
Click New.
In the New Gateway Account modal,
Provide the following details to the Information section:
Provide your desired Gateway Account Name.
Select Stripe as the Gateway Provider. Take note that PosiPay only supports Stripe.
Populate the API Token with the Secret Key of your Stripe account.
Note: these keys are held securelyPopulate the Publishable Key with the Publishable Key of your Stripe account.
Set v1 as the API Version.
How to populate Base URL on Gateway Account
Go to Setup and search All Sites on Quick Find
Copy the URL of the site that is accessible by Guest users (the one you created in the last step). It should look like this: https://posimente24.my.site.com/
Once copied, paste the URL on the base URL of the Gateway Account
When the gateway account is being saved, the Webhook Endpoint URL will auto-populate
Make sure that the Active checkbox is disabled at this stage. The Gateway Account record will be activated once authenticated.
If your Stripe account is in test mode, enable the Sandbox checkbox. Otherwise, disable the Sandbox checkbox.
If your Stripe account is enrolled in 3D Secure Payments, enable the Enable 3D Secure checkbox. Otherwise, disable the Enable 3D Secure checkbox.
Select the supported currencies of your Stripe account in Accepted Currency.
Select a Default Currency.
In Fraud Trigger, select responses from the gateway to identify and categorize a Gateway Transaction as potentially fraudulent.
Provide the following details to the Payment Method section:
Select a Payment Method. Take note that PosiPay only supports Card and Bank Debit for now.
Select the supported card types of your Stripe account in Accepted Card.
You can set a brief Description of your Gateway Account record.
Click Save or Save & New to save your new Gateway Account record.
Keeping your Stripe Keys safe
As a Stripe user, you want to keep all API credentials (secret key, API key) secure. PosiPay stores them in a protected custom setting according to Salesforce security requirements. We have a protected custom setting called "Gateway Account Setting" where each Gateway Account record API Token & Publishable Key is stored. Below is the schema of the custom setting:
Visibility > Protected
Type > List
Fields > API Token, Publishable Key, Authenticated
This completely hides the custom setting and it’s values from the subscriber. The subscriber can't see it in Setup, the Apex code can't reference it, and it can’t be seen in any other place you might be able to normally access custom settings. In other words, once you enter your Stripe keys into PosiPay, they are kept securely.
How to authenticate your Gateway Account record
Follow the steps on how to authenticate your created/updated Gateway Account record:
In your Gateway Account record, click Authenticate.
After clicking the Gateway Account Authentication, a notification message will appear:
If your Stripe credentials stored in the Gateway Account record are valid:
A successful message will be displayed.
The Active checkbox is enabled and the credentials will be cleared out.
If your Stripe credentials stored in the Gateway Account record are invalid:
An error message will appear.
The Active checkbox is still disabled and the credentials are not cleared out.
Once you have authenticated your Stripe account on the PosiPay end, it is time to connect the webhooks on the Stripe end.
Next place to go: Stripe Webhook Set up