• Resolved Phil

    (@owendevelopment)


    I have an issue with a recurring payment.

    My customer has paid 20+ times without issue, but then their card expired so they had to update their saved card with a new one. Once done, every renewal fails. I checked the debug logs and see this:

    [message] => The source src_xxx is attached to a different customer cus_xxx. Please charge the source using that customer.
    [param] => source
    [type] => invalid_request_error

    Is there any indication as to why this happens when a new card is added to the customer account for a subcription? The customer has never changed – they only added their new card.

    I’ve had another customer with the same issue previously and had to cancel their subscription manually so they could sign up again, but it would be more efficient to allow different cards to be added in their account – as they do expire – without having to reset their order up every time.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hey there @owendevelopment

    I have an issue with a recurring payment.

    How is this recurring payment handled? It sounds like that would need to be involved here.

    Thanks,

    Thread Starter Phil

    (@owendevelopment)

    Woocommerce Subscriptions

    But the error in the debug logs is on the WooCommerce Stripe Payment Gateway side. I enabled these logs in the Stripe Payments settings screen.

    The full error in the Stripe error log is (xxx swapped for real IDs):

    2019-06-11T10:35:19+00:00 DEBUG 
    ====Stripe Version: 4.2.0====
    ====Start Log====
    Error: stdClass Object
    (
        [error] => stdClass Object
            (
                [message] => The source src_xxx is attached to a different customer cus_xxx. Please charge the source using that customer.
                [param] => source
                [type] => invalid_request_error
            )
    
    )
    
    ====End Log====
    laceyrod

    (@laceyrod)

    Automattic Happiness Engineer

    Howdy!

    It sounds like based off of what you are describing, the old Source is not being detached from the Customer, and the new one being added perhaps attaches to a new Customer object.

    According to Stripe:

    When you update a Customer object that has a default source, this automatically detaches the existing source, and adds the provided source as the new default source.

    https://stripe.com/docs/sources/customers#attaching-a-source-to-an-existing-customer-object

    For some reason, it doesn’t seem like that’s happening in your case. You could look into detaching the old source (https://stripe.com/docs/sources/customers#detaching-a-source), but I agree with @dougaitken that the Subscription developers should probably take a look at this case so they can further investigate how the plugin is using the Customer/Source APIs in your particular case.

    Please submit a support request with them directly for the best help: https://woocommerce.com/my-account/marketplace-ticket-form/

    laceyrod

    (@laceyrod)

    Automattic Happiness Engineer

    Hi there,

    This thread has been inactive for a bit, so I’m going to mark it as Resolved now. Please feel free to open a new one if you have any further questions.

    Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The source src_XXX is attached to a different customer’ is closed to new replies.