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


PHP Braintree_Subscription::find方法代碼示例

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


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

示例1: testFind_throwsIfNotFound

 function testFind_throwsIfNotFound()
 {
     $this->setExpectedException('Braintree_Exception_NotFound', 'subscription with id does-not-exist not found');
     Braintree_Subscription::find('does-not-exist');
 }
開發者ID:robelkin,項目名稱:braintree_php,代碼行數:5,代碼來源:SubscriptionTest.php

示例2: getSubscriptions

 /**
  * wrapper for getting subscriptions from braintree
  * @param object - user
  * @param string - id of the subscription (default null)
  *
  * @return object - the searched subscriptions OR null if not found OR collection of subscriptions
  */
 private static function getSubscriptions($user, $subscriptionId = null)
 {
     self::setBraintreeCredentials($user);
     $returnVariable = null;
     if ($subscriptionId) {
         try {
             $returnVariable = Braintree_Subscription::find($subscriptionId);
         } catch (Exception $e) {
             return null;
         }
     } else {
         $returnVariable = Braintree_Subscription::search(array(Braintree_SubscriptionSearch::status()->in(array(Braintree_Subscription::ACTIVE, Braintree_Subscription::PAST_DUE, Braintree_Subscription::PENDING))));
     }
     return $returnVariable;
 }
開發者ID:neraunzaran,項目名稱:fruit-dashboard,代碼行數:22,代碼來源:BraintreeHelper.php

示例3: testErrorsOnFindWithWhitespaceArgument

 function testErrorsOnFindWithWhitespaceArgument()
 {
     $this->setExpectedException('InvalidArgumentException');
     Braintree_Subscription::find('\\t');
 }
開發者ID:robelkin,項目名稱:braintree_php,代碼行數:5,代碼來源:SubscriptionTest.php

示例4: catch

<?php

include '../brainTreePhp/lib/Braintree.php';
if (isset($_GET['subscription'])) {
    $subscription = $_GET['subscription'];
} else {
    //echo 'Missing subscription ID!';
    echo "0";
    die;
}
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('zn8d4c74dbnp5ntw');
Braintree_Configuration::publicKey('ttwrprnsj83thjjz');
Braintree_Configuration::privateKey('a818cb5f3164585f31f4f03066f308c8');
try {
    $subscription = Braintree_Subscription::find($subscription);
} catch (Braintree_Exception_NotFound $e) {
    //header('Location: ../response.html');
    echo "0";
    die;
}
if ($subscription->status == Braintree_Subscription::ACTIVE) {
    //header('Location: ../app.html');
    echo "1";
} else {
    //header('Location: ../response.html');
    echo "0";
}
開發者ID:concertianteam,項目名稱:concertian-1.0,代碼行數:28,代碼來源:checkoutValidation.php


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