I am trying to setup a subscription for a connect account. My flow is create the customer:
$customer = \Stripe\Customer::create([
'description' => "Product",
], ['stripe_account' => $configuration['StripeKey']]);
Then I create the PaymentIntent:
$intent = \Stripe\PaymentIntent::create([
'amount' => $price,
'currency' => $configuration['Currency'],
'customer' => $customer->id,
], ['stripe_account' => $configuration['StripeKey']]);
The customer enters their card details and the card is successfully applied to the customer. However I need to set the card as default in order to create a subscription for the customer but when retrieving the paymentIntent with:
$pm = \Stripe\PaymentIntent::retrieve($_POST['payment_intent'], ['stripe_account' => $configuration['StripeKey']]);
The payment_method shows as null despite there being a payment method in the dashboard.
Where am I going wrong here?