Пример #1
0
 public function testRetryCharge_WithAmount()
 {
     $subscription = SubscriptionHelper::createSubscription();
     $http = new Braintree\Http(Braintree\Configuration::$global);
     $path = Braintree\Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due';
     $http->put($path);
     $result = Braintree\Subscription::retryCharge($subscription->id, 1000);
     $this->assertTrue($result->success);
     $transaction = $result->transaction;
     $this->assertEquals(1000, $transaction->amount);
     $this->assertNotNull($transaction->processorAuthorizationCode);
     $this->assertEquals(Braintree\Transaction::SALE, $transaction->type);
     $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status);
 }