SpreeWebpay
This is a spree extension to use WebPay as a payment method.
WebPayを決済に利用するためのSpree Extensionです。
Installation
If you do not have Spree installation, setup a project following Getting Started | Spree Commerce.
Add spree_webpay to your Gemfile:
gem 'spree_webpay'
Bundle your dependencies and run the installation generator:
bundle
bundle exec rails g spree_webpay:install
WebPay extension uses original js in the payment page.
Add our JS file to precompile file list (config/initializers/assets.rb
).
Rails.application.config.assets.precompile += %w( store/gateway/webpay.js )
Then, start Rails server and configure WebPay payment method.
- Because WebPay only supports JPY currency, we recommend to change currency to JPY.
- In the same way, set currencies of shipping methods to JPY.
- If you are using sample data, those prices are disabled when currency is changed. Reset them in JPY.
- Open payment method configuration (http://localhost:3000/admin/payment_methods) and add a new payment method.
- Select
Spree::PaymentMethod::Webpay
, and put secret and publishable keys shown in your webpay setting page.
Testing
First bundle your dependencies, then run rake
. rake
will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app
.
bundle
bundle exec rake
When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:
require 'spree_webpay/factories'
Copyright (c) WebPay, released under the New BSD License