Repository navigation
Releases
Releases · rasuvaeff/payments-testing
v0.1.1
Changed
- Accept
rasuvaeff/payments^0.2alongside^0.1. The 0.2.0 break —
claim-fencedWebhookEventStoreInterface— is in an API this package does
not touch; the fakes and the contract assertions build unchanged against
0.2.0, and the lowest-dependency job keeps covering 0.1.
v0.1.0
Initial release.
Added
- Deterministic in-memory fakes for the
rasuvaeff/paymentsgateway contracts:
FakePaymentGatewayplusFakeCaptureGateway,FakeConfirmGateway,
FakeCancelGatewayandFakeRefundGatewayfor the optional interfaces, all
configured through oneFakeGatewayConfigso a test states the outcome it
needs instead of scripting a provider. - Framework-agnostic contract assertions —
PaymentGatewayAssertions,
CaptureGatewayAssertions,ConfirmGatewayAssertions,
CancelGatewayAssertionsandRefundGatewayAssertions— that hold a real
adapter to the same contracts the fakes implement, and fail with
ContractViolationExceptionnaming the clause that broke. - Idempotency keys scope by the key alone. Scoping them by
OperationIdmade
the fakes accept a key collision across two operations that every real
provider refuses — the one direction a testing double must not be wrong in,
because the application bug then passes its tests and surfaces in production. assertCreateRefundIdempotency()holds refunds to the same three-part
contract as payments: replaying a key returns the original refund, a
different key starts a new one, and reusing a key with a changed amount is
refused. The probe steps the amount down wherever it can, so a gateway that
refuses it can only be refusing the key reuse rather than a balance it could
not cover.assertCreatePaymentIdempotency()checks all three halves of the contract:
replaying a key returns the original payment, a different key starts a new
one, and reusing a key with a changed request is refused. Checking only the
replay passes a gateway that ignores the key entirely and always answers with
the same reference.