diff --git a/services/nginx/app/openapi.yaml b/services/nginx/app/openapi.yaml index d2ddec12..7b463236 100644 --- a/services/nginx/app/openapi.yaml +++ b/services/nginx/app/openapi.yaml @@ -10344,8 +10344,11 @@ paths: post: tags: - Modules - summary: Create Stripe invoice - description: Create an invoice in Stripe + summary: Create Stripe invoice (retired - TRU-74 / DRIFT 13) + description: | + Retired in favour of in-store card payments. Always returns HTTP 410 + with `code: stripe_email_payment_disabled` so the POS can fall back + to the standard card-payment flow. operationId: createStripeInvoice requestBody: required: false @@ -10353,11 +10356,41 @@ paths: application/json: schema: {} responses: - '201': - description: Stripe invoice created successfully + '410': + description: Direct Stripe payment links by email are no longer available content: application/json: - schema: {} + schema: + type: object + properties: + code: + type: string + example: stripe_email_payment_disabled + message: + type: string + delete: + tags: + - Modules + summary: Cancel/clean up a legacy Stripe hosted invoice + description: | + Void a pre-existing Stripe hosted invoice that was created before + direct payment links were retired from POS (TRU-74 / DRIFT 13). + Card payments created via the new flow are not affected and use + the standard payment-intent lifecycle instead. + operationId: cancelLegacyStripeInvoice + parameters: + - name: order_id + in: query + required: true + schema: + type: integer + responses: + '200': + description: Legacy Stripe hosted invoice was voided + content: + application/json: + schema: + type: object /modules/stripe/terminal/readers: get: diff --git a/services/nginx/app/tests/Unit/Stripe/ModuleStripePaymentLinkRetirementOpenApiTest.php b/services/nginx/app/tests/Unit/Stripe/ModuleStripePaymentLinkRetirementOpenApiTest.php new file mode 100644 index 00000000..8b09447c --- /dev/null +++ b/services/nginx/app/tests/Unit/Stripe/ModuleStripePaymentLinkRetirementOpenApiTest.php @@ -0,0 +1,28 @@ +not->toBeFalse(); + + $needle = " /modules/stripe/invoice:"; + $start = strpos($contents, $needle); + expect($start)->not->toBeFalse(); + + $nextPathStart = strpos($contents, "\n /", $start + strlen($needle)); + if ($nextPathStart === false) { + $nextPathStart = strlen($contents); + } + + $block = substr($contents, $start, $nextPathStart - $start); + // Normalise trailing whitespace so the assertion is stable across editors. + $normalised = preg_replace('/[ \t]+$/m', '', $block); + + expect($normalised)->toContain(" /modules/stripe/invoice:"); + expect($normalised)->toContain('summary: Create Stripe invoice (retired - TRU-74 / DRIFT 13)'); + expect($normalised)->toContain("'410':"); + expect($normalised)->toContain('stripe_email_payment_disabled'); + expect($normalised)->toContain('Cancel/clean up a legacy Stripe hosted invoice'); + expect($normalised)->toContain('cancelLegacyStripeInvoice'); +});