6.7 - Replicating the Failure at the Unit Level

This commit is contained in:
Adam Wathan
2016-11-20 17:47:25 -05:00
parent 91672fef0b
commit 2b21f07aa2
3 changed files with 12 additions and 7 deletions

View File

@@ -20,7 +20,9 @@ class FakePaymentGateway implements PaymentGateway
public function charge($amount, $token)
{
if ($this->beforeFirstChargeCallback !== null) {
$this->beforeFirstChargeCallback->__invoke($this);
$callback = $this->beforeFirstChargeCallback;
$this->beforeFirstChargeCallback = null;
$callback($this);
}
if ($token !== $this->getValidTestToken()) {