diff --git a/studio/components/interfaces/Billing/AddNewPaymentMethodModal/AddNewPaymentMethodModal.tsx b/studio/components/interfaces/Billing/AddNewPaymentMethodModal/AddNewPaymentMethodModal.tsx index 6f4a927ea84..955c03ae1c5 100644 --- a/studio/components/interfaces/Billing/AddNewPaymentMethodModal/AddNewPaymentMethodModal.tsx +++ b/studio/components/interfaces/Billing/AddNewPaymentMethodModal/AddNewPaymentMethodModal.tsx @@ -30,6 +30,15 @@ const AddNewPaymentMethodModal: FC = ({ visible, returnUrl, onCancel }) = setIntent(undefined) const orgSlug = ui.selectedOrganization?.slug ?? '' const intent = await post(`${API_URL}/organizations/${orgSlug}/payments/setup-intent`, {}) + + if (intent.error) { + return ui.setNotification({ + category: 'error', + message: intent.error.message, + error: intent.error, + }) + } + setIntent(intent) } @@ -47,13 +56,13 @@ const AddNewPaymentMethodModal: FC = ({ visible, returnUrl, onCancel }) = onCancel={onCancel} className="PAYMENT" > -
+
{intent !== undefined ? ( ) : ( -
+
)}