You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.4 KiB
PHTML
25 lines
1.4 KiB
PHTML
10 years ago
|
<?php
|
||
|
namespace pdt256\Shipping\RateRequest;
|
||
|
|
||
|
class StubUSPS extends Adapter
|
||
|
{
|
||
|
private $artificial_delay = 0;
|
||
|
|
||
|
public function __construct($artificial_delay = 0)
|
||
|
{
|
||
|
$this->artificial_delay = $artificial_delay;
|
||
|
}
|
||
|
|
||
|
public function execute($url, $data = NULL)
|
||
|
{
|
||
|
if ($this->artificial_delay > 0) {
|
||
|
sleep($this->artificial_delay);
|
||
|
}
|
||
|
|
||
|
$response = '<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<RateV4Response><Package ID="1"><ZipOrigination>90401</ZipOrigination><ZipDestination>76667</ZipDestination><Pounds>3</Pounds><Ounces>0</Ounces><Size>LARGE</Size><Machinable>FALSE</Machinable><Zone>6</Zone><Postage CLASSID="3"><MailService>Priority Mail Express 2-Day&lt;sup&gt;&#8482;&lt;/sup&gt;</MailService><Rate>42.25</Rate></Postage><Postage CLASSID="2"><MailService>Priority Mail Express 2-Day&lt;sup&gt;&#8482;&lt;/sup&gt; Hold For Pickup</MailService><Rate>42.25</Rate></Postage><Postage CLASSID="1"><MailService>Priority Mail 2-Day&lt;sup&gt;&#8482;&lt;/sup&gt;</MailService><Rate>12.20</Rate></Postage><Postage CLASSID="4"><MailService>Standard Post&lt;sup&gt;&#174;&lt;/sup&gt;</MailService><Rate>10.01</Rate></Postage><Postage CLASSID="6"><MailService>Media Mail Parcel</MailService><Rate>3.65</Rate></Postage><Postage CLASSID="7"><MailService>Library Mail Parcel</MailService><Rate>3.48</Rate></Postage></Package></RateV4Response>';
|
||
|
|
||
|
return $response;
|
||
|
}
|
||
|
}
|