0% found this document useful (0 votes)
12 views2 pages

Look Up

The document contains a Python script that makes a POST request to the Braintree API for a three-dimensional secure lookup of a payment method. It includes headers for the request and a JSON payload with billing information and metadata. The script uses the 'requests' library to send the request and handle the response.

Uploaded by

saraaed838282
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Look Up

The document contains a Python script that makes a POST request to the Braintree API for a three-dimensional secure lookup of a payment method. It includes headers for the request and a JSON payload with billing information and metadata. The script uses the 'requests' library to send the request and handle the response.

Uploaded by

saraaed838282
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import requests

headers = {
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9',
'content-type': 'application/json',
'origin': 'https://www.supadance.com',
'priority': 'u=1, i',
'referer': 'https://www.supadance.com/',
'sec-ch-ua': '"Google Chrome";v="131", "Chromium";v="131", "Not_A
Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'cross-site',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
}

json_data = {
'amount': '164.20',
'additionalInfo': {
'billingLine1': 'sadsadsa',
'billingLine2': '811821',
'billingCity': 'adasd',
'billingPostalCode': 'GY9 3AJ',
'billingCountryCode': 'GB',
'billingPhoneNumber': '01040505050',
'billingGivenName': '\\u0041\\u0064\\u0061\\u006d',
'billingSurname': '\\u0073\\u0061\\u006c\\u0061\\u0068',
},
'challengeRequested': True,
'bin': '446295',
'dfReferenceId': '0_9f296459-6965-4660-b167-24c74a80c633',
'clientMetadata': {
'requestedThreeDSecureVersion': '2',
'sdkVersion': 'web/3.94.0',
'cardinalDeviceDataCollectionTimeElapsed': 2,
'issuerDeviceDataCollectionTimeElapsed': 0,
'issuerDeviceDataCollectionResult': True,
},
'authorizationFingerprint':
'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6IjIwMTgwNDI2MTYtcHJvZHVjdGlvbiIsImlzcy
I6Imh0dHBzOi8vYXBpLmJyYWludHJlZWdhdGV3YXkuY29tIn0.eyJleHAiOjE3MzgxMTI0NDAsImp0aSI6I
jM5YmFhOWY0LTQ4MDYtNDEzYS1hNWEwLTQyZGQyNjA0OWFlZCIsInN1YiI6InB3NGd0bWRqZzViN3lzMjQi
LCJpc3MiOiJodHRwczovL2FwaS5icmFpbnRyZWVnYXRld2F5LmNvbSIsIm1lcmNoYW50Ijp7InB1YmxpY19
pZCI6InB3NGd0bWRqZzViN3lzMjQiLCJ2ZXJpZnlfY2FyZF9ieV9kZWZhdWx0IjpmYWxzZX0sInJpZ2h0cy
I6WyJtYW5hZ2VfdmF1bHQiXSwic2NvcGUiOlsiQnJhaW50cmVlOlZhdWx0Il0sIm9wdGlvbnMiOnt9fQ.AE
Hs9unraw0MVY-lo-
qCkozARbw6brrl9kr7nZG8L83Rpr29tgT2q73l0WTMyTJVXOLeRdM2c5HU3b3CKs8kig',
'braintreeLibraryVersion': 'braintree/web/3.94.0',
'_meta': {
'merchantAppId': 'www.supadance.com',
'platform': 'web',
'sdkVersion': '3.94.0',
'source': 'client',
'integration': 'custom',
'integrationType': 'custom',
'sessionId': 'ef2d5b96-03ab-40a4-99fb-4c1610fbe1e3',
},
}

response = requests.post(
'https://api.braintreegateway.com/merchants/pw4gtmdjg5b7ys24/client_api/v1/
payment_methods/tokencc_bh_q56thc_p4vmcq_2s6xz3_r6q9zz_sv7/three_d_secure/lookup',
headers=headers,
json=json_data,
)

# Note: json_data will not be serialized by requests


# exactly as it was in the original request.
#data = '{"amount":"164.20","additionalInfo":
{"billingLine1":"sadsadsa","billingLine2":"811821","billingCity":"adasd","billingPo
stalCode":"GY9
3AJ","billingCountryCode":"GB","billingPhoneNumber":"01040505050","billingGivenName
":"\\\\u0041\\\\u0064\\\\u0061\\\\u006d","billingSurname":"\\\\u0073\\\\u0061\\\\
u006c\\\\u0061\\\\
u0068"},"challengeRequested":true,"bin":"446295","dfReferenceId":"0_9f296459-6965-
4660-b167-24c74a80c633","clientMetadata":
{"requestedThreeDSecureVersion":"2","sdkVersion":"web/
3.94.0","cardinalDeviceDataCollectionTimeElapsed":2,"issuerDeviceDataCollectionTime
Elapsed":0,"issuerDeviceDataCollectionResult":true},"authorizationFingerprint":"eyJ
0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6IjIwMTgwNDI2MTYtcHJvZHVjdGlvbiIsImlzcyI6Im
h0dHBzOi8vYXBpLmJyYWludHJlZWdhdGV3YXkuY29tIn0.eyJleHAiOjE3MzgxMTI0NDAsImp0aSI6IjM5Y
mFhOWY0LTQ4MDYtNDEzYS1hNWEwLTQyZGQyNjA0OWFlZCIsInN1YiI6InB3NGd0bWRqZzViN3lzMjQiLCJp
c3MiOiJodHRwczovL2FwaS5icmFpbnRyZWVnYXRld2F5LmNvbSIsIm1lcmNoYW50Ijp7InB1YmxpY19pZCI
6InB3NGd0bWRqZzViN3lzMjQiLCJ2ZXJpZnlfY2FyZF9ieV9kZWZhdWx0IjpmYWxzZX0sInJpZ2h0cyI6Wy
JtYW5hZ2VfdmF1bHQiXSwic2NvcGUiOlsiQnJhaW50cmVlOlZhdWx0Il0sIm9wdGlvbnMiOnt9fQ.AEHs9u
nraw0MVY-lo-
qCkozARbw6brrl9kr7nZG8L83Rpr29tgT2q73l0WTMyTJVXOLeRdM2c5HU3b3CKs8kig","braintreeLib
raryVersion":"braintree/web/3.94.0","_meta":
{"merchantAppId":"www.supadance.com","platform":"web","sdkVersion":"3.94.0","source
":"client","integration":"custom","integrationType":"custom","sessionId":"ef2d5b96-
03ab-40a4-99fb-4c1610fbe1e3"}}'
#response = requests.post(
# 'https://api.braintreegateway.com/merchants/pw4gtmdjg5b7ys24/client_api/v1/
payment_methods/tokencc_bh_q56thc_p4vmcq_2s6xz3_r6q9zz_sv7/three_d_secure/lookup',
# headers=headers,
# data=data,
#)

You might also like