AddFundsVerify.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!--
  2. Copyright 2019 Hackware SpA <human@hackware.cl>
  3. This file is part of "Hackware Userland" and licensed under the terms
  4. of the GNU Affero General Public License version 3, or (at your option)
  5. a later version. You should have received a copy of this license along
  6. with the software. If not, see <https://www.gnu.org/licenses/>.
  7. -->
  8. <template>
  9. <div class="add-funds-verify">
  10. <h2>Verificación de pago</h2>
  11. <div v-show="Object.keys(payment).length === 0 || payment.status === 'pending'">
  12. <i class="fas fa-3x fa-spinner fa-pulse" />
  13. <p class="lead">
  14. Estamos esperando la comprobación de tu pago...
  15. </p>
  16. </div>
  17. <div v-show="payment.status === 'aborted'">
  18. <i class="fas fa-3x fa-times-circle" />
  19. <p class="lead">
  20. Tu pago no pudo ser procesado, no se han realizado cargos
  21. </p>
  22. </div>
  23. <div v-show="payment.status === 'completed'">
  24. <i class="fas fa-3x fa-check-circle" />
  25. <p class="lead">
  26. Tu pago ha sido procesado exitosamente
  27. </p>
  28. <p class="lead">
  29. ¡Muchas gracias!
  30. <i class="fas fa-2x fa-laugh-beam" />
  31. <i class="fas fa-heart" />
  32. </p>
  33. <p class="small">
  34. Si aún no ves el pago reflejado en tu saldo, por favor
  35. <router-link :to="{ name: 'transactions' }">
  36. revísalo aquí
  37. </router-link>.
  38. </p>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. export default {
  44. name: 'AddFundsVerify',
  45. data() {
  46. return {
  47. payment: {},
  48. };
  49. },
  50. created() {
  51. this.fetchVerifyPayment();
  52. },
  53. methods: {
  54. fetchVerifyPayment() {
  55. return this.$fetcher.haweseGet(`/payments/${this.$route.query.uuid}`)
  56. .then((body) => {
  57. this.payment = body;
  58. if (this.payment.status === 'pending') {
  59. setTimeout(() => { this.fetchVerifyPayment(); }, 15000); // 15 seconds
  60. } else {
  61. this.$eventHub.$emit('payment-updated');
  62. }
  63. });
  64. },
  65. },
  66. };
  67. </script>
  68. <style lang="scss">
  69. @import "../assets/bootstrap/custom";
  70. .add-funds-verify {
  71. @extend .pt-5;
  72. @extend .text-center;
  73. > h2 {
  74. @extend .pb-3;
  75. }
  76. > div {
  77. >.fa-spinner {
  78. color: var(--gray);
  79. }
  80. >.fa-times-circle {
  81. color: var(--danger);
  82. }
  83. >.fa-check-circle {
  84. color: var(--success);
  85. }
  86. > p {
  87. @extend .pt-3;
  88. > .fa-laugh-beam {
  89. color: var(--yellow);
  90. }
  91. > .fa-heart {
  92. color: var(--red);
  93. position:relative;
  94. top: -1rem;
  95. }
  96. }
  97. }
  98. }
  99. </style>