コード例 #1
0
 public function testInvalidCredentials()
 {
     //    $this->expectException();
     Shippo::setApiKey('invalid');
     try {
         $address = Shippo_Address::create();
     } catch (Shippo_AuthenticationError $e) {
         $this->assertEqual(401, $e->getHttpStatus());
     }
 }
コード例 #2
0
 public static function getDefaultAddress()
 {
     parent::setTestApiKey();
     return Shippo_Address::create(array('object_purpose' => 'QUOTE', 'name' => 'John Smith', 'company' => 'Initech', 'street1' => 'Greene Rd.', 'street_no' => '6512', 'street2' => '', 'city' => 'Woodridge', 'state' => 'IL', 'zip' => '60517', 'country' => 'US', 'phone' => '123 353 2345', 'email' => '*****@*****.**', 'metadata' => 'Customer ID 234;234'));
 }