Video available at http://www.youtube.com/watch?v=4sQYYCx_CQM&feature=em-share_video_user
Presentation on In-App Payments with HTML5 at Silicon Valley Code Camp (October 7th, 2012)
Long journey of Ruby standard library at RubyConf AU 2024
2012 SVCodeCamp: In App Payments with HTML5
1. In-App Payments with HTML5
Building Scalable Game Payment Systems
Jonathan LeBlanc
Developer Evangelist (PayPal)
jleblanc@paypal.com
Twitter: @jcleblanc
Github: github.com/jcleblanc
2. Background
Developer Evangelist with
PayPal and eBay
Author of Programming
Social Applications
Emmy award winner for
Outstanding Achievement in
Advanced Media Technology
3. What are we going to talk about
HTML5 Toolkit Payments
4. What are we not going to talk about
Physical Goods
27. How the Verification Flow Works
Get Data
Product
Storage
Success / Fail
Verify Purchase
Verification Digital
Request Goods
Success / Fail
User
Notify User
Notification
28. Session Breakdown
The Architecture
The Implementation
The Product Webhooks
32. Payment: recordPayment
function recordPayment($paymentObj = ""){
$userId = $paymentObj["userId"];
$itemId = $paymentObj["itemId"];
$transactionId = $paymentObj["transactionId"];
$paymentStatus = $paymentObj["paymentStatus"];
$orderTime = $paymentObj["orderTime"];
//INSERT YOUR CODE TO SAVE THE PAYMENT DATA
}
33. Payment: verifyPayment
function verifyPayment($userId = 0, $itemId = 0){
$result = false;
//INSERT YOUR CODE TO QUERY PAYMENT DATA AND
//RETURN TRUE if MATCH FOUND
return $result;
}
36. Inventory: getItem
function getItem($itemId){
$items = array(
array(name => "Mega Shields",
number => "123",
qty => "1",
taxamt => "0",
amt => "1.00",
desc => "Unlock the power!",
category => "Digital"),
...);
$returnObj = array();
for ($i = 0; $i < count($items); $i++){
if ($items[$i]['number'] == $itemId){
$returnObj = $items[$i];
}
}
return $returnObj;
}
37. Is the Toolkit Right for You?
HTML5 Support?
Need to Accept Payments?
Accepting Digital Goods?
38. A Few Links
The HTML5 Toolkit
https://github.com/paypal/html5-dg
The PayPal Sandbox (Create Test Users)
https://developer.paypal.com/
JSWars Code and Demo
http://29a.ch/jswars/
39. Thank You! Any Questions?
http://www.slideshare.net/jcleblanc
Jonathan LeBlanc
Developer Evangelist (PayPal)
jleblanc@paypal.com
Twitter: @jcleblanc
Github: github.com/jcleblanc