The following piece of code that I was using was running perfectly until a few hours ago. But now throws error.
##PAYMENTS # create a cipher from the RSA key and use it to encrypt the card number, prepended with the prefix #from GET /v2/merchant/{muid}/pay/key cipher = PKCS1_OAEP.new(RSAkey) # encode str to byte (https://eli.thegreenplace.net/2012/01/30/the-bytesstr-dichotomy-in-python-3) encrypted = cipher.encrypt((prefix + cardNumber).encode()) # Base64 encode the resulting encrypted data into a string to use as the cardEncrypted' property. cardEncrypted = b64encode(encrypted) post_data = { "orderId": orderId, "currency": "usd", "amount": int(total), "expMonth": expMonth, "cvv": CVV, "expYear": expYear, "cardEncrypted": cardEncrypted, "last4": cardNumber[-4:], "first6": cardNumber[0:6] } posturl = environment + "v2/merchant/" + muid + "/pay" sleep(0.1) response = requests.post(posturl,headers = headers,data= post_data) if response.status_code != 200: print(response.text.encode('utf8')) print(str(response.status_code)+"Something went wrong during developer pay") sys.exit()
400: Cannot Parse JSON error.
Please help