Explore a wide range of payment methods and learn how to seamlessly integrate Rapyd's payment features into your Ruby on Rails application. Provide your customers with their preferred local payment options through a single integration.
Before running the application, make sure you have the following installed:
- Ruby on Rails
- Ngrok
To get started with this application, you'll need a Rapyd Account and your API Keys. If you don't have one yet, you can sign up at Rapyd Client Portal.
When integrating Rapyd into your application, it's important to note that Rapyd doesn't accept requests from localhost. To properly test and interact with Rapyd APIs, you'll need to expose the corresponding port of your computer to the outside world. By default, the application uses port 3000. To achieve this, you can use tools like ngrok, which generates a temporary web address and redirects traffic to a specified port on your local machine. This allows you to securely test and experience Rapyd's features within your development environment.
- Clone this repository to your local machine.
- Navigate to the project directory.
- Install ngrok by following the instructions on ngrok's website.
- Once installed, expose port 3000 using the following command:
ngrok http 3000
- Copy the ngrok URL generated, e.g., http://abcdef123456.ngrok.io.
- In your Rails application, open
config/application.rb
. - Look for the line that starts with config.hosts.
- Add the ngrok URL to the array, separated by a comma. It should look like this:
config.hosts << 'abcdef123456.ngrok.app'
- Run the following commands to install dependencies and set up the database:
bundle install
rails db:create db:migrate
- Start the Rails server:
rails server
- Access the application by visiting http://localhost:3000 or your ngrok-generated URL.
- Log in to your Rapyd account.
- Make sure you are in "sandbox" mode (switch located at the bottom left of the panel).
- Go to the "Developers" tab and find your API keys. Copy them for use in the sample application.
For additional support and community engagement, visit the Rapyd Community.
Happy coding!
Feel free to adjust the instructions to match your application's structure and any specific requirements.