wiki-plugin-shoppe 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/server.js +6 -1
package/package.json
CHANGED
package/server/server.js
CHANGED
|
@@ -1096,10 +1096,15 @@ async function startServer(params) {
|
|
|
1096
1096
|
|
|
1097
1097
|
// Create Stripe intent via Addie
|
|
1098
1098
|
const payees = tenant.addieKeys ? [{ pubKey: tenant.addieKeys.pubKey, amount }] : [];
|
|
1099
|
+
const buyerKeys = { pubKey: buyer.pubKey, privateKey: buyer.privateKey };
|
|
1100
|
+
sessionless.getKeys = () => buyerKeys;
|
|
1101
|
+
const intentTimestamp = Date.now().toString();
|
|
1102
|
+
const intentMessage = intentTimestamp + buyer.uuid + amount + 'USD';
|
|
1103
|
+
const intentSignature = await sessionless.sign(intentMessage);
|
|
1099
1104
|
const intentResp = await fetch(`${getAddieUrl()}/user/${buyer.uuid}/processor/stripe/intent`, {
|
|
1100
1105
|
method: 'PUT',
|
|
1101
1106
|
headers: { 'Content-Type': 'application/json' },
|
|
1102
|
-
body: JSON.stringify({ timestamp:
|
|
1107
|
+
body: JSON.stringify({ timestamp: intentTimestamp, amount, currency: 'USD', payees, signature: intentSignature })
|
|
1103
1108
|
});
|
|
1104
1109
|
|
|
1105
1110
|
const intentJson = await intentResp.json();
|