Files
vuefilemanager/resources/js/views/SetupWIzard/StripeCredentials.vue
T
2020-06-29 10:09:42 +02:00

671 lines
24 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<AuthContentWrapper ref="auth">
<!--Database Credentials-->
<AuthContent name="database-credentials" :visible="true">
<div class="content-headline">
<settings-icon size="40" class="title-icon"></settings-icon>
<h1>Setup Wizard</h1>
<h2>Set up your database credentials.</h2>
</div>
<ValidationObserver @submit.prevent="stripeCredentialsSubmit" ref="stripeCredentials" v-slot="{ invalid }" tag="form" class="form block-form">
<InfoBox>
<p>If you dont have stripe account, please <a href="#" target="_blank">register here</a> and get your Stripe Key, Stripe Secret and Stripe Webhook Secret.</p>
</InfoBox>
<FormLabel>Stripe Setup</FormLabel>
<div class="block-wrapper">
<label>Stripe Currency:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Currency" rules="required" v-slot="{ errors }">
<SelectInput v-model="stripeCredentials.currency" :options="currencyList" default="mysql" placeholder="Select your stripe currency" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<FormLabel class="mt-70">Stripe Credentials</FormLabel>
<div class="block-wrapper">
<label>Stripe Key:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Key" rules="required" v-slot="{ errors }">
<input v-model="stripeCredentials.key" placeholder="Type your stripe key" type="text" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Stripe Secret:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Secret" rules="required" v-slot="{ errors }">
<input v-model="stripeCredentials.secret" placeholder="Type your stripe secret" type="text" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Stripe Webhook Secret:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Webhook Secret" rules="required" v-slot="{ errors }">
<input v-model="stripeCredentials.webhookSecret" placeholder="Type your stripe webhook secret" type="text" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Stripe Webhook URL:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Webhook URL" rules="required" v-slot="{ errors }">
<input :value="config.host + '/stripe/webhook'" placeholder="" type="text" disabled />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="submit-wrapper">
<AuthButton icon="chevron-right" text="Save and Set Billings" :loading="isLoading" :disabled="isLoading"/>
</div>
</ValidationObserver>
</AuthContent>
</AuthContentWrapper>
</template>
<script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
import SelectInput from '@/components/Others/Forms/SelectInput'
import FormLabel from '@/components/Others/Forms/FormLabel'
import InfoBox from '@/components/Others/Forms/InfoBox'
import AuthContent from '@/components/Auth/AuthContent'
import AuthButton from '@/components/Auth/AuthButton'
import { SettingsIcon } from 'vue-feather-icons'
import {required} from 'vee-validate/dist/rules'
import {mapGetters} from 'vuex'
import axios from 'axios'
export default {
name: 'StripeCredentials',
components: {
AuthContentWrapper,
ValidationProvider,
ValidationObserver,
SettingsIcon,
SelectInput,
AuthContent,
AuthButton,
FormLabel,
required,
InfoBox,
},
computed: {
...mapGetters(['config']),
},
data() {
return {
isLoading: false,
currencyList: [
{
label: 'USD - United States Dollar',
value: 'USD',
},
{
label: 'EUR - Euro',
value: 'EUR',
},
{
label: 'GBP - British Pound',
value: 'GBP',
},
{
label: 'AFN - Afghan Afghani',
value: 'AFN',
},
{
label: 'ALL - Albanian Lek',
value: 'ALL',
},
{
label: 'DZD - Algerian Dinar',
value: 'DZD',
},
{
label: 'AOA - Angolan Kwanza',
value: 'AOA',
},
{
label: 'ARS - Argentine Peso',
value: 'ARS',
},
{
label: 'AMD - Armenian Dram',
value: 'AMD',
},
{
label: 'AWG - Aruban Florin',
value: 'AWG',
},
{
label: 'AUD - Australian Dollar',
value: 'AUD',
},
{
label: 'AZN - Azerbaijani Manat',
value: 'AZN',
},
{
label: 'BDT - Bangladeshi Taka',
value: 'BDT',
},
{
label: 'BBD - Barbadian Dollar',
value: 'BBD',
},
{
label: 'BZD - Belize Dollar',
value: 'BZD',
},
{
label: 'BMD - Bermudian Dollar',
value: 'BMD',
},
{
label: 'BOB - Bolivian Boliviano',
value: 'BOB',
},
{
label: 'BAM - Bosnia & Herzegovina Convertible Mark',
value: 'BAM',
},
{
label: 'BWP - Botswana Pula',
value: 'BWP',
},
{
label: 'BRL - Brazilian Real',
value: 'BRL',
},
{
label: 'BND - Brunei Dollar',
value: 'BND',
},
{
label: 'BGN - Bulgarian Lev',
value: 'BGN',
},
{
label: 'BIF - Burundian Franc',
value: 'BIF',
},
{
label: 'KHR - Cambodian Riel',
value: 'KHR',
},
{
label: 'CAD - Canadian Dollar',
value: 'CAD',
},
{
label: 'CVE - Cape Verdean Escudo',
value: 'CVE',
},
{
label: 'KYD - Cayman Islands Dollar',
value: 'KYD',
},
{
label: 'XAF - Central African Cfa Franc',
value: 'XAF',
},
{
label: 'XPF - Cfp Franc',
value: 'XPF',
},
{
label: 'CLP - Chilean Peso',
value: 'CLP',
},
{
label: 'CNY - Chinese Renminbi Yuan',
value: 'CNY',
},
{
label: 'COP - Colombian Peso',
value: 'COP',
},
{
label: 'KMF - Comorian Franc',
value: 'KMF',
},
{
label: 'CDF - Congolese Franc',
value: 'CDF',
},
{
label: 'CRC - Costa Rican Colón',
value: 'CRC',
},
{
label: 'HRK - Croatian Kuna',
value: 'HRK',
},
{
label: 'CZK - Czech Koruna',
value: 'CZK',
},
{
label: 'DKK - Danish Krone',
value: 'DKK',
},
{
label: 'DJF - Djiboutian Franc',
value: 'DJF',
},
{
label: 'DOP - Dominican Peso',
value: 'DOP',
},
{
label: 'XCD - East Caribbean Dollar',
value: 'XCD',
},
{
label: 'EGP - Egyptian Pound',
value: 'EGP',
},
{
label: 'ETB - Ethiopian Birr',
value: 'ETB',
},
{
label: 'FKP - Falkland Islands Pound',
value: 'FKP',
},
{
label: 'FJD - Fijian Dollar',
value: 'FJD',
},
{
label: 'GMD - Gambian Dalasi',
value: 'GMD',
},
{
label: 'GEL - Georgian Lari',
value: 'GEL',
},
{
label: 'GIP - Gibraltar Pound',
value: 'GIP',
},
{
label: 'GTQ - Guatemalan Quetzal',
value: 'GTQ',
},
{
label: 'GNF - Guinean Franc',
value: 'GNF',
},
{
label: 'GYD - Guyanese Dollar',
value: 'GYD',
},
{
label: 'HTG - Haitian Gourde',
value: 'HTG',
},
{
label: 'HNL - Honduran Lempira',
value: 'HNL',
},
{
label: 'HKD - Hong Kong Dollar',
value: 'HKD',
},
{
label: 'HUF - Hungarian Forint',
value: 'HUF',
},
{
label: 'ISK - Icelandic Króna',
value: 'ISK',
},
{
label: 'INR - Indian Rupee',
value: 'INR',
},
{
label: 'IDR - Indonesian Rupiah',
value: 'IDR',
},
{
label: 'ILS - Israeli New Sheqel',
value: 'ILS',
},
{
label: 'JMD - Jamaican Dollar',
value: 'JMD',
},
{
label: 'JPY - Japanese Yen',
value: 'JPY',
},
{
label: 'KZT - Kazakhstani Tenge',
value: 'KZT',
},
{
label: 'KES - Kenyan Shilling',
value: 'KES',
},
{
label: 'KGS - Kyrgyzstani Som',
value: 'KGS',
},
{
label: 'LAK - Lao Kip',
value: 'LAK',
},
{
label: 'LBP - Lebanese Pound',
value: 'LBP',
},
{
label: 'LSL - Lesotho Loti',
value: 'LSL',
},
{
label: 'LRD - Liberian Dollar',
value: 'LRD',
},
{
label: 'MOP - Macanese Pataca',
value: 'MOP',
},
{
label: 'MKD - Macedonian Denar',
value: 'MKD',
},
{
label: 'MGA - Malagasy Ariary',
value: 'MGA',
},
{
label: 'MWK - Malawian Kwacha',
value: 'MWK',
},
{
label: 'MYR - Malaysian Ringgit',
value: 'MYR',
},
{
label: 'MVR - Maldivian Rufiyaa',
value: 'MVR',
},
{
label: 'MRO - Mauritanian Ouguiya',
value: 'MRO',
},
{
label: 'MUR - Mauritian Rupee',
value: 'MUR',
},
{
label: 'MXN - Mexican Peso',
value: 'MXN',
},
{
label: 'MDL - Moldovan Leu',
value: 'MDL',
},
{
label: 'MNT - Mongolian Tögrög',
value: 'MNT',
},
{
label: 'MAD - Moroccan Dirham',
value: 'MAD',
},
{
label: 'MZN - Mozambican Metical',
value: 'MZN',
},
{
label: 'MMK - Myanmar Kyat',
value: 'MMK',
},
{
label: 'NAD - Namibian Dollar',
value: 'NAD',
},
{
label: 'NPR - Nepalese Rupee',
value: 'NPR',
},
{
label: 'ANG - Netherlands Antillean Gulden',
value: 'ANG',
},
{
label: 'TWD - New Taiwan Dollar',
value: 'TWD',
},
{
label: 'NZD - New Zealand Dollar',
value: 'NZD',
},
{
label: 'NIO - Nicaraguan Córdoba',
value: 'NIO',
},
{
label: 'NGN - Nigerian Naira',
value: 'NGN',
},
{
label: 'NOK - Norwegian Krone',
value: 'NOK',
},
{
label: 'PKR - Pakistani Rupee',
value: 'PKR',
},
{
label: 'PAB - Panamanian Balboa',
value: 'PAB',
},
{
label: 'PGK - Papua New Guinean Kina',
value: 'PGK',
},
{
label: 'PYG - Paraguayan Guaraní',
value: 'PYG',
},
{
label: 'PEN - Peruvian Nuevo Sol',
value: 'PEN',
},
{
label: 'PHP - Philippine Peso',
value: 'PHP',
},
{
label: 'PLN - Polish Złoty',
value: 'PLN',
},
{
label: 'QAR - Qatari Riyal',
value: 'QAR',
},
{
label: 'RON - Romanian Leu',
value: 'RON',
},
{
label: 'RUB - Russian Ruble',
value: 'RUB',
},
{
label: 'RWF - Rwandan Franc',
value: 'RWF',
},
{
label: 'STD - São Tomé and Príncipe Dobra',
value: 'STD',
},
{
label: 'SHP - Saint Helenian Pound',
value: 'SHP',
},
{
label: 'SVC - Salvadoran Colón',
value: 'SVC',
},
{
label: 'WST - Samoan Tala',
value: 'WST',
},
{
label: 'SAR - Saudi Riyal',
value: 'SAR',
},
{
label: 'RSD - Serbian Dinar',
value: 'RSD',
},
{
label: 'SCR - Seychellois Rupee',
value: 'SCR',
},
{
label: 'SLL - Sierra Leonean Leone',
value: 'SLL',
},
{
label: 'SGD - Singapore Dollar',
value: 'SGD',
},
{
label: 'SBD - Solomon Islands Dollar',
value: 'SBD',
},
{
label: 'SOS - Somali Shilling',
value: 'SOS',
},
{
label: 'ZAR - South African Rand',
value: 'ZAR',
},
{
label: 'KRW - South Korean Won',
value: 'KRW',
},
{
label: 'LKR - Sri Lankan Rupee',
value: 'LKR',
},
{
label: 'SRD - Surinamese Dollar',
value: 'SRD',
},
{
label: 'SZL - Swazi Lilangeni',
value: 'SZL',
},
{
label: 'SEK - Swedish Krona',
value: 'SEK',
},
{
label: 'CHF - Swiss Franc',
value: 'CHF',
},
{
label: 'TJS - Tajikistani Somoni',
value: 'TJS',
},
{
label: 'TZS - Tanzanian Shilling',
value: 'TZS',
},
{
label: 'THB - Thai Baht',
value: 'THB',
},
{
label: 'TOP - Tongan Paʻanga',
value: 'TOP',
},
{
label: 'TTD - Trinidad and Tobago Dollar',
value: 'TTD',
},
{
label: 'TRY - Turkish Lira',
value: 'TRY',
},
{
label: 'UGX - Ugandan Shilling',
value: 'UGX',
},
{
label: 'UAH - Ukrainian Hryvnia',
value: 'UAH',
},
{
label: 'AED - United Arab Emirates Dirham',
value: 'AED',
},
{
label: 'UYU - Uruguayan Peso',
value: 'UYU',
},
{
label: 'UZS - Uzbekistani Som',
value: 'UZS',
},
{
label: 'VUV - Vanuatu Vatu',
value: 'VUV',
},
{
label: 'VND - Vietnamese Đồng',
value: 'VND',
},
{
label: 'XOF - West African Cfa Franc',
value: 'XOF',
},
{
label: 'YER - Yemeni Rial',
value: 'YER',
},
{
label: 'ZMW - Zambian Kwacha',
value: 'ZMW',
},
],
stripeCredentials: {
key: '',
secret: '',
webhookSecret: '',
currency: '',
}
}
},
methods: {
async stripeCredentialsSubmit() {
this.$router.push({name: 'BillingsDetail'})
},
},
created() {
var container = document.getElementById('vue-file-manager')
container.scrollTop = 0
}
}
</script>
<style scoped lang="scss">
//@import '@assets/vue-file-manager/_auth-form';
@import '@assets/vue-file-manager/_forms';
@import '@assets/vue-file-manager/_auth';
@import '@assets/vue-file-manager/_setup_wizard';
</style>