# Upgrading to 0.41.0

This page lists what changed since the previous release; see the [upgrade procedure](README.md).

Core and Outbox republish unchanged runtime, exports and SQL, and no package adds a
schema migration in this release.

## @openlup/platform

- Add the experimental `payments/testing` subpath with the existing conformance runner and a provider-neutral scripted transport fake. Optional safety fixtures exercise capability/refusal parity, network ambiguity, signed webhook replay, invalid money, partial amounts and chargebacks without live access. Existing adapter behavior and imports remain unchanged.
- Reserve the measured platform artifact budget for the next payments implementation part; individual feature rows share these caps.

Migration: `runPaymentAdapterConformance` now takes `readonly PaymentAdapterTestSubject[]`. That named type is the previous subject with its `verification` fixtures plus an optional `safety` member, so existing callers compile and run unchanged and need no action.

The Platform README section
[Test a payment adapter offline](https://github.com/openlup/openlup/blob/openlup-core-v1.4.0/packages/platform/README.md#test-a-payment-adapter-offline)
describes the kit and its optional `safety` scenarios.

## API changes

### `packages/platform/api/payments-testing.api.md`

Added declarations:

```ts nocheck
// API report diff: not compiled.
export declare function runPaymentAdapterConformance(subjects: readonly PaymentAdapterTestSubject[]): Promise<PaymentAdapterConformanceEvidence>;
export type PaymentWebhookFixture = {
export type PaymentTransportScenario = "timeout-before-dispatch" | "provider-5xx-before-dispatch" | "timeout-after-dispatch" | "redelivery-409";
export type PaymentTransportFixture = {
export interface PaymentAdapterSafetyScenarios {
export type PaymentAdapterTestSubject = PaymentAdapterConformanceSubject & {
export { runPaymentAdapterConformance } from "../adapterConformance.js";
export { createScriptedPaymentFake, ScriptedPaymentTransportError } from "./scriptedFake.js";
export type { ScriptedPaymentOutcome } from "./scriptedFake.js";
export type { PaymentAdapterSafetyScenarios, PaymentAdapterTestSubject, PaymentTransportScenario, PaymentTransportFixture, PaymentWebhookFixture } from "../paymentTestingScenarios.js";
export type ScriptedPaymentOutcome<T> = {
export declare class ScriptedPaymentTransportError extends Error {
export declare function createScriptedPaymentFake<Calls extends Record<string, unknown>>(): {
```

The report also lists the unchanged `dist/payments/contracts/` declaration files,
101 exported declaration lines, because the runner's subject and evidence types
reference the payment contracts. `@openlup/platform/payments/testing` exports none
of them, and the `payments/contracts` API report did not change.

### `packages/platform/api/payments.api.md`

Added declarations:

```ts nocheck
// API report diff: not compiled.
export declare function runPaymentAdapterConformance(subjects: readonly PaymentAdapterTestSubject[]): Promise<PaymentAdapterConformanceEvidence>;
export type PaymentWebhookFixture = {
export type PaymentTransportScenario = "timeout-before-dispatch" | "provider-5xx-before-dispatch" | "timeout-after-dispatch" | "redelivery-409";
export type PaymentTransportFixture = {
export interface PaymentAdapterSafetyScenarios {
export type PaymentAdapterTestSubject = PaymentAdapterConformanceSubject & {
export { runPaymentAdapterConformance } from "../adapterConformance.js";
export { createScriptedPaymentFake, ScriptedPaymentTransportError } from "./scriptedFake.js";
export type { ScriptedPaymentOutcome } from "./scriptedFake.js";
export type { PaymentAdapterSafetyScenarios, PaymentAdapterTestSubject, PaymentTransportScenario, PaymentTransportFixture, PaymentWebhookFixture } from "../paymentTestingScenarios.js";
export type ScriptedPaymentOutcome<T> = {
export declare class ScriptedPaymentTransportError extends Error {
export declare function createScriptedPaymentFake<Calls extends Record<string, unknown>>(): {
```

Removed declarations:

```ts nocheck
// API report diff: not compiled.
export declare function runPaymentAdapterConformance(subjects: readonly (PaymentAdapterConformanceSubject & {
```

`runPaymentAdapterConformance` now names its subject type `PaymentAdapterTestSubject`,
so the report also gained the declaration files that type reaches: the test
scenarios and the scripted fake. `@openlup/platform/payments` exports none of their
names; import them from `@openlup/platform/payments/testing`.
