Edge-case: Canceling a subscription requires valid payment data

Created on 20 April 2024, 12 months ago
Updated 7 May 2024, 12 months ago

Problem/Motivation

When canceling an existing subscription (CB Addon in this case) at /user/subscription/cancel, but the user has no existing payment data, the cancelation fails with the following message:

GuzzleHttp\Exception\ClientException: Client error: `POST https://app.billwerk.com/api/v1/orders/xxxxxxx/commit` resulted in a `422 Unprocessable Entity` response: {"Message":"Valid payment data required for up-/downgrade"} in GuzzleHttp\Exception\RequestException::create() (Zeile 113 in /vendor/guzzlehttp/guzzle/src/Exception/RequestException.php).

This is an edge-case because typically there IS payment data for accounts with premium. But it can happen for imported.

Steps to reproduce

See above.

Proposed resolution

We need to show the payment form, if no payment data is yet present (especially relevant for existing imported accounts!)

Showing the payment form for cancelations should follow the same logic as the regular upgrade / downgrade.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024