_get() публичный статический Метод

Request the URI, validate the response and return the object.
public static _get ( $uri, $client = null )
Пример #1
0
 public function testPassingClientToStub()
 {
     $this->client->addResponse('GET', 'abcdef1234567890', 'adjustments/show-200.xml');
     $adjustment = Recurly_Base::_get('abcdef1234567890', $this->client);
     $this->assertInstanceOf('Recurly_Adjustment', $adjustment);
     $invoice = $adjustment->invoice;
     $this->assertInstanceOf('Recurly_Stub', $invoice);
     $this->assertEquals(getProtectedProperty($invoice, '_client'), $this->client);
 }
Пример #2
0
 public function testFromNested()
 {
     $this->client->addResponse('GET', '/a-mock', 'pager/show-200.xml');
     $account = Recurly_Base::_get('/a-mock', $this->client);
     $this->assertInstanceOf('Recurly_Account', $account);
     $pager = $account->mocks;
     $this->assertInstanceOf('Mock_Pager', $pager);
     $this->assertNull($pager->getHref(), "Nested records shouldn't have a URL");
     $this->assertEquals(4, $pager->count(), 'Returns correct count');
     $this->assertIteratesCorrectly($pager, 4);
 }
Пример #3
0
 public function testPassingClientToStub()
 {
     $this->client->addResponse('GET', 'abcdef1234567890', 'adjustments/show-200.xml');
     $adjustment = Recurly_Base::_get('abcdef1234567890', $this->client);
     $this->assertInstanceOf('Recurly_Adjustment', $adjustment);
     $this->assertInstanceOf('Recurly_Stub', $adjustment->invoice);
     // The client is protected so we do a little song and dance to access it:
     $reflection = new \ReflectionClass($adjustment->invoice);
     $property = $reflection->getProperty('_client');
     $property->setAccessible(true);
     $this->assertEquals($property->getValue($adjustment->invoice), $this->client);
 }
Пример #4
0
 public static function fetch($token, $client = null)
 {
     $uri = Recurly_Client::PATH_RECURLY_JS_RESULT . '/' . rawurlencode($token);
     return Recurly_Base::_get($uri, $client);
 }
Пример #5
0
 public static function get($couponCode, $client = null)
 {
     return Recurly_Base::_get(Recurly_Coupon::uriForCoupon($couponCode), $client);
 }
 public static function get($planCode, $client = null)
 {
     return Recurly_Base::_get(Recurly_Plan::uriForPlan($planCode), $client);
 }
Пример #7
0
 public static function get($uuid, $client = null)
 {
     return Recurly_Base::_get(Recurly_Subscription::uriForSubscription($uuid), $client);
 }
Пример #8
0
 public static function get($accountCode, $client = null)
 {
     return Recurly_Base::_get(Recurly_BillingInfo::uriForBillingInfo($accountCode), $client);
 }
Пример #9
0
 /**
  * Get a gift card by the id
  */
 public static function get($giftCardId, $client = null)
 {
     return Recurly_Base::_get(Recurly_GiftCard::uriForGiftCard($giftCardId), $client);
 }
Пример #10
0
 public static function get($uuid, $client = null)
 {
     return Recurly_Base::_get(Recurly_Transaction::uriForTransaction($uuid), $client);
 }
 public static function get($accountCode, $client = null)
 {
     return Recurly_Base::_get(Recurly_AccountAcquisition::uriForAccountAcquisition($accountCode), $client);
 }
Пример #12
0
 public static function get($id, $client = null)
 {
     return Recurly_Base::_get(Recurly_MeasuredUnit::uriForMeasuredUnit($id), $client);
 }
Пример #13
0
 public static function get($accountCode, $client = null)
 {
     return Recurly_Base::_get(Recurly_NoteList::uriForNotes($accountCode), $client);
 }
Пример #14
0
 public static function get($subUuid, $addOnCode, $usageId, $client = null)
 {
     return Recurly_Base::_get(self::uriForUsage($subUuid, $addOnCode, $usageId), $client);
 }
Пример #15
0
 public static function get($accountCode, $client = null)
 {
     return Recurly_Base::_get(Recurly_CouponRedemption::uriForAccount($accountCode), $client);
 }
 public static function get($adjustment_uuid)
 {
     return Recurly_Base::_get(Recurly_Client::PATH_ADJUSTMENTS . '/' . rawurlencode($adjustment_uuid));
 }
Пример #17
0
 public static function get($planCode, $addonCode)
 {
     return Recurly_Base::_get(Recurly_Addon::uriForAddOn($planCode, $addonCode));
 }
Пример #18
0
 public static function get($accountCode, $client = null)
 {
     return Recurly_Base::_get(Recurly_Client::PATH_ACCOUNTS . '/' . rawurlencode($accountCode) . Recurly_Client::PATH_BALANCE, $client);
 }