(task: BindCardTask)
| 196 | |
| 197 | |
| 198 | def _serialize_bind_card_task(task: BindCardTask) -> dict: |
| 199 | account_email = task.account.email if task.account else None |
| 200 | return { |
| 201 | "id": task.id, |
| 202 | "account_id": task.account_id, |
| 203 | "account_email": account_email, |
| 204 | "plan_type": task.plan_type, |
| 205 | "workspace_name": task.workspace_name, |
| 206 | "price_interval": task.price_interval, |
| 207 | "seat_quantity": task.seat_quantity, |
| 208 | "country": task.country, |
| 209 | "currency": task.currency, |
| 210 | "checkout_url": task.checkout_url, |
| 211 | "checkout_session_id": task.checkout_session_id, |
| 212 | "publishable_key": task.publishable_key, |
| 213 | "has_client_secret": bool(getattr(task, "client_secret", None)), |
| 214 | "checkout_source": task.checkout_source, |
| 215 | "bind_mode": task.bind_mode or "semi_auto", |
| 216 | "status": task.status, |
| 217 | "last_error": task.last_error, |
| 218 | "opened_at": task.opened_at.isoformat() if task.opened_at else None, |
| 219 | "last_checked_at": task.last_checked_at.isoformat() if task.last_checked_at else None, |
| 220 | "completed_at": task.completed_at.isoformat() if task.completed_at else None, |
| 221 | "created_at": task.created_at.isoformat() if task.created_at else None, |
| 222 | "updated_at": task.updated_at.isoformat() if task.updated_at else None, |
| 223 | } |
| 224 | |
| 225 | |
| 226 | def _extract_checkout_session_id_from_url(url: Optional[str]) -> Optional[str]: |
no outgoing calls
no test coverage detected