794_The.Definitive.Guide.to.Magento.pdf

9600 method purchaseorder ponumber 123 1234567 cctype

Info icon This preview shows pages 297–301. Sign up to view the full content.

'base_shipping_captured' => '8.9600', 'method' => 'purchaseorder', 'po_number' => '123-1234567', 'cc_type' => '', 'cc_number_enc' => '', 'cc_last4' => '', 'cc_owner' => '', 'cc_exp_month' => '0', 'cc_exp_year' => '0', 'cc_ss_start_month' => '0', 'cc_ss_start_year' => '0', 'payment_id' => '3', ), 'status_history' => array ( 0 => array ( 'increment_id' => '', 'parent_id' => '1', 'store_id' => NULL, 'created_at' => '2009-07-09 08:25:13', 'updated_at' => '2009-07-09 08:25:13', 'is_active' => '1', 'comment' => '', 'is_customer_notified' => '0', 'status' => 'complete', ), 1 => array ( 'increment_id' => '', 'parent_id' => '1', 'store_id' => NULL, 'created_at' => '2009-06-13 00:00:08', 'updated_at' => '2009-07-09 08:25:13', 'is_active' => '1', 'comment' => '', 'is_customer_notified' => '0', 'status' => 'processing', ), 2 => array ( 'increment_id' => '', 'parent_id' => '1', 'store_id' => NULL, 'created_at' => '2009-06-12 14:28:39', 'updated_at' => '2009-07-09 08:25:13', 'is_active' => '1', 'is_customer_notified' => '1',
Image of page 297

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

APPENDIX API REFERENCES 276 'status' => 'pending', ), ), ) Zend XML-RPC Example // Prepare data $order_increment_id = '200000001'; // Using Zend XML-RPC $results = $client->call('call', array($session_id, 'sales_order.info', array($order_increment_id))); // view results var_dump($results); Note We are purposely listing all the output data so you can extract the exact bit of information that is required when building your third-party application. Method: sales_order.addComment ($order_increment_id, $status, $comment, $notify) Description: Adds comments into the order. Return: Boolean; true if successful. Arguments: $order_increment_id (required). This is the increment_id pulled from sales_order.list(). $status (required). Can be pending, pending_paypal, processing, holded, complete, closed, or canceled. $comment (optional). Message to add into sales order. $notify (optional). Set to false if you don’t want an e-mail sent to the customer. SOAP Example // Prepare data $order_increment_id = '200000001'; $status = 'processing'; $comment = 'Your order has been shipped.'; $notify = true; // using SOAP method $results = $client->call($session_id, 'sales_order.addComment', array($order_increment_id, $status, $comment, $notify)); // display true if successful var_dump($results);
Image of page 298
APPENDIX API REFERENCES 277 Note Sales statuses can be found in the config.xml file located here: /app/code/core/Mage/Sales/etc/config.xml. Tip Because the comment argument is optional, you can use this method to update the status of an order. Set the notify argument to false and you have an updateStatus() method. Method: sales_order.hold ($order_increment_id) Description: Adds hold status to an order. Return: Boolean; true if successful. Argument: $order_increment_id (required). This is the increment_id pulled from sales_order.list(). Zend XML-RPC Example // Prepare data $order_increment_id = '200000001'; // Using Zend XML-RPC $results = $client->call('call', array($session_id, 'sales_order.hold', array($order_increment_id))); // view results var_dump($results); Method: sales_order.unhold ($order_increment_id) Description: Unholds an order. Return: Boolean; true if successful. Argument: $order_increment_id (required). This is the increment_id pulled from sales_order.list(). SOAP Example // Prepare data $order_increment_id = '200000001'; // using SOAP method $results = $client->call($session_id, 'sales_order.unhold', $order_increment_id);
Image of page 299

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

APPENDIX API REFERENCES 278 // display true if successful var_dump($results); Method: sales_order.cancel ($order_increment_id) Description: Cancels an order that has not been processed.
Image of page 300
Image of page 301
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern