README.md in nicepay-0.1.0 vs README.md in nicepay-0.1.1

- old
+ new

@@ -1,13 +1,13 @@ -# NICEPay Ruby Binding +# NICEPay Ruby Bindings ## Ruby SDK API Operation Test ### Virtual Account ``` -$ ruby test-va.rb +$ ruby sample/test-va.rb ``` ``` ---------------------------------------------------------------------- Virtual Account Number : 7001400000000631 @@ -18,11 +18,11 @@ ``` ### Card Checkout ``` -$ ruby test-card.rb +$ ruby sample/test-card.rb ``` ``` ----------------------------------------------------------------------------------------------------- Redirect Customer to : https://www.nicepay.co.id/nicepay/api/orderInquiry.do?tXid=IONPAYTEST01201606061651114907 @@ -31,11 +31,11 @@ ``` ### Check Transaction Status ``` -$ ruby test-status.rb +$ ruby sample/test-status.rb ``` ``` ---------------------------------------------------------------------- Transaction Status : 3 @@ -45,63 +45,41 @@ ---------------------------------------------------------------------- ``` ## Ruby on Rails -1. Install NICEPay Gem +### Add gem into Gemlock - ``` - $ gem install nicepay - ``` - or build from source - ``` - $ gem build nicepay.gemspec - ``` -2. Create checkout controller - ``` - $ rails g controller checkout - ``` -3. Add action to controller - ``` - def new - end +add following line +``` +gem 'nicepay', '~> 0.1.1' +``` - def create - # Amount in cents - @amount = 500 +### Generate Controller - requestVa= Nicepay::Api::RequestVa.new(Nicepay.requestParam) - chargeCard= Nicepay::Api::ChargeCard.new(Nicepay.requestParam) - checkStatus=Nicepay::Api::CheckStatus.new(Nicepay.requestParam) +``` +rails generate controller checkout +``` - end - ``` -4. Define Route - ``` - resources :checkout - ``` -5. Configure application - ``` - Rails.configuration.nicepay = { - :iMid=> ENV['I_MID'], - :merchantKey=> ENV['MERCHANT_KEY'] - } +``` +$ rails generate controller checkout + create app/controllers/checkout_controller.rb + invoke erb + create app/views/checkout + invoke test_unit + create test/controllers/checkout_controller_test.rb + invoke helper + create app/helpers/checkout_helper.rb + invoke test_unit + invoke assets + invoke coffee + create app/assets/javascripts/checkout.coffee + invoke scss + create app/assets/stylesheets/checkout.scss +``` - Nicepay.merchantKey= Rails.configuration.nicepay[:merchantKey] - Nicepay.iMid= Rails.configuration.nicepay[:iMid] - ``` +### Configure routes (config/routes.rb) -6. Create view - - Create a checkout.html.erb layout under app/views/layouts: - ``` - <!DOCTYPE html> - <html> - <head> - </head> - <body> - <%= yield %> - </body> - </html> - ``` - -and so on... \ No newline at end of file +add following line +``` + resources :checkout +```