Browse Source

Added Payfast & TimeshareWeek Delete

master
30117125 4 years ago
parent
commit
e5e4070bf0

+ 5
- 0
package-lock.json View File

7442
       "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==",
7442
       "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==",
7443
       "dev": true
7443
       "dev": true
7444
     },
7444
     },
7445
+    "js-md5": {
7446
+      "version": "0.7.3",
7447
+      "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
7448
+      "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
7449
+    },
7445
     "js-message": {
7450
     "js-message": {
7446
       "version": "1.0.5",
7451
       "version": "1.0.5",
7447
       "resolved": "https://registry.npmjs.org/js-message/-/js-message-1.0.5.tgz",
7452
       "resolved": "https://registry.npmjs.org/js-message/-/js-message-1.0.5.tgz",

+ 2
- 0
package.json View File

14
     "aos": "^3.0.0-beta.6",
14
     "aos": "^3.0.0-beta.6",
15
     "axios": "^0.19.2",
15
     "axios": "^0.19.2",
16
     "core-js": "^2.6.11",
16
     "core-js": "^2.6.11",
17
+    "crypto-js": "^4.0.0",
17
     "datatables.net": "^1.10.20",
18
     "datatables.net": "^1.10.20",
18
     "jquery": "^3.4.1",
19
     "jquery": "^3.4.1",
20
+    "js-md5": "^0.7.3",
19
     "jspdf": "^2.1.0",
21
     "jspdf": "^2.1.0",
20
     "jspdf-autotable": "^3.5.9",
22
     "jspdf-autotable": "^3.5.9",
21
     "lodash": "^4.17.15",
23
     "lodash": "^4.17.15",

+ 20
- 47
src/components/admin/status/timeshareAdminList.vue View File

6
       </div>
6
       </div>
7
       <div class="row">
7
       <div class="row">
8
         <div class="col-lg-6 offset-3">
8
         <div class="col-lg-6 offset-3">
9
-          <input
10
-            class="form-control uniSelect"
11
-            type="text"
12
-            placeholder="SEARCH"
13
-            v-model="filter"
14
-          />
9
+          <input class="form-control uniSelect" type="text" placeholder="SEARCH" v-model="filter" />
15
         </div>
10
         </div>
16
       </div>
11
       </div>
17
       <div class="row">
12
       <div class="row">
71
                 <td>{{ item.status.description }}</td>
66
                 <td>{{ item.status.description }}</td>
72
                 <td v-if="!item.publish">
67
                 <td v-if="!item.publish">
73
                   <a v-on:click="Publish(item)">
68
                   <a v-on:click="Publish(item)">
74
-                    <img
75
-                      src="../../../../public/img/icons/Upload.png"
76
-                      height="25"
77
-                      width="25"
78
-                    />
69
+                    <img src="../../../../public/img/icons/Upload.png" height="25" width="25" />
79
                   </a>
70
                   </a>
80
                 </td>
71
                 </td>
81
                 <td v-else>
72
                 <td v-else>
89
                 </td>
80
                 </td>
90
                 <td>
81
                 <td>
91
                   <a v-on:click="Edit(item)">
82
                   <a v-on:click="Edit(item)">
92
-                    <img
93
-                      src="../../../../public/img/icons/Edit.png"
94
-                      height="25"
95
-                      width="25"
96
-                    />
83
+                    <img src="../../../../public/img/icons/Edit.png" height="25" width="25" />
97
                   </a>
84
                   </a>
98
                 </td>
85
                 </td>
99
                 <td>
86
                 <td>
100
                   <a v-on:click="Delete(item)">
87
                   <a v-on:click="Delete(item)">
101
-                    <img
102
-                      src="../../../../public/img/icons/delete.png"
103
-                      height="25"
104
-                      width="25"
105
-                    />
88
+                    <img src="../../../../public/img/icons/delete.png" height="25" width="25" />
106
                   </a>
89
                   </a>
107
                 </td>
90
                 </td>
108
               </tr>
91
               </tr>
110
           </table>
93
           </table>
111
           <div class="d-flex justify-content-between" v-if="showPager">
94
           <div class="d-flex justify-content-between" v-if="showPager">
112
             <div class="p-1">
95
             <div class="p-1">
113
-              {{
114
-                currentPage +
115
-                " / " +
116
-                PageCount +
117
-                (" - (" + FilteredListings.length + " items)")
118
-              }}
96
+              {{ currentPage + " / " + PageCount + (" - (" + FilteredListings.length + " items)") }}
119
             </div>
97
             </div>
120
             <div class="p-1">
98
             <div class="p-1">
121
               <BasePagination
99
               <BasePagination
145
           <div class="p-2">
123
           <div class="p-2">
146
             <div class="d-flex flex-row">
124
             <div class="d-flex flex-row">
147
               <div>
125
               <div>
148
-                <button
149
-                  v-if="sortKey !== 'id'"
150
-                  class="btn-solid-blue"
151
-                  @click="ClearSort"
152
-                >
126
+                <button v-if="sortKey !== 'id'" class="btn-solid-blue" @click="ClearSort">
153
                   Clear Sort
127
                   Clear Sort
154
                 </button>
128
                 </button>
155
               </div>
129
               </div>
172
 
146
 
173
 export default {
147
 export default {
174
   components: {
148
   components: {
175
-    BasePagination,
149
+    BasePagination
176
   },
150
   },
177
   data() {
151
   data() {
178
     return {
152
     return {
197
         "Region",
171
         "Region",
198
         "Amount",
172
         "Amount",
199
         "Submitted",
173
         "Submitted",
200
-        "Status",
174
+        "Status"
201
       ],
175
       ],
202
       columns: [
176
       columns: [
203
         "owner",
177
         "owner",
209
         "season",
183
         "season",
210
         "region",
184
         "region",
211
         "sellPrice",
185
         "sellPrice",
212
-        "weekStatus",
213
-      ],
186
+        "weekStatus"
187
+      ]
214
     };
188
     };
215
   },
189
   },
216
   methods: {
190
   methods: {
221
       "editSave",
195
       "editSave",
222
       "publishWeek",
196
       "publishWeek",
223
       "unpublishWeek",
197
       "unpublishWeek",
198
+      "deleteListing"
224
     ]),
199
     ]),
225
     Publish(item) {
200
     Publish(item) {
226
       // var today = new Date();
201
       // var today = new Date();
245
       // this.$router.push(`/editTimeShare/${item.id}`);
220
       // this.$router.push(`/editTimeShare/${item.id}`);
246
     },
221
     },
247
     Delete(item) {
222
     Delete(item) {
248
-      this.deleteProperty(item.id);
223
+      this.deleteListing(item.id);
249
     },
224
     },
250
     async pageChangeHandle(value) {
225
     async pageChangeHandle(value) {
251
       switch (value) {
226
       switch (value) {
266
     ClearSort() {
241
     ClearSort() {
267
       this.reverse = true;
242
       this.reverse = true;
268
       this.sortKey = "id";
243
       this.sortKey = "id";
269
-    },
244
+    }
270
   },
245
   },
271
   computed: {
246
   computed: {
272
     ...mapState("propertyList", ["properties"]),
247
     ...mapState("propertyList", ["properties"]),
273
     ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
248
     ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
274
     FilteredListings() {
249
     FilteredListings() {
275
       if (this.filter) {
250
       if (this.filter) {
276
-        const list = _.filter(this.getNeedsVerify, (item) =>
251
+        const list = _.filter(this.getNeedsVerify, item =>
277
           Object.values(item).some(
252
           Object.values(item).some(
278
-            (i) =>
253
+            i =>
279
               JSON.stringify(i)
254
               JSON.stringify(i)
280
                 .toLowerCase()
255
                 .toLowerCase()
281
                 .indexOf(this.filter.toLowerCase()) > -1
256
                 .indexOf(this.filter.toLowerCase()) > -1
288
     },
263
     },
289
     PageCount() {
264
     PageCount() {
290
       return this.visibleItemsPerPageCount !== 0
265
       return this.visibleItemsPerPageCount !== 0
291
-        ? Math.ceil(
292
-            this.FilteredListings.length / this.visibleItemsPerPageCount
293
-          )
266
+        ? Math.ceil(this.FilteredListings.length / this.visibleItemsPerPageCount)
294
         : 1;
267
         : 1;
295
     },
268
     },
296
     DisplayItems() {
269
     DisplayItems() {
304
     },
277
     },
305
     SortDirection() {
278
     SortDirection() {
306
       return this.reverse ? "desc" : "asc";
279
       return this.reverse ? "desc" : "asc";
307
-    },
280
+    }
308
   },
281
   },
309
   created() {
282
   created() {
310
     this.getItems(this.userId).then(() => {
283
     this.getItems(this.userId).then(() => {
327
         if (val != oldVal) {
300
         if (val != oldVal) {
328
           this.currentPage = 1;
301
           this.currentPage = 1;
329
         }
302
         }
330
-      },
331
-    },
332
-  },
303
+      }
304
+    }
305
+  }
333
 };
306
 };
334
 </script>
307
 </script>
335
 
308
 

+ 48
- 0
src/components/financial/payFast.vue View File

1
+<template>
2
+  <div style="padding-top:550px">
3
+    <form
4
+      ref="form"
5
+      target="_parent"
6
+      action="https://sandbox.payfast.co.za​/eng/process"
7
+      method="post"
8
+    >
9
+      <input type="hidden" name="merchant_id" :value="paymentObj.merchant_id" />
10
+      <input type="hidden" name="merchant_key" :value="paymentObj.merchant_key" />
11
+      <input type="hidden" name="return_url" :value="paymentObj.return_url" />
12
+      <input type="hidden" name="cancel_url" :value="paymentObj.cancel_url" />
13
+      <input type="hidden" name="notify_url" :value="paymentObj.notify_url" />
14
+      <input type="hidden" name="name_first" :value="paymentObj.name_first" />
15
+      <input type="hidden" name="name_last" :value="paymentObj.name_last" />
16
+      <input type="hidden" name="email_address" :value="paymentObj.email_address" />
17
+      <!-- <input type="hidden" name="m_payment_id" :value="paymentObj.m_payment_id" /> -->
18
+      <input type="hidden" name="amount" :value="paymentObj.amount" />
19
+      <input type="hidden" name="item_name" :value="paymentObj.item_name" />
20
+      <input type="hidden" name="signature" :value="paymentObj.signature" />
21
+    </form>
22
+  </div>
23
+</template>
24
+
25
+<script>
26
+/* eslint-disable */
27
+export default {
28
+  data() {
29
+    return {
30
+      loaded: false
31
+    };
32
+  },
33
+  props: {
34
+    paymentObj: {}
35
+  },
36
+  created() {
37
+    this.populateData();
38
+  },
39
+  methods: {
40
+    async populateData() {
41
+      setTimeout(() => (this.loaded = true), 100);
42
+      setTimeout(() => this.$refs.form.submit(), 100);
43
+    }
44
+  }
45
+};
46
+</script>
47
+
48
+<style lang="scss" scoped></style>

+ 1159
- 0
src/components/timeshare/sell/contentSectionPF.vue
File diff suppressed because it is too large
View File


+ 9
- 0
src/router/index.js View File

90
 import PaymentError from '../components/financial/paymentError.vue';
90
 import PaymentError from '../components/financial/paymentError.vue';
91
 import PaymentOption from '../components/financial/paymentOption.vue'
91
 import PaymentOption from '../components/financial/paymentOption.vue'
92
 import EFTPage from '../components/financial/eftPage.vue'
92
 import EFTPage from '../components/financial/eftPage.vue'
93
+import PayFast from '../components/financial/payFast.vue'
93
 
94
 
94
 import LandingPages from "../components/marketing/landingPages.vue";
95
 import LandingPages from "../components/marketing/landingPages.vue";
95
 import LandingPage from "../components/marketing/landingPage.vue";
96
 import LandingPage from "../components/marketing/landingPage.vue";
561
       }),
562
       }),
562
       component: UpdateAgentProfile,
563
       component: UpdateAgentProfile,
563
     },
564
     },
565
+    {
566
+      path: "/financial/payfast",
567
+      name: "PayFast",
568
+      props: route => ({
569
+        ...route.params
570
+      }),
571
+      component: PayFast,
572
+    },
564
   ]
573
   ]
565
 });
574
 });

+ 12
- 10
src/store/modules/timeshare/myWeeks.js View File

31
     },
31
     },
32
     updateUnpublished(state, item) {
32
     updateUnpublished(state, item) {
33
       state.items.find(week => week.id === item.id).publish = false;
33
       state.items.find(week => week.id === item.id).publish = false;
34
-    }
34
+    },
35
+    removeListing(state, id) {
36
+      var index = state.items.findIndex((item) => item.id == id)
37
+      state.items.splice(index, 1)
38
+    },
35
   },
39
   },
36
   getters: {
40
   getters: {
37
     getNeedsVerify(state) {
41
     getNeedsVerify(state) {
38
       return state.items;
42
       return state.items;
39
     }
43
     }
40
-    // removeListing(state, id) {
41
-    //   state.myWeeks.pop(state.myWeeks.find(w => w.id === id));
42
-    // },
44
+    
43
   },
45
   },
44
   actions: {
46
   actions: {
45
     async getItems({ commit }, id) {
47
     async getItems({ commit }, id) {
76
         .then(result => commit("updateUnpublished", item))
78
         .then(result => commit("updateUnpublished", item))
77
         .catch(console.error);
79
         .catch(console.error);
78
     },
80
     },
79
-    // deleteListing({ commit }, id) {
80
-    //   axios
81
-    //   .delete(`/api/myweeks/${id}`)
82
-    //   .then(result => commit('removeListing', id))
83
-    //   .catch(console.error);
84
-    // }
81
+    deleteListing({ commit }, id) {
82
+      axios
83
+      .delete(`/api/timeshareWeek/${id}`)
84
+      .then(result => commit('removeListing', id))
85
+      .catch(console.error);
86
+    },
85
     async getWeek({ commit }, id) {
87
     async getWeek({ commit }, id) {
86
       await axios
88
       await axios
87
         .get(`/api/timeshareweek/${id}`)
89
         .get(`/api/timeshareweek/${id}`)

Loading…
Cancel
Save