FROM CACHE - en_header

BROKEN: customerPaymentMethodRemoteCreate (not creating Customer Payment Methods)

Solved
Brian_S
Shopify Partner
44 5 17

Hi - I've run through a bunch of migrations over the last few months and have scripts set up to take human error out but I seem to be hitting a wall today when trying to create Shopify customer payment methods from Stripe (which hasn't been a problem in the past). 

 

I've tried using both the deprecated method (customerPaymentMethodRemoteCreditCardCreate) and the latest version of it (customerPaymentMethodRemoteCreate) but both result in the same thing.  Both return the expected response. Something like this: 

 

{
  "data": {
    "customerPaymentMethodRemoteCreditCardCreate": {
      "customerPaymentMethod": {
        "id": "gid:\/\/shopify\/CustomerPaymentMethod\/419..................e03",
        "instrument": {
          "brand": "bogus"
        }
      }
    }
  }
}

 

 

but when I wait a bit and try to fetch the customerPaymentMethod with the Id provided, I get a null response every time.  

 

I've confirmed that the user has connected the payment gateway (Stripe): 

 

{
  "data": {
    "shop": {
      "features": {
        "eligibleForSubscriptions": true,
        "eligibleForSubscriptionMigration": true,
        "legacySubscriptionGatewayEnabled": true,
        "paypalExpressSubscriptionGatewayStatus": "ENABLED",
        "sellsSubscriptions": true
      }
    }
  }
}

 

 

I've looked here for any updates but besides the latest method I'm not seeing much that's new (I did notice the GQL example for creating payment methods is broken btw)

https://shopify.dev/apps/subscriptions/migrate/contracts#create-new-payment-methods-for-the-customer...

 

The only thing that seems off to me that I haven't seen before is that in the documentation for both mutations (new and deprecated) there's now this new required access scope write_customer_payment_methods that I don't even see listed in the AccessScope docs. But I've never needed that scope in the past.. 

 

My app hasn't changed scopes and subscription migrations have not been a problem until now. 

 

Any help would be appreciated! Thank you

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
awtomic.com
Accepted Solution (1)

Accepted Solutions
Brian_S
Shopify Partner
44 5 17

This is an accepted solution.

So it turns out that because they authorized Recharge in a different way on Stripe, when they followed the Shopify link to connect Stripe, their main account wasn't in the list to connect (bc Stripe only allows a single Authorized App). Unfortunately, they had an old unused Stripe account which did show up in the list so they just clicked that one. 

 

It wasn't until they screen shared and I could see that the Stripe acct id wasn't the right one that I knew they had it set up wrong

 

So in order to migrate then, they had to manually unauthorize Recharge in Stripe. Then we sent them the Shopify connect link, and then they saw their main account in the list. Once that was connected I was ablessings to migrate

 

Mystery solved 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
awtomic.com

View solution in original post

Replies 9 (9)
Brian_S
Shopify Partner
44 5 17

Update (STILL BROKEN): 

I requested the new access scope (write_customer_payment_methods) and then re-ran the mutation and still no payment method is being created. So that does not seem to be the issue (I have both required scopes listed for this mutation now (write_customer_payment_methods and write_customers)

 

 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
awtomic.com
JuanHoyos
Shopify Staff
Shopify Staff
23 0 3

Hello Brian_S, I'm requesting more information in a DM to help you with this.

Thanks for getting in touch.

Best,

Juan

tconnors
New Member
2 0 4

Hi - has there been any resolution?  I am facing the same issue.  Thank you for your help!

Brian_S
Shopify Partner
44 5 17

Nothing yet.

 

If/when I figure it out I'll post what the solution/cause was : )

 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
awtomic.com
tolicodes
New Member
1 0 0

We are also experiencing this issue! Can't migrate Stripe customers to our system because the payment method API is creating "bogus" cards. When we try to bill them, it says "payment method unavailable"

JuanHoyos
Shopify Staff
Shopify Staff
23 0 3

Hello tconnors and tolicodes,

Could you please DM me the shop id, the Stripe account of the merchant and one of the failing Stripe payment methods?

Best,

Juan

Brian_S
Shopify Partner
44 5 17

@tolicodes wrote:

We are also experiencing this issue! Can't migrate Stripe customers to our system because the payment method API is creating "bogus" cards. When we try to bill them, it says "payment method unavailable"


FYI @tolicodes - if when you request the payment method that you've created and you get any response (including "bogus") that is a slightly different issue. When I request the payment method I get a null response. 

 

If you're seeing bogus, based on my experience, it's bc the merchant did not connect their stripe account. Unless something in the Shopify API has changed since I saw this issue, if you try to migrate a payment method from stripe before the merchant has properly connected a stripe account, you'll get a new payment method but it'll have bogus card data. Not a very graceful way for Shopify to handle this. 😅 In all scripts I have that migrate payment methods, I confirm that the new payment method is not bogus (which can take some time bc it's an async creation method).

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
awtomic.com
Brian_S
Shopify Partner
44 5 17

This is an accepted solution.

So it turns out that because they authorized Recharge in a different way on Stripe, when they followed the Shopify link to connect Stripe, their main account wasn't in the list to connect (bc Stripe only allows a single Authorized App). Unfortunately, they had an old unused Stripe account which did show up in the list so they just clicked that one. 

 

It wasn't until they screen shared and I could see that the Stripe acct id wasn't the right one that I knew they had it set up wrong

 

So in order to migrate then, they had to manually unauthorize Recharge in Stripe. Then we sent them the Shopify connect link, and then they saw their main account in the list. Once that was connected I was ablessings to migrate

 

Mystery solved 

Brian Singer
CTO & Cofounder of Subscription Service - Awtomic
awtomic.com