Browse Source

1.2.1 - Added default currency

develop
Atridad Lahiji 1 week ago
parent
commit
4e0c0bccea
  1. 1
      .env.example
  2. 2
      README.md
  3. 2
      build.sh
  4. 2
      frontend/package.json
  5. 14
      frontend/src/App.vue
  6. 12
      frontend/src/components/Index.vue
  7. 1
      frontend/src/main.js
  8. 11570
      frontend/yarn.lock
  9. 2
      main.go

1
.env.example

@ -2,6 +2,7 @@ OWNER_NAME="Owner Person"
META_TITLE="EleutheriaPay"
TITLE="EleutheriaPay"
DESCRIPTION="Customizable FOSS donation platform for FOSS developers"
DEFAULT_CURRENCY="usd"
STRIPE_PK=""
STRIPE_SK=""
STRIPE_ACC=""

2
README.md

@ -49,6 +49,8 @@ OWNER_NAME: The name of the individual or organization this page is accepting do
META_TITLE: The metadata title for the site.
TITLE: The title on the homepage.
DESCRIPTION: The description of the homepage.
DEFAULT_CURRENCY: The default currency when the page is first reached.
STRIPE_PK: Stripe publishable key.
STRIPE_SK: Stripe secret key.
STRIPE_ACC: Stripe account ID

2
build.sh

@ -1,6 +1,6 @@
#!/bin/bash
VERSION="1.2.0"
VERSION="1.2.1"
# build frontend
cd ./frontend

2
frontend/package.json

@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"description": "EleutheriaPay Frontend",
"scripts": {

14
frontend/src/App.vue

@ -109,8 +109,10 @@
</b-navbar-nav>
</b-navbar>
<Index
v-if="configLoaded"
:title="title"
:description="description"
:defaultCurrency="defaultCurrency"
/>
</div>
</template>
@ -147,11 +149,19 @@ export default {
LinkedinIcon,
},
data: () => ({
configLoaded: false,
theme: '',
metaTitle: '',
title: '',
description: '',
currency: '',
defaultCurrency: '',
acceptedCurrencies: [
{ value: 'usd', text: 'USD - United States Dollar' },
{ value: 'cad', text: 'CAD - Canadian Dollar' },
{ value: 'gbp', text: 'GBP - Pounds Sterling' },
{ value: 'aud', text: 'AUD - Australian Dollar' },
{ value: 'eur', text: 'EUR - Euro' },
],
enableOneTime: true,
enableMonthly: true,
enableAnnual: true,
@ -181,6 +191,7 @@ export default {
// Passed to the Index component
this.title = response.data.Title;
this.description = response.data.Description;
this.defaultCurrency = response.data.DefaultCurrency;
// For this component
this.metaTitle = response.data.MetaTitle;
this.backLink = response.data.BackLink;
@ -194,6 +205,7 @@ export default {
this.linkedinLink = response.data.LinkedinLink;
}).then(() => {
document.title = this.metaTitle;
this.configLoaded = true;
});
},
methods: {

12
frontend/src/components/Index.vue

@ -131,13 +131,14 @@ export default {
props: {
title: String,
description: String,
defaultCurrency: String,
},
data: () => ({
amount: 0,
donationMessage: '',
publishableKey: '',
clientSecret: '',
currency: 'cad',
currency: '',
elementsOptions: {
locale: 'auto',
},
@ -161,6 +162,15 @@ export default {
}),
mounted() {
this.amount = this.paymentIncrementOptions[1].value;
console.log(this.defaultCurrency);
/* eslint-disable */
const configCurrencyCheck = this.currencyOptions.filter((currency) => currency.value === this.defaultCurrency);
/* eslint-enable */
if (configCurrencyCheck.length > 0) {
this.currency = configCurrencyCheck[0].value;
} else {
this.currency = 'usd';
}
},
methods: {
beginDonation() {

1
frontend/src/main.js

@ -17,7 +17,6 @@ axios.get('/api/pay/config').then((response) => {
apiVersion: response.data.StripeApiVersion,
locale: response.data.StripeLocale,
};
console.log(response);
Vue.use(StripePlugin, options);
});

11570
frontend/yarn.lock
File diff suppressed because it is too large
View File

2
main.go

@ -57,6 +57,7 @@ func configHandler(w http.ResponseWriter, r *http.Request) {
MetaTitle string
Title string
Description string
DefaultCurrency string
BackLink string
EmailLink string
GitLink string
@ -82,6 +83,7 @@ func configHandler(w http.ResponseWriter, r *http.Request) {
os.Getenv("META_TITLE"),
os.Getenv("TITLE"),
os.Getenv("DESCRIPTION"),
os.Getenv("DEFAULT_CURRENCY"),
os.Getenv("BACK_LINK"),
os.Getenv("EMAIL_LINK"),
os.Getenv("GIT_LINK"),

Loading…
Cancel
Save