Skip to content

Instantly share code, notes, and snippets.

@greggles
Created September 14, 2012 02:44
Show Gist options
  • Save greggles/3719503 to your computer and use it in GitHub Desktop.
Save greggles/3719503 to your computer and use it in GitHub Desktop.
Some example querypath code
<?php
function monkey_add_origin($request) {
$request->top('MonkeyXMLRequest')
->append('<Origin></Origin>')
->children('Origin')
->append('<OriginType>ExtAPI</OriginType>');
}
// What's the new way of doing this?
$request = qp('<?xml version="1.0"?><MonkeyXMLRequest></MonkeyXMLRequest>')
->append('<AuthenticationDetails></AuthenticationDetails>')
->children('AuthenticationDetails')
->append('<AuthCardNumber>1234</AuthCardNumber>')
->top('MonkeyXMLRequest')
->append('<ServiceDetails></ServiceDetails>')
->children('ServiceDetails')
->append('<UniqueRequestId>5</UniqueRequestId>')
->append('<ServiceName>ActivateCard</ServiceName>');
monkey_add_origin($request);
$request->top('MonkeyXMLRequest')
->append('<ServiceParams></ServiceParams>')
->children('ServiceParams')
->append('<CardNumber>' . $info['card_num'] . '</CardNumber>')
->append('<DateOfBirth>' . $info['dob'] . '</DateOfBirth>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment