The Buxter PHP Client is here
Mar 19, 2010
Social networks are often thought of as nations. Every network has its own dominant language and culture. As a developer that thought even extends to the programming language level. When you think of Facebook, PHP is without a doubt the native language there.
So today the Buxter team celebrates the release of the Buxter PHP Client. It is fairly new but works quite well already. We certainly appreciate your feedback and your contributions to the code base.
To give you an idea how easy it is to create a payment solution with the PHP api, here is some pseudo code for you.
// Create the Buxter Client
$client =
BuxterPHPClient::createSandboxClient(
$apiConfigurationID, $buxterSecretKey );
// Create the transaction and retrieve the redirect link
$createTxResponse =
$client->createTransactionLink( $amount, $currency,
$title, $description,
$buyerFbUID, $redirectURL, $externalID );
// get the transaction id and store it
$transactionId = $createTxResponse->transactionID;
// ...redirect the user to the buxter checkout,
// the user pays, then he is returned to your app again
$transactionStatus =
$client->queryTransactionStatusByTransactionID($transactionId);
if($transactionStatus=="SUCCESS"){
echo "Thank you for buying at ACME Inc.";
}else{
echo "Payment unsuccessful.";
}
That is pretty much the gist of it (error handling and facebook API excluded). Easy right? Let us know what you think of it.
Comments