当前位置: 首页>>代码示例>>PHP>>正文


PHP authorizeFromEnv函数代码示例

本文整理汇总了PHP中authorizeFromEnv函数的典型用法代码示例。如果您正苦于以下问题:PHP authorizeFromEnv函数的具体用法?PHP authorizeFromEnv怎么用?PHP authorizeFromEnv使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了authorizeFromEnv函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCreate

 public function testCreate()
 {
     authorizeFromEnv();
     $c = Stripe_Coupon::create(array('percent_off' => 25, 'duration' => 'repeating', 'duration_in_months' => 5, 'id' => 'test_coupon'));
     $this->assertEqual('test_coupon', $c->id);
     $this->assertEqual(25, $c->percent_off);
 }
开发者ID:KillerDesigner,项目名称:OpenVBX-Plugin-Stripe,代码行数:7,代码来源:CouponTest.php

示例2: testRetrieve

 public function testRetrieve()
 {
     authorizeFromEnv();
     $c = Stripe_Charge::create(array('amount' => 100, 'currency' => 'usd', 'card' => array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015)));
     $d = Stripe_Charge::retrieve($c->id);
     $this->assertEqual($d->id, $c->id);
 }
开发者ID:bulats,项目名称:chef,代码行数:7,代码来源:ChargeTest.php

示例3: testRefund

 public function testRefund()
 {
     authorizeFromEnv();
     $c = Conekta_Charge::create(array('amount' => 2000, 'currency' => 'mxn', 'description' => 'Some desc', 'card' => array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015, 'cvc' => 123, 'name' => 'Mario Moreno')));
     $c->refund();
     $this->assertTrue($c->status == "refunded");
 }
开发者ID:mvalenciarmz,项目名称:PagosElectronicos-Conekta,代码行数:7,代码来源:ChargeTest.php

示例4: testCreate

 public function testCreate()
 {
     authorizeFromEnv();
     $id = 'test_coupon-' . self::randomString();
     $c = Conekta_Coupon::create(array('percent_off' => 25, 'duration' => 'repeating', 'duration_in_months' => 5, 'id' => $id));
     $this->assertEqual($id, $c->id);
     $this->assertEqual(25, $c->percent_off);
 }
开发者ID:mvalenciarmz,项目名称:PagosElectronicos-Conekta,代码行数:8,代码来源:CouponTest.php

示例5: testRetrieve

 public function testRetrieve()
 {
     authorizeFromEnv();
     $d = Stripe_Balance::retrieve();
     $this->assertEqual($d->object, "balance");
     $this->assertTrue(Stripe_Util::isList($d->available));
     $this->assertTrue(Stripe_Util::isList($d->pending));
 }
开发者ID:Friends-School-Atlanta,项目名称:Deployable-WordPress,代码行数:8,代码来源:BalanceTest.php

示例6: testRetrieve

 public function testRetrieve()
 {
     $recipient = self::createTestRecipient();
     authorizeFromEnv();
     $transfer = Conekta_Transfer::create(array('amount' => 100, 'currency' => 'usd', 'recipient' => $recipient->id));
     $reloaded = Conekta_Transfer::retrieve($transfer->id);
     $this->assertEqual($reloaded->id, $transfer->id);
 }
开发者ID:mvalenciarmz,项目名称:PagosElectronicos-Conekta,代码行数:8,代码来源:TransferTest.php

示例7: testRetrieve

 public function testRetrieve()
 {
     authorizeFromEnv();
     $d = Stripe_Account::retrieve();
     $this->assertEqual($d->email, "test+bindings@stripe.com");
     $this->assertEqual($d->charge_enabled, false);
     $this->assertEqual($d->details_submitted, false);
 }
开发者ID:Friends-School-Atlanta,项目名称:Deployable-WordPress,代码行数:8,代码来源:AccountTest.php

示例8: testUpcoming

 public function testUpcoming()
 {
     authorizeFromEnv();
     $c = Stripe_Customer::create(array('card' => array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015)));
     $invoice = Stripe_Invoice::upcoming(array('customer' => $c->id));
     $this->assertEqual($invoice->customer, $c->id);
     $this->assertEqual($invoice->attempted, false);
 }
开发者ID:KillerDesigner,项目名称:OpenVBX-Plugin-Stripe,代码行数:8,代码来源:InvoiceTest.php

示例9: testBadData

 public function testBadData()
 {
     authorizeFromEnv();
     try {
         CleverDistrict::all(array('asdf' => 25));
     } catch (CleverInvalidRequestError $e) {
         $this->assertEquals(400, $e->getHttpStatus());
     }
 }
开发者ID:clever,项目名称:clever-php,代码行数:9,代码来源:InvalidRequestErrorTest.php

示例10: testUpdateMetadataAll

 public function testUpdateMetadataAll()
 {
     authorizeFromEnv();
     $charge = Stripe_Charge::create(array('amount' => 100, 'currency' => 'usd', 'card' => array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015)));
     $charge->metadata = array('test' => 'foo bar');
     $charge->save();
     $updatedCharge = Stripe_Charge::retrieve($charge->id);
     $this->assertEqual('foo bar', $updatedCharge->metadata['test']);
 }
开发者ID:mickdane,项目名称:zidisha,代码行数:9,代码来源:ChargeTest.php

示例11: retrieveOrCreateCoupon

 /**
  * Verify that a coupon with a given ID exists, or create a new one if it does
  * not.
  */
 protected static function retrieveOrCreateCoupon($id)
 {
     authorizeFromEnv();
     try {
         $coupon = Stripe_Coupon::retrieve($id);
     } catch (Stripe_InvalidRequestError $exception) {
         $coupon = Stripe_Coupon::create(array('id' => $id, 'duration' => 'forever', 'percent_off' => 25));
     }
 }
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:13,代码来源:TestCase.php

示例12: testBadData

 public function testBadData()
 {
     authorizeFromEnv();
     try {
         Stripe_Charge::create();
     } catch (Stripe_InvalidRequestError $e) {
         $this->assertEqual(400, $e->getHttpStatus());
     }
 }
开发者ID:JSpier,项目名称:smacamp,代码行数:9,代码来源:InvalidRequestErrorTest.php

示例13: testCount

 public function testCount()
 {
     authorizeFromEnv();
     $validQueries = array(array('count' => 'true'), array('count' => true));
     foreach ($validQueries as $query) {
         $resp = CleverStudent::all($query);
         $this->assertEquals($resp['count'] > 0, true);
     }
 }
开发者ID:clever,项目名称:clever-php,代码行数:9,代码来源:QueryParamTest.php

示例14: retrieveOrCreatePlan

 /**
  * Verify that a plan with a given ID exists, or create a new one if it does
  * not.
  */
 protected static function retrieveOrCreatePlan($id)
 {
     authorizeFromEnv();
     try {
         $plan = Plan::retrieve($id);
     } catch (InvalidRequestError $exception) {
         $plan = Plan::create(array('id' => $id, 'amount' => 0, 'currency' => 'usd', 'interval' => 'month', 'name' => 'Gold Test Plan'));
     }
 }
开发者ID:easybib,项目名称:stripe-php,代码行数:13,代码来源:TestCase.php

示例15: testUpcoming

 public function testUpcoming()
 {
     authorizeFromEnv();
     $customer = self::createTestCustomer();
     Stripe_InvoiceItem::create(array('customer' => $customer->id, 'amount' => 0, 'currency' => 'usd'));
     $invoice = Stripe_Invoice::upcoming(array('customer' => $customer->id));
     $this->assertEqual($invoice->customer, $customer->id);
     $this->assertEqual($invoice->attempted, false);
 }
开发者ID:bulats,项目名称:chef,代码行数:9,代码来源:InvoiceTest.php


注:本文中的authorizeFromEnv函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。