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

Feed You can follow this conversation by subscribing to the comment feed for this post.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment