Skip to content

Instantly share code, notes, and snippets.

@melvinmt
Created March 1, 2011 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melvinmt/849469 to your computer and use it in GitHub Desktop.
Save melvinmt/849469 to your computer and use it in GitHub Desktop.
<?php
require_once('Tinypayme.php');
$t = new Tinypayme($mashape_api_key);
$request = $t->createItem(
$access_token = $access_token,
$title =stripslashes($data['title']),
$currency = $data['currency'],
$price = $data['price'],
$description = $data['description'],
$tags = $data['tags'],
$quantity = -1,
$require_shipment_address = null,
$shipment_countries = null,
$shipment_costs = null,
$shipment_costs_per_item = null,
$geo_latitude = $data['geo_latitude'],
$geo_longitude = $data['geo_longitude'],
$image_tokens = $image_token,
$file_token = $file_token,
$video_url = null,
$charity_id = null,
$charity_percentage = null,
$language = null,
$country = null,
$marketplace_category_id = null
);
if(isset($request->result->item_id)){
$item_id = $request->result->item_id;
// show link
echo ' done! see <a href="http://tinypay.me/~'.$item_id.'" target="_blank">http://tinypay.me/~'.$item_id.'</a><p>';
// show item thumbnail
echo '<p><a href="http://tinypay.me/~'.$item_id.'" target="_blank"><img src="http://img.tinypay.me/btn/'.$item_id.'" border="0" title="'.$data['title'].'"/></a></p>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment