#Sarvesh

1 messages · Page 1 of 1 (latest)

quaint havenBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

marble granite
#

What's your question

sturdy phoenix
#

I'm trying to call subscription APIs
AccountId: acct_1O7HDODqS2wlzBKD
ProductId: prod_Ov8we510MJb4kv
PriceId: price_1O7IejDqS2wlzBKD8aC2EPGZ
already created on Stripe dashboard and call API

$stripe->subscriptions->create([
'customer' => $stripeCustomerId,
'items' => [[
'price' => $stripePriceId,
]],
'metadata' => $metaData,
'payment_behavior' => 'default_incomplete',
'payment_settings' => ['save_default_payment_method' => 'on_subscription'],
'expand' => ['latest_invoice.payment_intent'],
]);

but getting error as No such price: 'price_1O7IejDqS2wlzBKD8aC2EPGZ'

#

what could be the reason?

#

customerId: cus_OvVErkDqiF6PjS

marble granite
#

That customer exists on acct_19whH8CpNdAy2T1b but the price exists on acct_1O7HDODqS2wlzBKD

#

Different accounts

sturdy phoenix
#

ok, so what I need to do?

marble granite
#

Price and customer need to exist on the same stripe account

#

You seem to be mixing accounts here

#

In fact all the objects need to exist on the same stripe account

sturdy phoenix
#

but I logged in to account acct_1O7HDODqS2wlzBKD and using its secret and public keys
and I can see the products created there

marble granite
#

But that customer exists on a different account

#

And the secret key you're using is for acct_19whH8CpNdAy2T1b

sturdy phoenix
#

yes, customer list is empty

#

ok, let me verify the accounts again

#

still in test mode subscription integration will work?

#

in restricted mode?

marble granite
#

You'd need to use test payment methods, but yeah

sturdy phoenix
#

customer also gets created under this?

marble granite
#

Never share secret keys publicly...

sturdy phoenix
#

$stripe = new StripeClient($stripeSecret);
$customer = $stripe->customers->create([
'email' => $companyData['company_data']['email'],
'name' => $companyData['company_data']['name'],
'metadata' => $metaData,
]);

marble granite
#

Did you see my above links?

#

Looks like acct_1O7HDODqS2wlzBKD is a connect account

#

You can't have some objects exist on the connect account and some on the platform

sturdy phoenix
#

ok, we do not need connect account

#

we only need subscriptions with monthly recurring payment to capture for our services, there will be 3-4 subscriptins packages

marble granite
#

Ok then don't use multiple accounts 😃

#

Just create all objects (prices, customers, etc) right on your platform account

sturdy phoenix
#

ok, strange how it is connecting to multiple accounts, as I am using keys of single account, Let me create new account and try again

marble granite
#

You must be passing stripe account header somewhere then

#

It doesn't magically use multiple accounts