Product Checkout
Last updated
Last updated
© Revenium - www.revenium.io
The Product Checkout Component is designed to display a payment form to buy a Revenium Product (depending on the transaction type). This allows subscribers 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.
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.
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.
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 Subscriptions, Sources 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.
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 subscriber 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.
suscriber-email-address: the Subscription 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: