github.com/stripe/stripe-go/v76@v76.25.0/setupattempt.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 import "encoding/json" 10 11 // Indicates the directions of money movement for which this payment method is intended to be used. 12 // 13 // Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. 14 type SetupAttemptFlowDirection string 15 16 // List of values that SetupAttemptFlowDirection can take 17 const ( 18 SetupAttemptFlowDirectionInbound SetupAttemptFlowDirection = "inbound" 19 SetupAttemptFlowDirectionOutbound SetupAttemptFlowDirection = "outbound" 20 ) 21 22 // For authenticated transactions: how the customer was authenticated by 23 // the issuing bank. 24 type SetupAttemptPaymentMethodDetailsCardThreeDSecureAuthenticationFlow string 25 26 // List of values that SetupAttemptPaymentMethodDetailsCardThreeDSecureAuthenticationFlow can take 27 const ( 28 SetupAttemptPaymentMethodDetailsCardThreeDSecureAuthenticationFlowChallenge SetupAttemptPaymentMethodDetailsCardThreeDSecureAuthenticationFlow = "challenge" 29 SetupAttemptPaymentMethodDetailsCardThreeDSecureAuthenticationFlowFrictionless SetupAttemptPaymentMethodDetailsCardThreeDSecureAuthenticationFlow = "frictionless" 30 ) 31 32 // The Electronic Commerce Indicator (ECI). A protocol-level field 33 // indicating what degree of authentication was performed. 34 type SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator string 35 36 // List of values that SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator can take 37 const ( 38 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator01 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator = "01" 39 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator02 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator = "02" 40 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator05 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator = "05" 41 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator06 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator = "06" 42 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator07 SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator = "07" 43 ) 44 45 // Indicates the outcome of 3D Secure authentication. 46 type SetupAttemptPaymentMethodDetailsCardThreeDSecureResult string 47 48 // List of values that SetupAttemptPaymentMethodDetailsCardThreeDSecureResult can take 49 const ( 50 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultAttemptAcknowledged SetupAttemptPaymentMethodDetailsCardThreeDSecureResult = "attempt_acknowledged" 51 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultAuthenticated SetupAttemptPaymentMethodDetailsCardThreeDSecureResult = "authenticated" 52 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultExempted SetupAttemptPaymentMethodDetailsCardThreeDSecureResult = "exempted" 53 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultFailed SetupAttemptPaymentMethodDetailsCardThreeDSecureResult = "failed" 54 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultNotSupported SetupAttemptPaymentMethodDetailsCardThreeDSecureResult = "not_supported" 55 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultProcessingError SetupAttemptPaymentMethodDetailsCardThreeDSecureResult = "processing_error" 56 ) 57 58 // Additional information about why 3D Secure succeeded or failed based 59 // on the `result`. 60 type SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason string 61 62 // List of values that SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason can take 63 const ( 64 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReasonAbandoned SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason = "abandoned" 65 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReasonBypassed SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason = "bypassed" 66 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReasonCanceled SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason = "canceled" 67 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReasonCardNotEnrolled SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason = "card_not_enrolled" 68 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReasonNetworkNotSupported SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason = "network_not_supported" 69 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReasonProtocolError SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason = "protocol_error" 70 SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReasonRejected SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason = "rejected" 71 ) 72 73 // The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. 74 type SetupAttemptPaymentMethodDetailsCardWalletType string 75 76 // List of values that SetupAttemptPaymentMethodDetailsCardWalletType can take 77 const ( 78 SetupAttemptPaymentMethodDetailsCardWalletTypeApplePay SetupAttemptPaymentMethodDetailsCardWalletType = "apple_pay" 79 SetupAttemptPaymentMethodDetailsCardWalletTypeGooglePay SetupAttemptPaymentMethodDetailsCardWalletType = "google_pay" 80 SetupAttemptPaymentMethodDetailsCardWalletTypeLink SetupAttemptPaymentMethodDetailsCardWalletType = "link" 81 ) 82 83 // The type of the payment method used in the SetupIntent (e.g., `card`). An additional hash is included on `payment_method_details` with a name matching this value. It contains confirmation-specific information for the payment method. 84 type SetupAttemptPaymentMethodDetailsType string 85 86 // List of values that SetupAttemptPaymentMethodDetailsType can take 87 const ( 88 SetupAttemptPaymentMethodDetailsTypeCard SetupAttemptPaymentMethodDetailsType = "card" 89 ) 90 91 // Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. 92 type SetupAttemptStatus string 93 94 // List of values that SetupAttemptStatus can take 95 const ( 96 SetupAttemptStatusAbandoned SetupAttemptStatus = "abandoned" 97 SetupAttemptStatusFailed SetupAttemptStatus = "failed" 98 SetupAttemptStatusProcessing SetupAttemptStatus = "processing" 99 SetupAttemptStatusRequiresAction SetupAttemptStatus = "requires_action" 100 SetupAttemptStatusRequiresConfirmation SetupAttemptStatus = "requires_confirmation" 101 SetupAttemptStatusSucceeded SetupAttemptStatus = "succeeded" 102 ) 103 104 // The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. 105 type SetupAttemptUsage string 106 107 // List of values that SetupAttemptUsage can take 108 const ( 109 SetupAttemptUsageOffSession SetupAttemptUsage = "off_session" 110 SetupAttemptUsageOnSession SetupAttemptUsage = "on_session" 111 ) 112 113 // Returns a list of SetupAttempts that associate with a provided SetupIntent. 114 type SetupAttemptListParams struct { 115 ListParams `form:"*"` 116 // A filter on the list, based on the object `created` field. The value 117 // can be a string with an integer Unix timestamp or a 118 // dictionary with a number of different query options. 119 Created *int64 `form:"created"` 120 // A filter on the list, based on the object `created` field. The value 121 // can be a string with an integer Unix timestamp or a 122 // dictionary with a number of different query options. 123 CreatedRange *RangeQueryParams `form:"created"` 124 // Specifies which fields in the response should be expanded. 125 Expand []*string `form:"expand"` 126 // Only return SetupAttempts created by the SetupIntent specified by 127 // this ID. 128 SetupIntent *string `form:"setup_intent"` 129 } 130 131 // AddExpand appends a new field to expand. 132 func (p *SetupAttemptListParams) AddExpand(f string) { 133 p.Expand = append(p.Expand, &f) 134 } 135 136 type SetupAttemptPaymentMethodDetailsACSSDebit struct{} 137 type SetupAttemptPaymentMethodDetailsAUBECSDebit struct{} 138 type SetupAttemptPaymentMethodDetailsBACSDebit struct{} 139 type SetupAttemptPaymentMethodDetailsBancontact struct { 140 // Bank code of bank associated with the bank account. 141 BankCode string `json:"bank_code"` 142 // Name of the bank associated with the bank account. 143 BankName string `json:"bank_name"` 144 // Bank Identifier Code of the bank associated with the bank account. 145 BIC string `json:"bic"` 146 // The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. 147 GeneratedSEPADebit *PaymentMethod `json:"generated_sepa_debit"` 148 // The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. 149 GeneratedSEPADebitMandate *Mandate `json:"generated_sepa_debit_mandate"` 150 // Last four characters of the IBAN. 151 IBANLast4 string `json:"iban_last4"` 152 // Preferred language of the Bancontact authorization page that the customer is redirected to. 153 // Can be one of `en`, `de`, `fr`, or `nl` 154 PreferredLanguage string `json:"preferred_language"` 155 // Owner's verified full name. Values are verified or provided by Bancontact directly 156 // (if supported) at the time of authorization or settlement. They cannot be set or mutated. 157 VerifiedName string `json:"verified_name"` 158 } 159 type SetupAttemptPaymentMethodDetailsBoleto struct{} 160 161 // Check results by Card networks on Card address and CVC at the time of authorization 162 type SetupAttemptPaymentMethodDetailsCardChecks struct { 163 // If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. 164 AddressLine1Check string `json:"address_line1_check"` 165 // If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. 166 AddressPostalCodeCheck string `json:"address_postal_code_check"` 167 // If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. 168 CVCCheck string `json:"cvc_check"` 169 } 170 171 // Populated if this authorization used 3D Secure authentication. 172 type SetupAttemptPaymentMethodDetailsCardThreeDSecure struct { 173 // For authenticated transactions: how the customer was authenticated by 174 // the issuing bank. 175 AuthenticationFlow SetupAttemptPaymentMethodDetailsCardThreeDSecureAuthenticationFlow `json:"authentication_flow"` 176 // The Electronic Commerce Indicator (ECI). A protocol-level field 177 // indicating what degree of authentication was performed. 178 ElectronicCommerceIndicator SetupAttemptPaymentMethodDetailsCardThreeDSecureElectronicCommerceIndicator `json:"electronic_commerce_indicator"` 179 // Indicates the outcome of 3D Secure authentication. 180 Result SetupAttemptPaymentMethodDetailsCardThreeDSecureResult `json:"result"` 181 // Additional information about why 3D Secure succeeded or failed based 182 // on the `result`. 183 ResultReason SetupAttemptPaymentMethodDetailsCardThreeDSecureResultReason `json:"result_reason"` 184 // The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID 185 // (dsTransId) for this payment. 186 TransactionID string `json:"transaction_id"` 187 // The version of 3D Secure that was used. 188 Version string `json:"version"` 189 } 190 type SetupAttemptPaymentMethodDetailsCardWalletApplePay struct{} 191 type SetupAttemptPaymentMethodDetailsCardWalletGooglePay struct{} 192 193 // If this Card is part of a card wallet, this contains the details of the card wallet. 194 type SetupAttemptPaymentMethodDetailsCardWallet struct { 195 ApplePay *SetupAttemptPaymentMethodDetailsCardWalletApplePay `json:"apple_pay"` 196 GooglePay *SetupAttemptPaymentMethodDetailsCardWalletGooglePay `json:"google_pay"` 197 // The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. 198 Type SetupAttemptPaymentMethodDetailsCardWalletType `json:"type"` 199 } 200 type SetupAttemptPaymentMethodDetailsCard struct { 201 // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. 202 Brand string `json:"brand"` 203 // Check results by Card networks on Card address and CVC at the time of authorization 204 Checks *SetupAttemptPaymentMethodDetailsCardChecks `json:"checks"` 205 // Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. 206 Country string `json:"country"` 207 // A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) 208 Description string `json:"description"` 209 // Two-digit number representing the card's expiration month. 210 ExpMonth int64 `json:"exp_month"` 211 // Four-digit number representing the card's expiration year. 212 ExpYear int64 `json:"exp_year"` 213 // Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. 214 // 215 // *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* 216 Fingerprint string `json:"fingerprint"` 217 // Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. 218 Funding string `json:"funding"` 219 // Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) 220 IIN string `json:"iin"` 221 // The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) 222 Issuer string `json:"issuer"` 223 // The last four digits of the card. 224 Last4 string `json:"last4"` 225 // Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. 226 Network string `json:"network"` 227 // Populated if this authorization used 3D Secure authentication. 228 ThreeDSecure *SetupAttemptPaymentMethodDetailsCardThreeDSecure `json:"three_d_secure"` 229 // If this Card is part of a card wallet, this contains the details of the card wallet. 230 Wallet *SetupAttemptPaymentMethodDetailsCardWallet `json:"wallet"` 231 } 232 233 // Details about payments collected offline. 234 type SetupAttemptPaymentMethodDetailsCardPresentOffline struct { 235 // Time at which the payment was collected while offline 236 StoredAt int64 `json:"stored_at"` 237 } 238 type SetupAttemptPaymentMethodDetailsCardPresent struct { 239 // The ID of the Card PaymentMethod which was generated by this SetupAttempt. 240 GeneratedCard *PaymentMethod `json:"generated_card"` 241 // Details about payments collected offline. 242 Offline *SetupAttemptPaymentMethodDetailsCardPresentOffline `json:"offline"` 243 } 244 type SetupAttemptPaymentMethodDetailsCashApp struct{} 245 type SetupAttemptPaymentMethodDetailsIDEAL struct { 246 // The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. 247 Bank string `json:"bank"` 248 // The Bank Identifier Code of the customer's bank. 249 BIC string `json:"bic"` 250 // The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. 251 GeneratedSEPADebit *PaymentMethod `json:"generated_sepa_debit"` 252 // The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. 253 GeneratedSEPADebitMandate *Mandate `json:"generated_sepa_debit_mandate"` 254 // Last four characters of the IBAN. 255 IBANLast4 string `json:"iban_last4"` 256 // Owner's verified full name. Values are verified or provided by iDEAL directly 257 // (if supported) at the time of authorization or settlement. They cannot be set or mutated. 258 VerifiedName string `json:"verified_name"` 259 } 260 type SetupAttemptPaymentMethodDetailsKlarna struct{} 261 type SetupAttemptPaymentMethodDetailsLink struct{} 262 type SetupAttemptPaymentMethodDetailsPaypal struct{} 263 type SetupAttemptPaymentMethodDetailsSEPADebit struct{} 264 type SetupAttemptPaymentMethodDetailsSofort struct { 265 // Bank code of bank associated with the bank account. 266 BankCode string `json:"bank_code"` 267 // Name of the bank associated with the bank account. 268 BankName string `json:"bank_name"` 269 // Bank Identifier Code of the bank associated with the bank account. 270 BIC string `json:"bic"` 271 // The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. 272 GeneratedSEPADebit *PaymentMethod `json:"generated_sepa_debit"` 273 // The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. 274 GeneratedSEPADebitMandate *Mandate `json:"generated_sepa_debit_mandate"` 275 // Last four characters of the IBAN. 276 IBANLast4 string `json:"iban_last4"` 277 // Preferred language of the Sofort authorization page that the customer is redirected to. 278 // Can be one of `en`, `de`, `fr`, or `nl` 279 PreferredLanguage string `json:"preferred_language"` 280 // Owner's verified full name. Values are verified or provided by Sofort directly 281 // (if supported) at the time of authorization or settlement. They cannot be set or mutated. 282 VerifiedName string `json:"verified_name"` 283 } 284 type SetupAttemptPaymentMethodDetailsUSBankAccount struct{} 285 type SetupAttemptPaymentMethodDetails struct { 286 ACSSDebit *SetupAttemptPaymentMethodDetailsACSSDebit `json:"acss_debit"` 287 AUBECSDebit *SetupAttemptPaymentMethodDetailsAUBECSDebit `json:"au_becs_debit"` 288 BACSDebit *SetupAttemptPaymentMethodDetailsBACSDebit `json:"bacs_debit"` 289 Bancontact *SetupAttemptPaymentMethodDetailsBancontact `json:"bancontact"` 290 Boleto *SetupAttemptPaymentMethodDetailsBoleto `json:"boleto"` 291 Card *SetupAttemptPaymentMethodDetailsCard `json:"card"` 292 CardPresent *SetupAttemptPaymentMethodDetailsCardPresent `json:"card_present"` 293 CashApp *SetupAttemptPaymentMethodDetailsCashApp `json:"cashapp"` 294 IDEAL *SetupAttemptPaymentMethodDetailsIDEAL `json:"ideal"` 295 Klarna *SetupAttemptPaymentMethodDetailsKlarna `json:"klarna"` 296 Link *SetupAttemptPaymentMethodDetailsLink `json:"link"` 297 Paypal *SetupAttemptPaymentMethodDetailsPaypal `json:"paypal"` 298 SEPADebit *SetupAttemptPaymentMethodDetailsSEPADebit `json:"sepa_debit"` 299 Sofort *SetupAttemptPaymentMethodDetailsSofort `json:"sofort"` 300 // The type of the payment method used in the SetupIntent (e.g., `card`). An additional hash is included on `payment_method_details` with a name matching this value. It contains confirmation-specific information for the payment method. 301 Type SetupAttemptPaymentMethodDetailsType `json:"type"` 302 USBankAccount *SetupAttemptPaymentMethodDetailsUSBankAccount `json:"us_bank_account"` 303 } 304 305 // A SetupAttempt describes one attempted confirmation of a SetupIntent, 306 // whether that confirmation is successful or unsuccessful. You can use 307 // SetupAttempts to inspect details of a specific attempt at setting up a 308 // payment method using a SetupIntent. 309 type SetupAttempt struct { 310 APIResource 311 // The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation. 312 Application *Application `json:"application"` 313 // If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. 314 // 315 // It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. 316 AttachToSelf bool `json:"attach_to_self"` 317 // Time at which the object was created. Measured in seconds since the Unix epoch. 318 Created int64 `json:"created"` 319 // The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. 320 Customer *Customer `json:"customer"` 321 // Indicates the directions of money movement for which this payment method is intended to be used. 322 // 323 // Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. 324 FlowDirections []SetupAttemptFlowDirection `json:"flow_directions"` 325 // Unique identifier for the object. 326 ID string `json:"id"` 327 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 328 Livemode bool `json:"livemode"` 329 // String representing the object's type. Objects of the same type share the same value. 330 Object string `json:"object"` 331 // The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation. 332 OnBehalfOf *Account `json:"on_behalf_of"` 333 // ID of the payment method used with this SetupAttempt. 334 PaymentMethod *PaymentMethod `json:"payment_method"` 335 PaymentMethodDetails *SetupAttemptPaymentMethodDetails `json:"payment_method_details"` 336 // The error encountered during this attempt to confirm the SetupIntent, if any. 337 SetupError *Error `json:"setup_error"` 338 // ID of the SetupIntent that this attempt belongs to. 339 SetupIntent *SetupIntent `json:"setup_intent"` 340 // Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. 341 Status SetupAttemptStatus `json:"status"` 342 // The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. 343 Usage SetupAttemptUsage `json:"usage"` 344 } 345 346 // SetupAttemptList is a list of SetupAttempts as retrieved from a list endpoint. 347 type SetupAttemptList struct { 348 APIResource 349 ListMeta 350 Data []*SetupAttempt `json:"data"` 351 } 352 353 // UnmarshalJSON handles deserialization of a SetupAttempt. 354 // This custom unmarshaling is needed because the resulting 355 // property may be an id or the full struct if it was expanded. 356 func (s *SetupAttempt) UnmarshalJSON(data []byte) error { 357 if id, ok := ParseID(data); ok { 358 s.ID = id 359 return nil 360 } 361 362 type setupAttempt SetupAttempt 363 var v setupAttempt 364 if err := json.Unmarshal(data, &v); err != nil { 365 return err 366 } 367 368 *s = SetupAttempt(v) 369 return nil 370 }