Product Checkout
The Product Checkout Component is designed to display a payment form to buy a Revenium Product (depending on the transaction type). This allows users to set up a subscription or make a one-time payment for access to a given Revenium product.
Note that this same functionality is built into the Drop-In Storefront, which is our recommended method for API commerce, though this component may be used on a standalone basis for specialized use-cases.
1. Configure your Stripe Account
Before you can use the Revenium Product Checkout Component, you need to setup your Stripe credentials.
Create a Stripe account, go to the registration link and fill the required details (Figure 1).
Go to your Stripe Dashboard > Developers > API keys (Figure 2) and save your Publishable and Secret keys, you will need them in the next step.
2. Create a Payment Configuration
Access the Revenium app.
Click on 'Payment Configurations' in the navigation menu (Figure 3).
After clicking on the Payment Configurations Link, the Payment Configurations dashboard appears (Figure 4).
Click on the Payment Configuration create button, located in the upper right corner of the screen (Figure 5).
After clicking on the create button, the Payment Configuration create form appears (Figure 6a, Figure 6b).
The fields available on the "Properties" step are determined by the Payment Provider that was selected. All these fields are required by the chosen provider.
Fill in the required inputs and click on Save to create a new Payment Configuration.
After clicking on the Save button, the changes will be saved.
![](https://docs.revenium.io/~gitbook/image?url=https%3A%2F%2F2470865788-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSUfCzMW8qWeXstipFXEh%252Fuploads%252FCLq4hrfQeFhrOBFUhEPH%252FFigure%25201.%2520Payment%2520Configurations%2520link.png%3Falt%3Dmedia%26token%3D156b7a57-447a-4e08-bed7-0bf1b6c41798&width=768&dpr=4&quality=100&sign=5977fd9a&sv=1)
![](https://docs.revenium.io/~gitbook/image?url=https%3A%2F%2F2470865788-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSUfCzMW8qWeXstipFXEh%252Fuploads%252F9Ra93MWwAReqy7zbk76e%252FFigure%25202.%2520Payment%2520Configurations%2520dashboard.png%3Falt%3Dmedia%26token%3D8276266e-98b9-4aa3-aff0-1883f3609582&width=768&dpr=4&quality=100&sign=16cb80c&sv=1)
![](https://docs.revenium.io/~gitbook/image?url=https%3A%2F%2F2470865788-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSUfCzMW8qWeXstipFXEh%252Fuploads%252FS8U7ceAMMLidZXTRV1SS%252FFigure%25205.%2520Payment%2520Configurations%2520create%2520button.png%3Falt%3Dmedia%26token%3D96094a81-681d-406b-846b-b4d2c7bc58a0&width=768&dpr=4&quality=100&sign=c8a4b0&sv=1)
![](https://docs.revenium.io/~gitbook/image?url=https%3A%2F%2F2470865788-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSUfCzMW8qWeXstipFXEh%252Fuploads%252FIWlMVGypUUFnZPSAGhbt%252FFigure%25205a.%2520Payment%2520Configurations%2520Create%2520Form%2520%28Step%25201%29.png%3Falt%3Dmedia%26token%3D3b4bb85a-0ffc-466b-9447-e32eb24276f8&width=768&dpr=4&quality=100&sign=9939a6ed&sv=1)
![](https://docs.revenium.io/~gitbook/image?url=https%3A%2F%2F2470865788-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSUfCzMW8qWeXstipFXEh%252Fuploads%252FF0ZIHYKl19iMh2SdYuYU%252FFigure%25205b.%2520Payment%2520Configurations%2520Create%2520Form%2520%28Step%25202%29.png%3Falt%3Dmedia%26token%3D3ca56dc5-df38-43b9-a37b-3df859ad3979&width=768&dpr=4&quality=100&sign=66cd3b1&sv=1)
3. Component Properties
The component properties displayed depend on the Product selected. Look at the component blueprint in the Figure 7 to identify how the properties are displayed in the Product Checkout Component for one-time charge products, if the Product selected has Subscription & Overage as Transaction Type, look at the component blueprint in the Figure 8. Use the following properties to customize the component display:
Record Id. This field returns the current Salesforce Object ID.
Organization. The list of Products displayed in the in the Product combobox depends on the organization selected in this field.
Product. Lists the available Products, select one to make the payment available for this product. The Product Licenses, Assets and table columns shown are based on the Product selected in this field.
Button Variant. Controls the Checkout button style, based on the Lightning Design System directives.
Button Label. Label shown in the Checkout button.
Button Align. Controls the Checkout button alignment.
Visualforce Page URL. Fill this field with the Add_Stripe_Payment page URL (you can find it in your Salesforce Organization > Setup > Visualforce pages).
Redirect URL on successful payment. URL to redirect to when a Stripe payment is successful (this will not be used but it's required by Stripe for security reasons).
Organization name. Name of the organization to display in the Stripe terms of service.
4. Use component programmatically
The component can be displayed in two ways, toggled by the show-only-form boolean attribute. When this property is set to false, a button is shown following the configuration attributes, clicking on this button will initiate the payment process. If this property is set to true, the button is not shown and the payment process is started when the component is loaded, displaying the Stripe form. Note that if the Payment Configuration associated with the Product to pay, the show-only-form property is ignored and the address input field will always be shown and should be filled by the user in order to start the payment process.The following attributes are required in order to use the Product Checkout Button programmatically:
selected-organization-id required: organization ID of the product selected.
product-id required: ID of the product to pay.
record-id: a valid GUID to use as external ID.
visualforce-stripe-page-url required: Add_Stripe_Payment page URL.
success-redirect-url required: URL to redirect to when a Stripe payment is successful (this will not be used but it's required by Stripe for security reasons).
show-only-form: toggles the component appearance as explained above.
full-width: boolean property to make the component fill the parent container width.
user-email-address: the Product License created on a successful payment will be assigned to this email address.
button-variant required only if show-only-form is not set to true: variant of the checkout button, based on SLDS guidelines.
button-label required only if show-only-form is not set to true: label of the checkout button.
button-alignment: valid values are “left”, “center”, or “right”.
organization-name: name of the organization to display in the Stripe terms of service.
cancel-button-color: determines the color of the "Cancel" button in the Payment form, the values should be in RGB string format, i.e.
rgb(89, 89, 89)
.pay-button-color: determines the color of the "Pay now" button in the Payment form, the values should be in RGB string format, i.e.
rgb(89, 89, 89)
.
When a successful or cancelled payment occurs, the following events will be triggered:
successfulpayment: will be triggered after a successful payment, the event details will contain the payment status, a message and the product paid details.
paymentcancellation: will be triggered after a payment is cancelled, the event details will contain the payment status and a message.
Code example of the programmatically use of the Product Checkout Component:
Structure of the events triggered by the component:
Last updated