Skip to content

Instantly share code, notes, and snippets.

# WePay Ruby SDK - http://git.io/a_c2uQ
require 'wepay'
# application settings
client_id = 9543125 # your WePay application's client ID
client_secret = '1a3b5c7d9' # your WePay application's client secret
access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20' # the user's access token
# set _use_stage to false for live environments
wepay = WePay::Client.new(client_id, client_secret, _use_stage = true)
# WePay Python SDK - http://git.io/v7Y1jA
from wepay import WePay
# application settings
cient_id = 123456789 # your WePay application's cient ID
client_secret = '1a3b5c7d9' # your Wepay application's client secret
access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20' # the user's access token
production = False
# set production to True for live environments
<?php
// WePay PHP SDK - http://git.io/mY7iQQ
require 'wepay.php';
// application settings
$account_id = 123456789;
$client_id = 9543125;
$client_secret = "1a3b5c7d9";
$access_token = "STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20";
curl https://stage.wepayapi.com/v2/preapproval/create \
-H "Authorization: Bearer STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20" \
-d "account_id=123456789" \
-d "period=once" \
-d "amount=19.99" \
-d "mode=regular" \
-d "short_description=A subscription to our magazine." \
-d "redirect_uri=http://example.com/success/"
# WePay Ruby SDK - http://git.io/a_c2uQ
require 'wepay'
# application settings
account_id = 123456789
client_id = 9543125
client_secret = '1a3b5c7d9'
access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20'
# set _use_stage to false for live environments
# WePay Python SDK - http://git.io/v7Y1jA
from wepay import WePay
# application settings
account_id = 123456789
access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20'
production = False
# set production to True for live environments
wepay = WePay(production, access_token)
<?php
// WePay PHP SDK - http://git.io/mY7iQQ
require 'wepay.php';
// application settings
$account_id = 123456789; // the merchant's account_id
$client_id = 9543125;
$client_secret = "1a3b5c7d9";
$access_token = "STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20"; // the merchant's access_token
$preapproval_id = "12345"; // The preapproval_id from step 1
$ curl https://stage.wepayapi.com/v2/checkout/create \
-H "Authorization: Bearer STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20" \
-d "account_id=12345" \
-d "amount=19.99" \
-d "currency=USD" \
-d "short_description=Payment for test project" \
-d "type=goods" \
-d "payment_method[type]=preapproval" \
-d "payment_method[preapproval][id]=123"
# WePay Ruby SDK - http://git.io/a_c2uQ
require 'wepay'
# application settings
account_id = 123456789 # the merchant's account_id
client_id = 9543125
client_secret = '1a3b5c7d9'
access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20' # the merchant's access_token
preapproval_id = '12345' # the preapproval_id from step 1
# WePay Python SDK - http://git.io/v7Y1jA
from wepay import WePay
# application settings
account_id = 123456789 # the merchant's account_id
access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20' # the merchant's access_token
preapproval_id = '12345' # the preapproval_id from step 1
production = False
# set production to True for live environments