Parcourir la source

Added Payfast & TimeshareWeek Delete

master
30117125 il y a 4 ans
Parent
révision
e5e4070bf0

+ 5
- 0
package-lock.json Voir le fichier

@@ -7442,6 +7442,11 @@
7442 7442
       "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==",
7443 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 7450
     "js-message": {
7446 7451
       "version": "1.0.5",
7447 7452
       "resolved": "https://registry.npmjs.org/js-message/-/js-message-1.0.5.tgz",

+ 2
- 0
package.json Voir le fichier

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

+ 20
- 47
src/components/admin/status/timeshareAdminList.vue Voir le fichier

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

+ 48
- 0
src/components/financial/payFast.vue Voir le fichier

@@ -0,0 +1,48 @@
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
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 9
- 0
src/router/index.js Voir le fichier

@@ -90,6 +90,7 @@ import PaymentSuccess from "../components/financial/OrderThankYou.vue";
90 90
 import PaymentError from '../components/financial/paymentError.vue';
91 91
 import PaymentOption from '../components/financial/paymentOption.vue'
92 92
 import EFTPage from '../components/financial/eftPage.vue'
93
+import PayFast from '../components/financial/payFast.vue'
93 94
 
94 95
 import LandingPages from "../components/marketing/landingPages.vue";
95 96
 import LandingPage from "../components/marketing/landingPage.vue";
@@ -561,5 +562,13 @@ export default new Router({
561 562
       }),
562 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 Voir le fichier

@@ -31,15 +31,17 @@ export default {
31 31
     },
32 32
     updateUnpublished(state, item) {
33 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 40
   getters: {
37 41
     getNeedsVerify(state) {
38 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 46
   actions: {
45 47
     async getItems({ commit }, id) {
@@ -76,12 +78,12 @@ export default {
76 78
         .then(result => commit("updateUnpublished", item))
77 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 87
     async getWeek({ commit }, id) {
86 88
       await axios
87 89
         .get(`/api/timeshareweek/${id}`)

Chargement…
Annuler
Enregistrer