#canopus1io

1 messages · Page 1 of 1 (latest)

sharp rivetBOT
tired portal
#

Huh, yeah that seems wrong. Do you have an example payment attempt I can look at that shows this happening? Specifically, a request ID would be ideal, but a Payment Intent ID is fine too.

Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request

placid temple
#

request id for the PaymentIntent, right?

#

create clone payment method: req_MkD8YUF4KNtoFM

create payment intent:
req_ZYKQqPJnbKpAw1

#

EDIT: fixed the request id for payment intent

tired portal
#

So, to clarify, you are just seeing that the mandate is only being revoked on the Payment Method clone, but you would expect it to also be revoked for the original Payment Method, correct?

placid temple
#

yes

tired portal
#

Okay, that's a completely valid flag. I think that's default behavior for now. I don't think that has anything to do with how your integration is set up, so I'll raise the issue to the product team and see if we can get them to look into revoking the mandate on all iterations of the Payment Method, as well as the 'parent' Payment Method

placid temple
#

also would be good to add documentation articles clearly stating that the mandates are revoked for certain payment failures, that's something that confused me when working on adding Direct Debit support, from my testing, these are the relevant failure_codes: ['no_account', 'account_closed', 'debit_not_authorized']

tired portal
#

I think I may have blocked out time to add that last time we chatted, but I'll double-check and make sure it's set up to be added

placid temple
#

to prevent user encountering errors as result of stripe.error.InvalidRequestError when trying to process payments with payment methods that have had the mandate revoked, i put metadata on the payment method:

if charge.failure_code in UNUSABLE_PAYMENT_METHOD_ERROR_CODES:
    if self._business.stripe_customers_on_platform:
        bad_payment_method = self._stripe_get_platform_payment_method_from_clone(
            charge.payment_method,
        )
    else:
        bad_payment_method = self._stripe_get_payment_method(
            None, charge.payment_method, skip_customer_validation=True
        )

    if bad_payment_method.metadata.get('status') != 'error':
        bad_payment_method.metadata['status'] = 'error'
        bad_payment_method.metadata['code'] = charge.failure_code
        bad_payment_method.metadata['message'] = charge.failure_message
        bad_payment_method.save()
#

would be nice if something like this was built in or at the very least instead of stripe.error.InvalidRequestError, use a different exception specific to payment methods (e.g. stripe.error.CardError)

#

maybe create a more generic exception for payment methods: stripe.error.PaymentMethodError

#

an example request for this:
req_wzcxvAXSc2diq4

tired portal
#

Yeah, 100%. I put in at least 1 request per week to improve error handling on some things. It seems that is often overlooked, so I'm happy to include that as part of the feedback to the product team (unfortunately I can only update the docs and not the API resources themselves)