addie-js 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. package/addie.js +50 -2
  2. package/package.json +1 -1
package/addie.js CHANGED
@@ -50,12 +50,60 @@ const addie = {
50
50
  return uuid;
51
51
  },
52
52
 
53
+ getUserByUUID: async (uuid) => {
54
+ const timestamp = new Date().getTime() + '';
55
+
56
+ const message = timestamp + uuid;
57
+
58
+ const signature = await sessionless.sign(message);
59
+
60
+ const res = await get(`${addie.baseURL}user/${uuid}?signature=${signature}&timestamp=${timestamp}`);
61
+ const user = res.json();
62
+
63
+ return user;
64
+ },
65
+
53
66
  addProcessorAccount: async (uuid, processorPayload) => {
54
67
  return 'unimplemented';
55
68
  },
56
69
 
57
- getPaymentIntent: async (uuid, processor, processorPayload) => {
58
- return 'unimplemented';
70
+ getPaymentIntent: async (uuid, processor, amount, currency, payees) => {
71
+ const timestamp = new Date().getTime() + '';
72
+ const message = timestamp + uuid + amount + currency;
73
+ const signature = await sessionless.sign(message);
74
+
75
+ const payload = {
76
+ timestamp,
77
+ amount,
78
+ currency,
79
+ "payees": payees,
80
+ "signature": signature
81
+ };
82
+
83
+ const url = `${baseURL}user/${uuid}/processor/${processor}/intent`;
84
+ const res = post(url, payload); // Start here
85
+ const intent = await res.json();
86
+
87
+ return intent;
88
+ },
89
+
90
+ getPaymentIntentWithoutSplits: async (uuid, processor, amount, currency) => {
91
+ const timestamp = new Date().getTime() + '';
92
+ const message = timestamp + uuid + amount + currency;
93
+ const signature = await sessionless.sign(message);
94
+
95
+ const payload = {
96
+ timestamp,
97
+ amount,
98
+ currency,
99
+ "signature": signature
100
+ };
101
+
102
+ const url = `${baseURL}user/${uuid}/processor/${processor}/intent-without-splits`;
103
+ const res = post(url, payload); // Start here
104
+ const intent = await res.json();
105
+
106
+ return intent;
59
107
  },
60
108
 
61
109
  deleteUser: async (uuid) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "addie-js",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Addie JavaScript client",
5
5
  "main": "addie.js",
6
6
  "scripts": {