mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-14 18:53:06 +00:00
(revert changes made to StripePaymentGateway)
This commit is contained in:
@@ -23,7 +23,7 @@ class StripePaymentGateway implements PaymentGateway
|
|||||||
'currency' => 'usd',
|
'currency' => 'usd',
|
||||||
], ['api_key' => $this->apiKey]);
|
], ['api_key' => $this->apiKey]);
|
||||||
} catch (InvalidRequest $e) {
|
} catch (InvalidRequest $e) {
|
||||||
return false;
|
throw new PaymentFailedException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,15 @@ class StripePaymentGatewayTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function charges_with_an_invalid_payment_token_fail()
|
function charges_with_an_invalid_payment_token_fail()
|
||||||
{
|
{
|
||||||
$paymentGateway = new StripePaymentGateway(config('services.stripe.secret'));
|
try {
|
||||||
$result = $paymentGateway->charge(2500, 'invalid-payment-token');
|
$paymentGateway = new StripePaymentGateway(config('services.stripe.secret'));
|
||||||
$this->assertFalse($result);
|
$paymentGateway->charge(2500, 'invalid-payment-token');
|
||||||
|
} catch (PaymentFailedException $e) {
|
||||||
|
$this->assertCount(0, $this->newCharges());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fail("Charging with an invalid payment token did not throw a PaymentFailedException.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private function lastCharge()
|
private function lastCharge()
|
||||||
|
|||||||
Reference in New Issue
Block a user