From d8f86c568d3b72c70c0a5b9bb674a86f2a5140fb Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Thu, 29 Dec 2016 16:23:58 -0500 Subject: [PATCH] 54 - Retrieving the Last Charge --- tests/unit/Billing/StripePaymentGatewayTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/Billing/StripePaymentGatewayTest.php b/tests/unit/Billing/StripePaymentGatewayTest.php index 9ea1ddb..07fb0fb 100644 --- a/tests/unit/Billing/StripePaymentGatewayTest.php +++ b/tests/unit/Billing/StripePaymentGatewayTest.php @@ -25,5 +25,11 @@ class StripePaymentGatewayTest extends TestCase $paymentGateway->charge(2500, $token); // Verify that the charge was completed successfully + $lastCharge = \Stripe\Charge::all( + ['limit' => 1], + ['api_key' => config('services.stripe.secret')] + )['data'][0]; + + $this->assertEquals(2500, $lastCharge->amount); } }