Skip to content

Instantly share code, notes, and snippets.

@keikubo
Created September 4, 2012 19:52
Show Gist options
  • Save keikubo/3625640 to your computer and use it in GitHub Desktop.
Save keikubo/3625640 to your computer and use it in GitHub Desktop.
webpay.jp curl example to create a new charge
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
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