Fiat On and Off-Ramps
Enabling crypto purchase on- and off-ramp flows for the Capsule Modal
The Capsule Modal currently supports crypto on-ramping (buying crypto) via Stripe, MoonPay, and Ramp, and MoonPay , and off-ramping (selling crypto for fiat currency) via Ramp and MoonPay. This guide will help you integrate these services to enable seamless crypto purchases within your application.
Enabling on- and off-ramping in the Capsule Modal offers significant benefits for developers and their end users. By integrating fiat conversion providers, developers can enhance their dApps in the following ways:
- Seamless Crypto Purchases: Simplifies the process for users to buy and sell crypto directly within the app, reducing friction and enhancing the overall user experience.
- Increased User Engagement: Provides a user-friendly interface that helps onboard and engage users, reducing drop-off rates and improving retention.
- Flexible Payment Options: Supports a wide range of payment methods, offering users more choices and convenience.
- Compliance and Security: Built-in tools for fraud prevention and identity verification help meet regulatory requirements, ensuring secure transactions.
Configuration
Configure your on- and off-ramp providers in the Capsule Developer Portal.
You can customize in which order the provider buttons appear in the Capsule Modal, as well as which assets are available to buy or sell from the provider interfaces.
When using the Capsule Modal, you can supply the prop onRampTestMode
to indicate that each provider should run in its
respective test mode. In test mode, no fiat value is exchanged and transactions are either simulated or execute on each
chain’s testnet equivalent. Be careful not to run your providers in test mode in your production application.
Provider-Specific Setup
Ramp
You must obtain a production Ramp API key for your own app and save it in the Capsule Developer Portal. For more information, please refer to the
Ramp API Key Documentation.
Stripe
To use the Stripe widget, you must add Stripe script tags to the <head>
tag of any pages where the modal will be
instantiated:
Attention: If you encounter CSP policy issues related to Stripe scripts in production, ensure to configure your Content Security Policy (CSP) to allow scripts from https://js.stripe.com
and https://crypto-js.stripe.com
. Consider adding the following meta tag to your HTML <head>
to resolve the issue:
Test the changes in a local production build to confirm the problem is resolved before deploying.
For further details, refer to the official documentation of
Was this page helpful?