- 1GB FLX::VPS (KVM) -> flx_vps_1g.txt
- 2GB FLX::VPS (KVM) -> flx_vps_2g.txt
- 4GB FLX::VPS (KVM) -> flx_vps_4g.txt
- 8GB FLX::VPS (KVM) -> flx_vps_8g.txt
- 2GB Linode VPS (Xen) -> linode.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'stripe' | |
Stripe.api_key = "vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE" | |
Stripe.api_base = "https://api.webpay.jp/v1" | |
charges = Stripe::Charge.create( | |
:amount => 400, | |
:currency => "jpy", | |
:card => { | |
:number => "4242424242424242", | |
:exp_month => 1, | |
:exp_year => 2015, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/stripe.rb b/lib/stripe.rb | |
index fb4a6a6..7e77804 100644 | |
--- a/lib/stripe.rb | |
+++ b/lib/stripe.rb | |
@@ -46,7 +46,7 @@ require 'stripe/errors/authentication_error' | |
module Stripe | |
@@ssl_bundle_path = File.join(File.dirname(__FILE__), 'data/ca-certificates.crt') | |
@@api_key = nil | |
- @@api_base = 'https://api.stripe.com/v1' | |
+ @@api_base = 'https://api.webpay.jp/v1' |
Stripeのgemをそのまま修正せずに使ってWebpayにアクセスする例。
普通にアクセスすると、Stripeにアクセスするため、'jpy'に対応していないというエラーがでる。下のコマンドは通常のapi_baseを指定しないスクリプトを実行するコマンド。
curl -s -L https://raw.github.com/gist/3731714/2302c7644f8b2d2d51127efd4da6f7eb4c65185b/create_charge.rb | ruby
で、api_baseで 'https://api.webpay.jp/v1' を指定してあげると、Webpayにアクセスするので、きちんと日本円で決済ができることが確認できる。逆に'usd'での取引はできない。
curl -s -L https://raw.github.com/gist/3731714/654e3d408e604b289481cee87ce7dc7a4d30fe98/create_charge.rb | ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "cus_LG0Lf1WTDaDlbQ", | |
"livemode": false, | |
"object": "customer", | |
"created": 1347547188, | |
"description": "1人目の顧客(WebPayスタッフ)", | |
"subscription": { | |
"object":"subscription", | |
"status":"trialing", | |
"plan": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var key = 'pk_test_czwzkTp2tactuLOEOqbMTRzG'; | |
var params = { | |
'card[number]': '4242 4242 4242 4242', | |
'card[exp_month]': '01', | |
'card[exp_year]': '2050' | |
}; | |
$.ajax({ | |
url: 'https://api.stripe.com/v1/tokens', | |
method: 'POST', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> customer = stripe.Customer.create( | |
... card="tok_1SxLsd4YtToozX") | |
>>> plan = stripe.Plan.create( | |
... amount=2000, | |
... interval='month', | |
... name='Amazing Gold Plan', | |
... currency='usd', | |
... id='gold') | |
>>> customer.update_subscription( | |
... plan="gold") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("lib/Stripe.php"); | |
Stripe::setApiKey('webpay_api_key'); | |
Stripe::$apiBase = "https://api.webpay.jp"; | |
$myCard = array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015, 'name' => 'Kei Kubo', 'cvc' => 123); | |
$charge = Stripe_Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'jpy')); | |
echo $charge; | |
echo $charge["id"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/https' | |
require 'uri' | |
require 'rubygems' | |
require 'json' | |
url = URI.parse('https://api.webpay.jp/v1/charges/ch_WO14ib0ANJiSHn') | |
req = Net::HTTP::Get.new(url.path) | |
req.basic_auth 'vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE', '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, |