SpreeWebpay [![Build Status](https://travis-ci.org/webpay/spree_webpay.svg?branch=master)](https://travis-ci.org/webpay/spree_webpay) =========== This is a spree extension to use [WebPay](https://webpay.jp/) as a payment method. WebPayを決済に利用するためのSpree Extensionです。 Installation ------------ If you do not have Spree installation, setup a project following [Getting Started | Spree Commerce](http://guides.spreecommerce.com/developer/getting_started_tutorial.html). Add spree_webpay to your Gemfile: ```ruby gem 'spree_webpay' ``` Bundle your dependencies and run the installation generator: ```shell 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`). ```ruby 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](https://webpay.jp/settings). 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`. ```shell 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: ```ruby require 'spree_webpay/factories' ``` Copyright (c) WebPay, released under the New BSD License