|
9 | 9 | __all__ = [ |
10 | 10 | "CardPayment", |
11 | 11 | "Element", |
| 12 | + "ElementCardAuthentication", |
| 13 | + "ElementCardAuthenticationChallenge", |
| 14 | + "ElementCardAuthenticationChallengeAttempt", |
12 | 15 | "ElementCardAuthorization", |
13 | 16 | "ElementCardAuthorizationNetworkDetails", |
14 | 17 | "ElementCardAuthorizationNetworkDetailsVisa", |
|
63 | 66 | ] |
64 | 67 |
|
65 | 68 |
|
| 69 | +class ElementCardAuthenticationChallengeAttempt(BaseModel): |
| 70 | + created_at: datetime |
| 71 | + """ |
| 72 | + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time of the Card |
| 73 | + Authentication Challenge Attempt. |
| 74 | + """ |
| 75 | + |
| 76 | + outcome: Literal["successful", "failed"] |
| 77 | + """The outcome of the Card Authentication Challenge Attempt. |
| 78 | +
|
| 79 | + - `successful` - The attempt was successful. |
| 80 | + - `failed` - The attempt was unsuccessful. |
| 81 | + """ |
| 82 | + |
| 83 | + |
| 84 | +class ElementCardAuthenticationChallenge(BaseModel): |
| 85 | + attempts: List[ElementCardAuthenticationChallengeAttempt] |
| 86 | + """Details about the challenge verification attempts, if any happened.""" |
| 87 | + |
| 88 | + created_at: datetime |
| 89 | + """ |
| 90 | + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card |
| 91 | + Authentication Challenge was started. |
| 92 | + """ |
| 93 | + |
| 94 | + one_time_code: str |
| 95 | + """The one-time code used for the Card Authentication Challenge.""" |
| 96 | + |
| 97 | + verification_method: Literal["text_message", "email", "none_available"] |
| 98 | + """The method used to verify the Card Authentication Challenge. |
| 99 | +
|
| 100 | + - `text_message` - The one-time code was sent via text message. |
| 101 | + - `email` - The one-time code was sent via email. |
| 102 | + - `none_available` - The one-time code was not successfully delievered. |
| 103 | + """ |
| 104 | + |
| 105 | + verification_value: Optional[str] = None |
| 106 | + """ |
| 107 | + E.g., the email address or phone number used for the Card Authentication |
| 108 | + Challenge. |
| 109 | + """ |
| 110 | + |
| 111 | + |
| 112 | +class ElementCardAuthentication(BaseModel): |
| 113 | + id: str |
| 114 | + """The Card Authentication identifier.""" |
| 115 | + |
| 116 | + card_id: str |
| 117 | + """The identifier of the Card.""" |
| 118 | + |
| 119 | + card_payment_id: str |
| 120 | + """The ID of the Card Payment this transaction belongs to.""" |
| 121 | + |
| 122 | + category: Optional[Literal["payment_authentication", "non_payment_authentication"]] = None |
| 123 | + """The category of the card authentication attempt. |
| 124 | +
|
| 125 | + - `payment_authentication` - The authentication attempt is for a payment. |
| 126 | + - `non_payment_authentication` - The authentication attempt is not for a |
| 127 | + payment. |
| 128 | + """ |
| 129 | + |
| 130 | + challenge: Optional[ElementCardAuthenticationChallenge] = None |
| 131 | + """Details about the challenge, if one was requested.""" |
| 132 | + |
| 133 | + created_at: datetime |
| 134 | + """ |
| 135 | + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card |
| 136 | + Authentication was attempted. |
| 137 | + """ |
| 138 | + |
| 139 | + deny_reason: Optional[ |
| 140 | + Literal[ |
| 141 | + "group_locked", |
| 142 | + "card_not_active", |
| 143 | + "entity_not_active", |
| 144 | + "transaction_not_allowed", |
| 145 | + "webhook_denied", |
| 146 | + "webhook_timed_out", |
| 147 | + ] |
| 148 | + ] = None |
| 149 | + """The reason why this authentication attempt was denied, if it was. |
| 150 | +
|
| 151 | + - `group_locked` - The group was locked. |
| 152 | + - `card_not_active` - The card was not active. |
| 153 | + - `entity_not_active` - The entity was not active. |
| 154 | + - `transaction_not_allowed` - The transaction was not allowed. |
| 155 | + - `webhook_denied` - The webhook was denied. |
| 156 | + - `webhook_timed_out` - The webhook timed out. |
| 157 | + """ |
| 158 | + |
| 159 | + device_channel: Optional[Literal["app", "browser", "three_ds_requestor_initiated"]] = None |
| 160 | + """The device channel of the card authentication attempt. |
| 161 | +
|
| 162 | + - `app` - The authentication attempt was made from an app. |
| 163 | + - `browser` - The authentication attempt was made from a browser. |
| 164 | + - `three_ds_requestor_initiated` - The authentication attempt was initiated by |
| 165 | + the 3DS Requestor. |
| 166 | + """ |
| 167 | + |
| 168 | + merchant_acceptor_id: str |
| 169 | + """ |
| 170 | + The merchant identifier (commonly abbreviated as MID) of the merchant the card |
| 171 | + is transacting with. |
| 172 | + """ |
| 173 | + |
| 174 | + merchant_category_code: str |
| 175 | + """ |
| 176 | + The Merchant Category Code (commonly abbreviated as MCC) of the merchant the |
| 177 | + card is transacting with. |
| 178 | + """ |
| 179 | + |
| 180 | + merchant_country: str |
| 181 | + """The country the merchant resides in.""" |
| 182 | + |
| 183 | + merchant_name: str |
| 184 | + """The name of the merchant.""" |
| 185 | + |
| 186 | + purchase_amount: Optional[int] = None |
| 187 | + """The purchase amount in minor units.""" |
| 188 | + |
| 189 | + purchase_currency: Optional[str] = None |
| 190 | + """ |
| 191 | + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the |
| 192 | + authentication attempt's purchase currency. |
| 193 | + """ |
| 194 | + |
| 195 | + real_time_decision_id: Optional[str] = None |
| 196 | + """ |
| 197 | + The identifier of the Real-Time Decision sent to approve or decline this |
| 198 | + authentication attempt. |
| 199 | + """ |
| 200 | + |
| 201 | + status: Literal[ |
| 202 | + "denied", |
| 203 | + "authenticated_with_challenge", |
| 204 | + "authenticated_without_challenge", |
| 205 | + "awaiting_challenge", |
| 206 | + "validating_challenge", |
| 207 | + "canceled", |
| 208 | + "timed_out_awaiting_challenge", |
| 209 | + "errored", |
| 210 | + "exceeded_attempt_threshold", |
| 211 | + ] |
| 212 | + """The status of the card authentication. |
| 213 | +
|
| 214 | + - `denied` - The authentication attempt was denied. |
| 215 | + - `authenticated_with_challenge` - The authentication attempt was authenticated |
| 216 | + with a challenge. |
| 217 | + - `authenticated_without_challenge` - The authentication attempt was |
| 218 | + authenticated without a challenge. |
| 219 | + - `awaiting_challenge` - The authentication attempt is awaiting a challenge. |
| 220 | + - `validating_challenge` - The authentication attempt is validating a challenge. |
| 221 | + - `canceled` - The authentication attempt was canceled. |
| 222 | + - `timed_out_awaiting_challenge` - The authentication attempt timed out while |
| 223 | + awaiting a challenge. |
| 224 | + - `errored` - The authentication attempt errored. |
| 225 | + - `exceeded_attempt_threshold` - The authentication attempt exceeded the attempt |
| 226 | + threshold. |
| 227 | + """ |
| 228 | + |
| 229 | + type: Literal["card_authentication"] |
| 230 | + """A constant representing the object's type. |
| 231 | +
|
| 232 | + For this resource it will always be `card_authentication`. |
| 233 | + """ |
| 234 | + |
| 235 | + |
66 | 236 | class ElementCardAuthorizationNetworkDetailsVisa(BaseModel): |
67 | 237 | electronic_commerce_indicator: Optional[ |
68 | 238 | Literal[ |
@@ -2653,6 +2823,13 @@ class ElementCardValidation(BaseModel): |
2653 | 2823 |
|
2654 | 2824 |
|
2655 | 2825 | class Element(BaseModel): |
| 2826 | + card_authentication: Optional[ElementCardAuthentication] = None |
| 2827 | + """A Card Authentication object. |
| 2828 | +
|
| 2829 | + This field will be present in the JSON response if and only if `category` is |
| 2830 | + equal to `card_authentication`. |
| 2831 | + """ |
| 2832 | + |
2656 | 2833 | card_authorization: Optional[ElementCardAuthorization] = None |
2657 | 2834 | """A Card Authorization object. |
2658 | 2835 |
|
|
0 commit comments