mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-11 14:51:59 +00:00
83 - Promoting Charges to Objects
This commit is contained in:
@@ -16,7 +16,18 @@ trait PaymentGatewayContractTests
|
||||
});
|
||||
|
||||
$this->assertCount(1, $newCharges);
|
||||
$this->assertEquals(2500, $newCharges->sum());
|
||||
$this->assertEquals(2500, $newCharges->map->amount()->sum());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
function can_get_details_about_a_successful_charge()
|
||||
{
|
||||
$paymentGateway = $this->getPaymentGateway();
|
||||
|
||||
$charge = $paymentGateway->charge(2500, $paymentGateway->getValidTestToken('0000000000004242'));
|
||||
|
||||
$this->assertEquals('4242', $charge->cardLastFour());
|
||||
$this->assertEquals(2500, $charge->amount());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
@@ -50,6 +61,6 @@ trait PaymentGatewayContractTests
|
||||
});
|
||||
|
||||
$this->assertCount(2, $newCharges);
|
||||
$this->assertEquals([5000, 4000], $newCharges->all());
|
||||
$this->assertEquals([5000, 4000], $newCharges->map->amount()->all());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user