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
$(function() { | |
// Point WePay to stage | |
WePay.set_endpoint("stage"); | |
// Use your WePay client and account IDs here. | |
var clientId = 12345; | |
var accountId = 123456789; | |
// This is your Apple-registered merchant identifier | |
var merchantId = "example.com.wepay"; |
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
//LineItem: | |
var lineItem = { | |
type: "final", | |
label: "Subtotal", | |
amount: "1234.56" | |
}; | |
//PaymentContact: | |
var contact = { | |
emailAddress: "test@email.com", |
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
$(".checkout.index").ready(function() { | |
// Point WePay to stage | |
WePay.set_endpoint("stage"); | |
// Use your WePay client and account IDs here. | |
var clientId = 12345; | |
var accountId = 1234567890; | |
// Merchant ID is reserved for Apple Pay. For Payment Request API, use `undefined` | |
var merchantId = undefined; |
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
//Amount: | |
var amount = { | |
currency: "USD", | |
value: "4.50" | |
}; | |
//LineItem < Item: | |
var lineItem = { | |
label: “Subtotal”, | |
amount: amount |
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
// WePay PHP SDK - http://git.io/mY7iQQ | |
require 'wepay.php'; | |
// oauth2 parameters | |
<span class="variable">$code</span> = $_GET['code']; // the code parameter from step 2 | |
<span class="variable">$redirect_uri</span> = "http://www.example.com/oauth2_redirect_uri"; // this is the redirect_uri you used in step 1 | |
// application settings | |
<span class="variable">$client_id</span> = 123456789; | |
<span class="variable">$client_secret</span> = "1a3b5c7d9"; |
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://stage.wepayapi.com/v2/oauth2/token \ | |
-d "client_id=123456789" \ | |
-d "client_secret=1a3b5c7d9" \ | |
-d "code=52sdga231sddd213jj9a" \ | |
-d "redirect_uri=http://www.example.com/oauth2_redirect_uri" |
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
# WePay Ruby SDK - http://git.io/a_c2uQ | |
require 'wepay' | |
# application settings | |
client_id = '123456789' | |
client_secret = '1a3b5c7d9' | |
use_stage = true | |
wepay = WePay::Client.new(client_id, client_secret, use_stage) |
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
# WePay Python SDK - http://git.io/v7Y1jA | |
from wepay import WePay | |
# oauth2 parameters | |
code = '52sdga231sddd213jj9a'; # the code parameter from step 2 | |
redirect_uri = "http://www.example.com/oauth2_redirect_uri"; # this is the redirect_uri you used in step 1 | |
# application settings | |
client_id = 123456789 | |
client_secret = '1a3b5c7d9' |
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
<?php | |
// WePay PHP SDK - http://git.io/mY7iQQ | |
require 'wepay.php'; | |
// application settings | |
$client_id = 123456789; | |
$client_secret = "1a3b5c7d9"; | |
$access_token = "STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20"; | |
// change to useProduction for live environments |
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://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/" |
OlderNewer