This is a simple Sinatra app created for Omise Webhook local test with ngrok.
- ruby : version 2.3.1
- bundler
- ngrok
- Omise Ruby Client
- Omise Test Secret Key
- .env
1: Install bundler if you haven't installed it yet.
gem install bundler
2: Install gem file.
bundle install --path vendor/bundle
3: Install ngrok over homebrew
brew cask install ngrok
4: Create .env
file and edit with your omise test secret key, you can get your test secret key from https://dashboard.omise.co/test/api-keys
OMISE_TEST_SECRET_KEY=skey_test_xxxREPLACE_THIS_KEY_WITH_YOURS
Start Sinatra app with command below.
bundle exec ruby app.rb
And next, start ngrok with command below.
ngrok http 3000
And then open your favorite web browser to open Omise Webhook Endpoint Edit page .
And edit that webhook endpoint with the url issued by ngrok for forwarding to your localhost:3000 which is displayed in your window like https://THIS_IS_UID.ngrok.io
and /omise/webhook
.
e.g. ENDPOINT: https://THIS_IS_UID.ngrok.io/omise/webhook
Yes, this sinatra app will create json files with the request body when it received HTTP request at /omise/webhook
.
Semantic Versioning 0.1.2 as defined at http://semver.org.
MIT License. Copyright 2017 Akira Narita.