Created
September 4, 2012 19:52
-
-
Save keikubo/3625640 to your computer and use it in GitHub Desktop.
webpay.jp curl example to create a new charge
This file contains 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, | |
:cvc => 123, | |
:name => "Kei Kubo" | |
}, | |
:description => "Charge from ruby script" | |
) | |
puts charges |
This file contains 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
curl https://api.webpay.jp/v1/charges \ | |
-u vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE: \ | |
-d amount=400 \ | |
-d currency=jpy \ | |
-d "card[number]=4242424242424242" \ | |
-d "card[exp_month]=1" \ | |
-d "card[exp_year]=2013" \ | |
-d "card[cvc]=123" \ | |
-d "card[name]=Kei Kubo" \ | |
-d "description=Charge for test@example.com" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment