
Untitled
By: a guest on
May 8th, 2012 | syntax:
None | size: 0.98 KB | hits: 12 | expires: Never
include('./wepay.php');
$wePay = new WePay();
$wePay->useStaging($client_id, $client_secret); //connects properly on other pages
try {
$checkout = $wepay->request('/checkout/create', array(
'account_id' => $account_id, // ID properly pulled from DB
'amount' => 100, //dollar amount you want to charge the user
'short_description' => "this is a test payment",
'type' => "PERSONAL",
'app_fee'=>'5.5',
'redirect_uri'=> $redirect_uri,
'mode' => "regular"
)
);
} catch (WePayException $e) { // if the API call returns an error, get the error message for display later
$error = $e->getMessage();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
////redirect_uri page
if(!empty($_GET['error']) and !empty($_GET['code']))
{
$info = $wePay->getToken($_GET['code'], $redirect_uri);
if ($info) {
$checkoutID = $info->checkout_id;
$checkoutURI = $info->checkout_uri;
}
}