當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Stripe_ApiRequestor::utf8方法代碼示例

本文整理匯總了PHP中Stripe_ApiRequestor::utf8方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stripe_ApiRequestor::utf8方法的具體用法?PHP Stripe_ApiRequestor::utf8怎麽用?PHP Stripe_ApiRequestor::utf8使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Stripe_ApiRequestor的用法示例。


在下文中一共展示了Stripe_ApiRequestor::utf8方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: instanceUrl

 /**
  * @return string The instance URL for this resource. It needs to be special
  *    cased because it doesn't fit into the standard resource pattern.
  */
 public function instanceUrl()
 {
     $id = $this['id'];
     if (!$id) {
         $class = get_class($this);
         $msg = "Could not determine which URL to request: {$class} instance " . "has invalid ID: {$id}";
         throw new Stripe_InvalidRequestError($msg, null);
     }
     if (isset($this['customer'])) {
         $parent = $this['customer'];
         $base = self::classUrl('Stripe_Customer');
     } else {
         if (isset($this['recipient'])) {
             $parent = $this['recipient'];
             $base = self::classUrl('Stripe_Recipient');
         } else {
             return null;
         }
     }
     $parent = Stripe_ApiRequestor::utf8($parent);
     $id = Stripe_ApiRequestor::utf8($id);
     $parentExtn = urlencode($parent);
     $extn = urlencode($id);
     return "{$base}/{$parentExtn}/cards/{$extn}";
 }
開發者ID:vilmark,項目名稱:vilmark_main,代碼行數:29,代碼來源:Card.php

示例2: retrieve

 public function retrieve($id, $params = null)
 {
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $base = $this['url'];
     $id = Stripe_ApiRequestor::utf8($id);
     $extn = urlencode($id);
     list($response, $apiKey) = $requestor->request('get', "{$base}/{$extn}", $params);
     return Stripe_Util::convertToStripeObject($response, $apiKey);
 }
開發者ID:danielcoats,項目名稱:schoolpress,代碼行數:9,代碼來源:List.php

示例3: retrieve

 public function retrieve($id, $params = null)
 {
     list($url, $params) = $this->extractPathAndUpdateParams($params);
     $requestor = new Stripe_ApiRequestor($this->_apiKey);
     $id = Stripe_ApiRequestor::utf8($id);
     $extn = urlencode($id);
     list($response, $apiKey) = $requestor->request('get', "{$url}/{$extn}", $params);
     return Stripe_Util::convertToStripeObject($response, $apiKey);
 }
開發者ID:hyrmedia,項目名稱:builderengine,代碼行數:9,代碼來源:List.php

示例4: instanceUrl

 public function instanceUrl()
 {
     $id = $this['id'];
     $class = get_class($this);
     if (!$id) {
         throw new Stripe_InvalidRequestError("Could not determine which URL to request: {$class} instance has invalid ID: {$id}");
     }
     $id = Stripe_ApiRequestor::utf8($id);
     $base = self::classUrl($class);
     $extn = urlencode($id);
     return "{$base}/{$extn}";
 }
開發者ID:macconsultinggroup,項目名稱:WordPress,代碼行數:12,代碼來源:ApiResource.php

示例5: testUtf8

 public function testUtf8()
 {
     // UTF-8 string
     $x = "é";
     $this->assertEqual(Stripe_ApiRequestor::utf8($x), $x);
     // Latin-1 string
     $x = "é";
     $this->assertEqual(Stripe_ApiRequestor::utf8($x), "é");
     // Not a string
     $x = TRUE;
     $this->assertEqual(Stripe_ApiRequestor::utf8($x), $x);
 }
開發者ID:JSpier,項目名稱:smacamp,代碼行數:12,代碼來源:ApiRequestorTest.php

示例6: instanceUrl

 public function instanceUrl()
 {
     $id = $this['id'];
     $class = get_class($this);
     if ($id === null) {
         $message = "Could not determine which URL to request: " . "{$class} instance has invalid ID: {$id}";
         throw new Stripe_InvalidRequestError($message, null);
     }
     $id = Stripe_ApiRequestor::utf8($id);
     $base = $this->_lsb('classUrl', $class);
     $extn = urlencode($id);
     return "{$base}/{$extn}";
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:13,代碼來源:ApiResource.php

示例7: instanceUrl

 /**
  * @return string The API URL for this Stripe subscription.
  */
 public function instanceUrl()
 {
     $id = $this['id'];
     $customer = $this['customer'];
     if (!$id) {
         throw new Stripe_InvalidRequestError("Could not determine which URL to request: " . "class instance has invalid ID: {$id}", null);
     }
     $id = Stripe_ApiRequestor::utf8($id);
     $customer = Stripe_ApiRequestor::utf8($customer);
     $base = self::classUrl('Stripe_Customer');
     $customerExtn = urlencode($customer);
     $extn = urlencode($id);
     return "{$base}/{$customerExtn}/subscriptions/{$extn}";
 }
開發者ID:vilmark,項目名稱:vilmark_main,代碼行數:17,代碼來源:Subscription.php

示例8: instanceUrl

 public function instanceUrl()
 {
     $id = $this['id'];
     $fee = $this['fee'];
     if (!$id) {
         throw new Stripe_InvalidRequestError("Could not determine which URL to request: " . "class instance has invalid ID: {$id}", null);
     }
     $id = Stripe_ApiRequestor::utf8($id);
     $fee = Stripe_ApiRequestor::utf8($fee);
     $base = self::classUrl('Stripe_ApplicationFee');
     $feeExtn = urlencode($fee);
     $extn = urlencode($id);
     return "{$base}/{$feeExtn}/refunds/{$extn}";
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:14,代碼來源:ApplicationFeeRefund.php

示例9: instanceUrl

 /**
  * @return string The instance URL for this resource. It needs to be special
  *    cased because it doesn't fit into the standard resource pattern.
  */
 public function instanceUrl()
 {
     $id = $this['id'];
     $customer = $this['customer'];
     $class = get_class($this);
     if (!$id) {
         $msg = "Could not determine which URL to request: {$class} instance " . "has invalid ID: {$id}";
         throw new Stripe_InvalidRequestError($msg, null);
     }
     $id = Stripe_ApiRequestor::utf8($id);
     $customer = Stripe_ApiRequestor::utf8($customer);
     $base = self::classUrl('Stripe_Customer');
     $customerExtn = urlencode($customer);
     $extn = urlencode($id);
     return "{$base}/{$customerExtn}/cards/{$extn}";
 }
開發者ID:chiho13,項目名稱:checkoutwizard,代碼行數:20,代碼來源:Card.php

示例10: instanceUrl

 public function instanceUrl()
 {
     $id = $this['id'];
     $class = get_class($this);
     if (!$id) {
         //throw new Stripe_InvalidRequestError("Could not determine which URL to request: $class instance has invalid ID: $id");
         try {
             throw new Stripe_InvalidRequestError(isset($error['message']) ? $error['message'] : null, $rcode, $rbody, $resp);
         } catch (Stripe_InvalidRequestError $e) {
             echo $e->getMessage();
         }
     }
     $id = Stripe_ApiRequestor::utf8($id);
     $base = self::classUrl($class);
     $extn = urlencode($id);
     return "{$base}/{$extn}";
 }
開發者ID:jacquesbagui,項目名稱:ofuz,代碼行數:17,代碼來源:ApiResource.php


注:本文中的Stripe_ApiRequestor::utf8方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。