当前位置: 首页>>代码示例>>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;未经允许,请勿转载。