Problem/Motivation

Entering an invalid / non-existing coupon code currently isn't handled correctly. Instead a hard exception is shown!

GuzzleHttp\Exception\ClientException: Client error: `POST https://app.billwerk.com/api/v1/orders` resulted in a `422 Unprocessable Entity` response: {"Message":"CouponCode is invalid"} in GuzzleHttp\Exception\RequestException::create() (line 111 of /vendor/guzzlehttp/guzzle/src/Exception/RequestException.php).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

anybody’s picture

Assigned: Unassigned » grevil
Status: Active » Needs review

anybody changed the visibility of the branch 3585808-entering-an-invalid-coupon-code-fix-exception to hidden.

anybody’s picture

@grevil tested this and works as expected! Please check carefully for any stupid typo's in the unrelated changes I found.

Slightly off-topic hint: We need to be SUPER CAREFUL:
I thought this was thie right documentation now, as it directly contianed the expected function:
https://docs.frisbii.com/reference/validatecode
but it is NOT! It's the former reepay (acquired by Billwerk) API which is much better (but not matching!!) https://docs.frisbii.com/reference/introduction

So this is the docs we need to use:
https://docs.frisbii-transform.com/reference/coupons_getlist_from_coupon...

grevil made their first commit to this issue’s fork.

grevil’s picture

Assigned: grevil » Unassigned
Status: Needs review » Reviewed & tested by the community

Just some minor final adjustments. Otherwise LGTM!

  • grevil committed 72a82b24 on 1.x authored by anybody
    feat: #3585808 Entering an invalid coupon code results in an exception
    
grevil’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • anybody committed 71e4c133 on 1.x
    feat: #3585808 Entering an invalid coupon code results in an exception...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.