我正在尝试使用 jquery 验证购买,无论我尝试什么,我都会收到“收据数据格式错误”错误。我有一张有效的收据,如下所示:
ewoJInNpZ25hdHVyZSIgPSAiQWlPQ2t5bTJrWGwvbzhMMmxMd054K2M5bzg5QVlUWXkwNFp3bXkrRDJIV3hpMExYVUdtMmIyREhDZ1FyQ0lnZk5qcnVqRVp0bDJ0OTlPNm9VenZmTkM5VzN1RytzQzVuY0hKMnVhOWlwUjVPeTJlRFFyMkdFOHByc25iaHMwQXB5L0lqR0d3S21HZkVGVDU3QjB5T0dSMDh4eHBJSFZmV0t4RjNyQXoxZE0wRUFBQURWekNDQTFNd2dnSTdvQU1DQVFJQ0NHVVVrVTNaV0FTMU1BMEdDU3FHU0liM0RRRUJCUVVBTUg4eEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVNZd0pBWURWUVFMREIxQmNIQnNaU0JEWlhKMGFXWnBZMkYwYVc5dUlFRjFkR2h2Y21sMGVURXpNREVHQTFVRUF3d3FRWEJ3YkdVZ2FWUjFibVZ6SUZOMGIzSmxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1CNFhEVEE1TURZeE5USXlNRFUxTmxvWERURTBNRFl4TkRJeU1EVTFObG93WkRFak1DRUdBMVVFQXd3YVVIVnlZMmhoYzJWU1pXTmxhWEIwUTJWeWRHbG1hV05oZEdVeEd6QVpCZ05WQkFzTUVrRndjR3hsSUdsVWRXNWxjeUJUZEc5eVpURVRNQkVHQTFVRUNnd0tRWEJ3YkdVZ1NXNWpMakVMTUFrR0ExVUVCaE1DVlZNd2daOHdEUVlKS29aSWh2Y05BUUVCQlFBRGdZMEFNSUdKQW9HQkFNclJqRjJjdDRJclNkaVRDaGFJMGc4cHd2L2NtSHM4cC9Sd1YvcnQvOTFYS1ZoTmw0WElCaW1LalFRTmZnSHNEczZ5anUrK0RyS0pFN3VLc3BoTWRkS1lmRkU1ckdYc0FkQkVqQndSSXhleFRldng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Y3lJanNLQ1NKaWRuSnpJaUE5SUNJeExqQXpJanNLQ1NKMGNtRnVjMkZqZEdsdmJpMXBaQ0lnUFNBaU1UQXdNREF3TURBNE1ERTJNVGcxTlNJN0Nna2ljWFZoYm5ScGRIa2lJRDBnSWpFaU93b0pJbTl5YVdkcGJtRnNMWEIxY21Ob1lYTmxMV1JoZEdVdGJYTWlJRDBnSWpFek56TTBPRFE0TXpFd01EQWlPd29KSW5WdWFYRjFaUzEyWlc1a2IzSXRhV1JsYm5ScFptbGxjaUlnUFNBaVF6aENRakJETmtNdE5UTTVOeTAwUTBVMkxUbEdRell0TVVJeE1EYzJSRU5FT0RFeElqc0tDU0p3Y205a2RXTjBMV2xrSWlBOUlDSlFVRjh3TURFaU93b0pJbWwwWlcwdGFXUWlJRDBnSWpZMk9EVXdNVFV4TmlJN0Nna2lZbWxrSWlBOUlDSnVlaTVqYnk1d2NtOXdhRzkwYjJkeVlYQm9aWEl1WVhCd0lqc0tDU0p3ZFhKamFHRnpaUzFrWVhSbExXMXpJaUE5SUNJeE16Y3pOVFl6TXpjM09UTXlJanNLQ1NKd2RYSmphR0Z6WlMxa1lYUmxJaUE5SUNJeU1ERXpMVEEzTFRFeElERTNPakl5T2pVM0lFVjBZeTlIVFZRaU93b0pJbkIxY21Ob1lYTmxMV1JoZEdVdGNITjBJaUE5SUNJeU1ERXpMVEEzTFRFeElERXdPakl5T2pVM0lFRnRaWEpwWTJFdlRHOXpYMEZ1WjJWc1pYTWlPd29KSW05eWFXZHBibUZzTFhCMWNtTm9ZWE5sTFdSaGRHVWlJRDBnSWpJd01UTXRNRGN0TVRBZ01UazZNek02TlRFZ1JYUmpMMGROVkNJN0NuMD0iOwoJImVudmlyb25tZW50IiA9ICJTYW5kYm94IjsKCSJwb2QiID0gIjEwMCI7Cgkic2lnbmluZy1zdGF0dXMiID0gIjAiOwp9"
},
function(data) {
console.log(data);
}
)
我不断收到这个“格式错误的请求”错误消息。代码的有效 base64,它解压缩为:
{
"signature" = "A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2EvTG9zX0FuZ2VsZXMiOwoJIm9yaWdpbmFsLXB1cmNoYXNlLWRhdGUiID0gIjIwMTMtMDctMTAgMTk6MzM6NTEgRXRjL0dNVCI7Cn0=";
"environment" = "Sandbox";
"pod" = "100";
"signing-status" = "0";
}
这可能是什么原因造成的?base64的有效,“收据数据”:[收据]似乎是正确的......有人可以帮忙吗?