Spaces:
Sleeping
Sleeping
fix: use base64 not base64url for payment header decoding
Browse files
server.js
CHANGED
|
@@ -97,7 +97,7 @@ function getPayerAddress(req) {
|
|
| 97 |
const header =
|
| 98 |
req.get("payment-signature") || req.get("x-payment") || req.get("PAYMENT-SIGNATURE");
|
| 99 |
if (!header) return null;
|
| 100 |
-
const decoded = JSON.parse(Buffer.from(header, "
|
| 101 |
// Decode the transaction XDR to get the source account (payer)
|
| 102 |
const txXdr = decoded?.payload?.transaction;
|
| 103 |
if (!txXdr) return null;
|
|
|
|
| 97 |
const header =
|
| 98 |
req.get("payment-signature") || req.get("x-payment") || req.get("PAYMENT-SIGNATURE");
|
| 99 |
if (!header) return null;
|
| 100 |
+
const decoded = JSON.parse(Buffer.from(header, "base64").toString());
|
| 101 |
// Decode the transaction XDR to get the source account (payer)
|
| 102 |
const txXdr = decoded?.payload?.transaction;
|
| 103 |
if (!txXdr) return null;
|