addie-js 0.0.7 → 0.0.8
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/addie.js +11 -1
- package/package.json +1 -1
package/addie.js
CHANGED
|
@@ -109,7 +109,13 @@ console.log('response from addie', user);
|
|
|
109
109
|
return user;
|
|
110
110
|
},
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
// `merchant` ({pubKey}) is the party who receives the bulk of the charge
|
|
113
|
+
// (91%) — an invoice's creator, say — as distinct from `payees`, the
|
|
114
|
+
// affiliate splits. It has to be forwarded: without it the server builds
|
|
115
|
+
// the intent with no merchant_pubkey in its metadata, and the later
|
|
116
|
+
// transfer step has no one to pay, so the charge succeeds and the money
|
|
117
|
+
// never leaves the platform account.
|
|
118
|
+
getPaymentIntent: async (uuid, processor, amount, currency, payees, merchant) => {
|
|
113
119
|
const timestamp = new Date().getTime() + '';
|
|
114
120
|
const message = timestamp + uuid + amount + currency;
|
|
115
121
|
const signature = await sessionless.sign(message);
|
|
@@ -122,6 +128,10 @@ console.log('response from addie', user);
|
|
|
122
128
|
"signature": signature
|
|
123
129
|
};
|
|
124
130
|
|
|
131
|
+
if(merchant) {
|
|
132
|
+
payload.merchant = merchant;
|
|
133
|
+
}
|
|
134
|
+
|
|
125
135
|
const url = `${addie.baseURL}user/${uuid}/processor/${processor}/intent`;
|
|
126
136
|
const res = await post(url, payload); // Start here
|
|
127
137
|
const intent = await res.json();
|