Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div>
  3. <h4>Billing</h4>
  4. <div id="payment-element"></div>
  5. <div id="message"></div>
  6. <button @click="submit" class="btn btn-primary">Submit</button>
  7. </div>
  8. </template>
  9. <script setup>
  10. import { ref, onMounted } from "vue"
  11. const props = defineProps(["sub"])
  12. const stripe = Stripe(process.env.STRIPE_KEY)
  13. const options = { clientSecret: props.sub.clientSecret }
  14. const elements = stripe.elements(options)
  15. const payEl = elements.create("payment")
  16. function submit() {
  17. let result = stripe.confirmPayment({
  18. //`Elements` instance that was used to create the Payment Element
  19. elements,
  20. confirmParams: {
  21. return_url: `https://${process.env.SKOUTER_DOMAIN}`,
  22. }
  23. })
  24. }
  25. onMounted(() => {
  26. console.log(process.env.SKOUTER_DOMAIN)
  27. payEl.mount("#payment-element")
  28. })
  29. </script>
  30. <style scoped>
  31. button.btn {
  32. margin: 10px auto;
  33. display: block;
  34. min-width: 90px;
  35. }
  36. </style>