Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 2.36 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $userid = "[user id]";
  3. $userkey = "[user key]";  
  4.  
  5. $size = "11x17";
  6. $paperstock = "Premium Photo";
  7. $lamination = "None";
  8. $mounting = "None";
  9. $pdfurl = "[url of PDF]";
  10.  
  11. $companyname = "Mimeo";
  12. $fullname = "Kin Lane";
  13. $firstname = "Kin";
  14. $lastname = "Lane";
  15. $careof = "";
  16. $streetaddress = "588 Sutter Street";
  17. $apartmentorsuite = "Suite 203";
  18. $city = "San Francisco";
  19. $state = "CA";
  20. $postalcode = "94102";
  21. $phone = "555-555-5555";
  22. $email = "kin.lane@mimeo.com";
  23. $isresidential = "true";
  24.  
  25. $quantity = "1";
  26.  
  27. $shippingchoice = "Ground";
  28.  
  29. $paymentmethod = "CreditCard";
  30. $ccnumber = "[credit card number]";
  31. $ccname = "[name on credit card]";
  32. $ccpostalcode = "[billing postal code]";
  33. $cctype = "[credit card type]";
  34. $ccexpirationmonth = "[credit card expiration month]";
  35. $ccexpirationyear = "[credit card expiration year]";
  36.  
  37. $format = "json";
  38. $environment = "Sandbox";
  39.  
  40. $curl_handle = curl_init();  
  41. curl_setopt($curl_handle, CURLOPT_URL, 'https://developer.mimeo.com/api/poster/placeorder/');  
  42. curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);  
  43. curl_setopt($curl_handle, CURLOPT_POST, 1);  
  44. curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array(  
  45.     'userid' => $userid,
  46.     'userkey' => $userkey,
  47.     'size' => $size,
  48.     'paperstock' => $paperstock,
  49.     'lamination' => $lamination,
  50.     'mounting' => $mounting,
  51.     'pdfurl' => $pdfurl,
  52.     'companyname' => $companyname,
  53.     'fullname' => $fullname,
  54.     'firstname' => $firstname,
  55.     'lastname' => $lastname,
  56.     'streetaddress' => $streetaddress,
  57.     'apartmentorsuite' => $apartmentorsuite,
  58.     'city' => $city,
  59.     'state' => $state,
  60.     'postalcode' => $postalcode,
  61.     'phone' => $phone,
  62.     'email' => $email,
  63.     'isresidential' => $isresidential,
  64.     'quantity' => $quantity,
  65.     'shippingchoice' => $shippingchoice,
  66.     'paymentmethod' => $paymentmethod,
  67.     'ccnumber' => $ccnumber,
  68.     'ccname' => $ccname,
  69.     'ccpostalcode' => $ccpostalcode,
  70.     'cctype' => $cctype,
  71.     'ccexpirationmonth' => $ccexpirationmonth,
  72.     'ccexpirationyear' => $ccexpirationyear,
  73.     'format' => $format,
  74.     'environment' => $environment
  75. ));  
  76.  
  77. curl_setopt($curl_handle,CURLOPT_SSL_VERIFYPEER,0);
  78. curl_setopt($curl_handle,CURLOPT_CAINFO,'[path to crt]/ca-bundle.crt'); // Make sure and get a ca-bundle.crt and use to verify peer
  79.  
  80. $buffer = curl_exec($curl_handle);  
  81. curl_close($curl_handle);  
  82.  
  83. var_dump($buffer);  
  84.  
  85. //$result = json_decode($buffer);
  86. ?>