#Vinny GG
1 messages · Page 1 of 1 (latest)
Hi 👋
What do you mean by that?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
This link only shows how signature recreation can be done. Do you have some docs on how this can be done using your API?
I'm doing the code in php
AFAIK we don't have an API to handle that. You would want to reach out to Support and get to our Billing Migrations team
config('settings.billing.stripe_secret')
);
$stripeNew = new \Stripe\StripeClient(
config('settings.billing.stripe_secret_eua')
);
foreach ($stripeOld->subscriptions->all()['data'] as $billing) {
$metadata = json_encode($billing['metadata']);
$metadata = json_decode($metadata, true);
$itemsData = json_encode($billing['items']);
$itemsData = json_decode($itemsData, true);
foreach ($itemsData['data'] as $key => $item) {
$priceData['price_data'] = [
'currency' => $item['price']['currency'],
'product' => $item['price']['product'],
'recurring' => [
'interval' => $item['price']['recurring']['interval'],
'interval_count' => $item['price']['recurring']['interval_count'],
]
];
if($item['price']['unit_amount'])
$priceData['price_data']['unit_amount'] = $item['price']['unit_amount'];
$items[$key] = [
$priceData,
];
}
$dataSubscription = [
'customer' => $billing['customer'],
'currency' => $billing['currency'],
'items' => $items,
'metadata' => $metadata,
'cancel_at_period_end' => $billing['cancel_at_period_end'],
'collection_method' => $billing['collection_method'],
'default_tax_rates' => $billing['default_tax_rates'],
];
if($billing['transfer_data'])
$dataSubscription['transfer_data'] = $billing['transfer_data'];
if($billing['trial_end'])
$dataSubscription['trial_end'] = $billing['trial_end'];
$newSubscriptionItem = $stripeNew->subscriptions->create([
$dataSubscription
]);
foreach ($stripeOld->subscriptionItems->all(['subscription' => $billing['id']])['data'] as $billingItem) {
// here create new subscription item
}
}
}```
I'm looking for the signature of the old account and creating a new signature, correct?
Only people from the migration team have this information?
I'm not sure what you mean by signature in this case. What API object and property does this correspond to?
I'm sorry I mean subscriptions
recreate them for new account
We recommend working with our migrations team rather than using the APIs. This ensures you don't have to recollect all your customer's payment information.
Okay how could I contact them?
You would start with Support at https://support.stripe.com and state that you want to migrate existing subscriptions. We also talk about this here: https://stripe.com/docs/billing/subscriptions/migrate-subscriptions
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
tanks