66import json
77import base64
88import hashlib
9- from typing import Union
9+ from typing import Any , Union , cast
1010from datetime import datetime , timezone , timedelta
1111from typing_extensions import Literal
1212
@@ -1193,7 +1193,10 @@ def web_provision(
11931193 self ,
11941194 card_token : str ,
11951195 * ,
1196- digital_wallet : Literal ["APPLE_PAY" ] | Omit = omit ,
1196+ client_device_id : str | Omit = omit ,
1197+ client_wallet_account_id : str | Omit = omit ,
1198+ digital_wallet : Literal ["APPLE_PAY" , "GOOGLE_PAY" ] | Omit = omit ,
1199+ server_session_id : str | Omit = omit ,
11971200 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11981201 # The extra values given here take precedence over values defined on the client or passed to this method.
11991202 extra_headers : Headers | None = None ,
@@ -1210,8 +1213,17 @@ def web_provision(
12101213 for more information.
12111214
12121215 Args:
1216+ client_device_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
1217+ Provisioning device identifier required for the tokenization flow
1218+
1219+ client_wallet_account_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
1220+ Provisioning wallet account identifier required for the tokenization flow
1221+
12131222 digital_wallet: Name of digital wallet provider.
12141223
1224+ server_session_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
1225+ Provisioning session identifier required for the FPAN flow.
1226+
12151227 extra_headers: Send extra headers
12161228
12171229 extra_query: Add additional query parameters to the request
@@ -1222,13 +1234,26 @@ def web_provision(
12221234 """
12231235 if not card_token :
12241236 raise ValueError (f"Expected a non-empty value for `card_token` but received { card_token !r} " )
1225- return self ._post (
1226- f"/v1/cards/{ card_token } /web_provision" ,
1227- body = maybe_transform ({"digital_wallet" : digital_wallet }, card_web_provision_params .CardWebProvisionParams ),
1228- options = make_request_options (
1229- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1237+ return cast (
1238+ CardWebProvisionResponse ,
1239+ self ._post (
1240+ f"/v1/cards/{ card_token } /web_provision" ,
1241+ body = maybe_transform (
1242+ {
1243+ "client_device_id" : client_device_id ,
1244+ "client_wallet_account_id" : client_wallet_account_id ,
1245+ "digital_wallet" : digital_wallet ,
1246+ "server_session_id" : server_session_id ,
1247+ },
1248+ card_web_provision_params .CardWebProvisionParams ,
1249+ ),
1250+ options = make_request_options (
1251+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
1252+ ),
1253+ cast_to = cast (
1254+ Any , CardWebProvisionResponse
1255+ ), # Union types cannot be passed in as arguments in the type system
12301256 ),
1231- cast_to = CardWebProvisionResponse ,
12321257 )
12331258
12341259
@@ -2354,7 +2379,10 @@ async def web_provision(
23542379 self ,
23552380 card_token : str ,
23562381 * ,
2357- digital_wallet : Literal ["APPLE_PAY" ] | Omit = omit ,
2382+ client_device_id : str | Omit = omit ,
2383+ client_wallet_account_id : str | Omit = omit ,
2384+ digital_wallet : Literal ["APPLE_PAY" , "GOOGLE_PAY" ] | Omit = omit ,
2385+ server_session_id : str | Omit = omit ,
23582386 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
23592387 # The extra values given here take precedence over values defined on the client or passed to this method.
23602388 extra_headers : Headers | None = None ,
@@ -2371,8 +2399,17 @@ async def web_provision(
23712399 for more information.
23722400
23732401 Args:
2402+ client_device_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
2403+ Provisioning device identifier required for the tokenization flow
2404+
2405+ client_wallet_account_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
2406+ Provisioning wallet account identifier required for the tokenization flow
2407+
23742408 digital_wallet: Name of digital wallet provider.
23752409
2410+ server_session_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
2411+ Provisioning session identifier required for the FPAN flow.
2412+
23762413 extra_headers: Send extra headers
23772414
23782415 extra_query: Add additional query parameters to the request
@@ -2383,15 +2420,26 @@ async def web_provision(
23832420 """
23842421 if not card_token :
23852422 raise ValueError (f"Expected a non-empty value for `card_token` but received { card_token !r} " )
2386- return await self ._post (
2387- f"/v1/cards/{ card_token } /web_provision" ,
2388- body = await async_maybe_transform (
2389- {"digital_wallet" : digital_wallet }, card_web_provision_params .CardWebProvisionParams
2390- ),
2391- options = make_request_options (
2392- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
2423+ return cast (
2424+ CardWebProvisionResponse ,
2425+ await self ._post (
2426+ f"/v1/cards/{ card_token } /web_provision" ,
2427+ body = await async_maybe_transform (
2428+ {
2429+ "client_device_id" : client_device_id ,
2430+ "client_wallet_account_id" : client_wallet_account_id ,
2431+ "digital_wallet" : digital_wallet ,
2432+ "server_session_id" : server_session_id ,
2433+ },
2434+ card_web_provision_params .CardWebProvisionParams ,
2435+ ),
2436+ options = make_request_options (
2437+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
2438+ ),
2439+ cast_to = cast (
2440+ Any , CardWebProvisionResponse
2441+ ), # Union types cannot be passed in as arguments in the type system
23932442 ),
2394- cast_to = CardWebProvisionResponse ,
23952443 )
23962444
23972445
0 commit comments