This gem interact with fonePaisa payment gateway APIs. Currently the gem covers only Payment Request URL API.
Add the gem to your Gemfile
:
gem 'fonepaisa'
and run:
bundle install
Or install it by yourself:
gem install fonepaisa
Add below configuration in initializer
# config/initializers/fonepaisa.rb
Fonepaisa.configure do |config|
config.api_key = 'Your fonePaisa API Key'
config.salt = 'Your fonePaisa Salt'
end
fonePaisa provides an API which returns a unique payment page URL on your merchant server in response which can be used in any browser to show the payment selection page and complete the transaction.
request_params = {
amount: 100,
currency: 'INR',
mode: 'Live,
...
}
response = Fonepaisa::PaymentRequestURL.new(request_params).execute
In response you will get a payment execution URL in case of success. Refer the fonePaisa technical integration guide for complete list of parameters to be posted in payment request.
To validate the response received from fonePaisa
Fonepaisa::Client.new(response_params).response_valid?
Read the Contributing Guidelines and open a Pull Request.