I'm trying to understand how to automate checkout process on a demandware website that uses adyen checkout.
payload_creditcard = {
...
"dwfrm_billing_paymentMethod": "CREDIT_CARD",
"dwfrm_billing_creditCardFields_cardType": "Master+card",
"dwfrm_billing_creditCardFields_adyenEncryptedData":"adyenjs_0_1_18$ibddsadc65...",
"dwfrm_billing_creditCardFields_cardNumber":"************3345"
"dwfrm_billing_creditCardFields_expirationMonth": "20",
"dwfrm_billing_creditCardFields_expirationYear": "2030"
}
This is the script for the payment:
checkout_page = s.get("https://www.slamjam.com/en_IT/checkout-begin?stage=payment#payment",headers=headers)
checkout_card = s.post("https://www.slamjam.com/on/demandware.store/Sites-slamjam-Site/en_IT/CheckoutServices-SubmitPayment",headers=headers, data=payload_creditcard)
place_order = s.get("https://www.slamjam.com/en_IT/checkout-begin?stage=placeOrder#placeOrder",headers=headers)
The problem is that every time the "dwfrm_billing_creditCardFields_adyenEncryptedData" changes every time and I don't know how to generate it. I found javascript functions within the website, but to make them work you need an html with the form with the card inputs and obviously I can't insert an html every time I need this token inside the python code, because everything is based on speed. Is there any way you can recommend me or if someone has already done it before?