This script enables you to launch your Rails application in production environment (port:80) with Nginx and Unicorn.
Please make sure that your Gemfile in your rails application includes unicorn.
require 'active_merchant' | |
ActiveMerchant::Billing::Base.mode = :test | |
gateway = ActiveMerchant::Billing::WebpayGateway.new(:login => 'test_secret_eHn4TTgsGguBcW764a2KA8Yd') | |
amount = 10000 # 100 yen | |
credit_card = ActiveMerchant::Billing::CreditCard.new( | |
:first_name => 'Kei', | |
:last_name => 'Kubo', |
require 'twilio-ruby' | |
require 'webpay' | |
post '/' do | |
Twilio::TwiML::Response.new do |r| | |
r.Gather :timeout => "10", :finishOnKey => "*", :action => '/month' do |g| | |
g.Say "Please enter your credit card number and then press star." | |
end | |
end.text | |
end |
1111.94 - 1139.17 (coinbase) | |
1115.51 - 1117.51 (bitstamp) | |
1224.00001 - 1224.4 (Mt. Gox) | |
1116.46849 - 1125.42705 (Kraken) | |
1041.18 - 1042 (BTC-E) | |
1093.2799 - 1096.4686 (itBit) | |
1168.305 - 1203.450 (Justcoin BTCUSD) | |
at 2013-12-01 03:06:51 +0900 |
require 'http' | |
require 'json' | |
require 'bitstamp' | |
require 'mtgox' | |
require 'btce' | |
# coinbase | |
coinbase_buy = HTTP.get "https://coinbase.com/api/v1/prices/buy", | |
:params => { :api_key => 'COINBASE_API_KEY', | |
:amount => "1.00", :currency => "USD"} |
<div class='container'> | |
<div class='row'> | |
<div class='span12'> | |
<h2>Samurai Startup IslandのDayPassを購入してスタートアップライフを満喫しましょう!</h2> | |
<h4>価格: 2,100円</h4> | |
<form accept-charset="UTF-8" action="/tickets" class="new_ticket" id="new_ticket" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="xhANERJ85JA2nKY9esTc7hTIOQiLd6n0lrFn6QWqTmE=" /></div> | |
<label for="ticket_name">名前</label> | |
<input id="ticket_name" name="ticket[name]" size="30" type="text" /> | |
<label for="ticket_email">メールアドレス</label> |
<div class='container'> | |
<div class='row'> | |
<div class='span12'> | |
<h2>Samurai Startup IslandのDayPassを購入してスタートアップライフを満喫しましょう!</h2> | |
<h4>価格: 2,100円</h4> | |
<form accept-charset="UTF-8" action="/tickets" class="new_ticket" id="new_ticket" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="xhANERJ85JA2nKY9esTc7hTIOQiLd6n0lrFn6QWqTmE=" /></div> | |
<label for="ticket_name">名前</label> | |
<input id="ticket_name" name="ticket[name]" size="30" type="text" /> | |
<label for="ticket_email">メールアドレス</label> |
curl "https://api.webpay.jp/v1/plans" \ | |
-u "test_secret_key:" \ | |
-d "amount=1500" \ | |
-d "interval=week" \ | |
-d "name=すごいプラン" \ | |
-d "currency=jpy" \ | |
-d "id=great plan" \ | |
-d "interval_count=5" |
// Copyright (c) 2013 Kei Kubo <keikubo@webpay.jp> (MIT License) | |
(function () { | |
var e = this; | |
this.Webpay = function () { | |
return e.endpoint = 'https://api.webpay.jp/v1', e.key = null, | |
e.setPublishableKey = function (key) { | |
e.key = key; | |
}, | |
e.setApiBase = function (endpoint) { |
# coding: utf-8 | |
require "stripe" | |
Stripe.api_key = "vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE" # this is a test key. change it to your API key | |
Stripe.api_base = "https://api.webpay.jp" | |
customer = Stripe::Customer.create( | |
:card => { | |
:number => "4242424242424242", | |
:exp_month => 1, | |
:exp_year => 2015, | |
:cvc => 123, |