Created
August 18, 2011 20:31
-
-
Save mimeoconnect/1155110 to your computer and use it in GitHub Desktop.
Doc APIs - Flyer - Place Order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $userid = "[user id]"; | |
| $userkey = "[user key]"; | |
| $frontpdfurl = "[url of PDF for front]"; | |
| $backpdfurl = "[url of PDF for back]"; | |
| $layout = "Portrait"; | |
| $fold = "No Fold"; | |
| $color = "Color"; | |
| $paper = "White Paper (24 lb Bright)"; | |
| $coating = "None"; | |
| $holepunch = "None"; | |
| $companyname = "Mimeo"; | |
| $fullname = "Kin Lane"; | |
| $firstname = "Kin"; | |
| $lastname = "Lane"; | |
| $careof = ""; | |
| $streetaddress = "588 Sutter Street"; | |
| $apartmentorsuite = "Suite 203"; | |
| $city = "San Francisco"; | |
| $state = "CA"; | |
| $postalcode = "94102"; | |
| $phone = "555-555-5555"; | |
| $email = "[email protected]"; | |
| $isresidential = "true"; | |
| $quantity = "1"; | |
| $shippingchoice = "Ground"; | |
| $paymentmethod = "CreditCard"; | |
| $ccnumber = "[credit card number]"; | |
| $ccname = "[name on credit card]"; | |
| $ccpostalcode = "[billing postal code]"; | |
| $cctype = "[credit card type]"; | |
| $ccexpirationmonth = "[credit card expiration month]"; | |
| $ccexpirationyear = "[credit card expiration year]"; | |
| $format = "json"; | |
| $environment = "Sandbox"; | |
| $curl_handle = curl_init(); | |
| curl_setopt($curl_handle, CURLOPT_URL, 'https://mimeo.laneworks.net/api/flyer/placeorder/'); | |
| curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($curl_handle, CURLOPT_POST, 1); | |
| curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array( | |
| 'userid' => $userid, | |
| 'userkey' => $userkey, | |
| 'frontpdfurl' => $frontpdfurl, | |
| 'backpdfurl' => $backpdfurl, | |
| 'fold' => $fold, | |
| 'color' => $color, | |
| 'paper' => $paper, | |
| 'coating' => $coating, | |
| 'holepunch' => $holepunch, | |
| 'companyname' => $companyname, | |
| 'fullname' => $fullname, | |
| 'firstname' => $firstname, | |
| 'lastname' => $lastname, | |
| 'streetaddress' => $streetaddress, | |
| 'apartmentorsuite' => $apartmentorsuite, | |
| 'city' => $city, | |
| 'state' => $state, | |
| 'postalcode' => $postalcode, | |
| 'phone' => $phone, | |
| 'email' => $email, | |
| 'isresidential' => $isresidential, | |
| 'quantity' => $quantity, | |
| 'shippingchoice' => $shippingchoice, | |
| 'paymentmethod' => $paymentmethod, | |
| 'ccnumber' => $ccnumber, | |
| 'ccname' => $ccname, | |
| 'ccpostalcode' => $ccpostalcode, | |
| 'cctype' => $cctype, | |
| 'ccexpirationmonth' => $ccexpirationmonth, | |
| 'ccexpirationyear' => $ccexpirationyear, | |
| 'format' => $format, | |
| 'environment' => $environment | |
| )); | |
| curl_setopt($curl_handle,CURLOPT_SSL_VERIFYPEER,0); | |
| 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 | |
| $buffer = curl_exec($curl_handle); | |
| curl_close($curl_handle); | |
| var_dump($buffer); | |
| //$result = json_decode($buffer); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment