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); }
public function retryChargeSubscription($subscriptionId, $amount) { $retryResult = Subscription::retryCharge($subscriptionId, $amount); if ($retryResult->success) { $result = Transaction::submitForSettlement($retryResult->transaction->id); return $result; } return $retryResult; }