coarchy / stripe

Stripe Component for Moqui based on Coarchy code written by Michael Jones
Other
0 stars 0 forks source link

In create#CheckoutFromSalesOrder, errors from the remote are not propagated to the moqui service call layer #6

Closed eigood closed 3 weeks ago

eigood commented 3 weeks ago

I was calling this service via the Tools>Service backend, and I set the successUrl="/test-success" and cancelUrl="/test-cancel". I then hit submit. Moqui thought the call was valid, and returned blank values for checkoutId/checkoutUrl. In the moqui log, I see this:

20:21:44.781  WARN 840083671-13           o.moqui.i.c.LoggerFacadeImpl Got status code 400 from Stripe on a create checkout session for the parameter 'invalid_request_error' and message 'Not a valid URL'
20:21:44.782  WARN 840083671-13           o.moqui.i.c.LoggerFacadeImpl Could not create Checkout

If the remote has an error, the service should also error out, so that the outer transaction fails, etc.

acetousk commented 3 weeks ago

The successUrl and cancelUrl need to be fully qualified uris with https://yourdomain.com/test-success

And a fair point

acetousk commented 3 weeks ago

This should be fixed with https://github.com/coarchy/stripe/commit/e3e6b52fe40dd370039dc2063b0a4c2487b3e943