Poli
API to integrate POLi payment gateway -- http://www.polipayments.com
Installation
Add this line to your application's Gemfile:
gem 'poli'
And then execute:
$ bundle
Or install it yourself as:
$ gem install poli
Usage
Use in irb
-
check poli version in terminal:
poli -v
-
generate poli configuration file, and change it to use your merchant code and authentication code:
poli generate
-
go into irb, and type:
> require 'poli'
> Poli::POLi.load_config
> financialInstitutions = Poli::POLi.get_financialInstitutions
> puts financialInstitutions
Use with rails app
-
put configuration file to yourApp/config/ folder, or generate poli one under your app folder:
poli generate
-
put the following code into your initialize file, could be "config/initializers/all_init.rb":
Poli::POLi.load_config
Sample of the configuration file
defaults: &DEFAULTS
currency_code: "AUD"
timeout: 900
homepage_url: http://localhost:3000
notification_url: http://localhost:3000/poli/notification
checkout_url: http://localhost:3000/profile/poli/checkout
successful_url: http://localhost:3000/profile/poli/successful
unsuccessful_url: http://localhost:3000/profile/poli/unsuccessful
initiate_transaction: https://merchantapi.apac.paywithpoli.com/MerchantAPIService.svc/Xml/transaction/initiate
get_transaction: https://merchantapi.apac.paywithpoli.com/MerchantAPIService.svc/Xml/transaction/query
get_financial_institutions: https://merchantapi.apac.paywithpoli.com/MerchantAPIService.svc/Xml/banks
merchant_code: 1111111
authentication_code: 222222222
development:
<<: *DEFAULTS
merchant_code: 1111111
authentication_code: 222222222
test:
<<: *DEFAULTS
merchant_code: 1111111
authentication_code: 222222222
production:
<<: *DEFAULTS
merchant_code: 1111111
authentication_code: 222222222
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request