Skip to content

Commit adb46a2

Browse files
committed
moved cardpayments consts into store.js to automatically load consts for dev/prod environment
1 parent 289e982 commit adb46a2

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

assets/js/cardpayments.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
"use strict";
22

3-
const STRIPE_PK = 'pk_live_eSasX216vGvC26GdbVwA011V';
4-
const STRIPE_PLANS = {'EUR': 'plan_GgW4ovr7c6upzx', 'USD': 'plan_GejOEdJtfL3kdH'}; // live
5-
const STRIPE_PHP_URL = 'https://api.cryptomator.org/stripe/prepare_payment.php';
6-
7-
//const STRIPE_PK = 'pk_test_JhF3MoFQGw2Is0DB3BSv345P';
8-
//const STRIPE_PLANS = {'EUR': 'plan_GgVY2JfD49bc02', 'USD': 'plan_GgVZwj545E0uH3'}; // test
9-
//const STRIPE_PHP_URL = 'http://localhost/stripe/prepare_payment.php';
3+
// requires store.js
104

115
class OneTimePayment {
126

assets/js/store.dev.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ const PADDLE_HUB_SELF_HOSTED_SUBSCRIPTION_PLAN_ID = 23141;
88
const PADDLE_HUB_MANAGED_SUBSCRIPTION_PLAN_ID = 42235;
99
const PADDLE_PRICES_URL = 'https://sandbox-checkout.paddle.com/api/2.0/prices';
1010
const STORE_API_URL = 'http://localhost:8787/api';
11+
const STRIPE_PK = 'pk_test_JhF3MoFQGw2Is0DB3BSv345P';
12+
const STRIPE_PLANS = {'EUR': 'plan_GgVY2JfD49bc02', 'USD': 'plan_GgVZwj545E0uH3'};
13+
const STRIPE_PHP_URL = 'http://localhost/stripe/prepare_payment.php';

assets/js/store.prod.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ const PADDLE_HUB_SELF_HOSTED_SUBSCRIPTION_PLAN_ID = 770132;
88
const PADDLE_HUB_MANAGED_SUBSCRIPTION_PLAN_ID = 807339;
99
const PADDLE_PRICES_URL = 'https://checkout.paddle.com/api/2.0/prices';
1010
const STORE_API_URL = 'https://store.cryptomator.org/api';
11+
const STRIPE_PK = 'pk_live_eSasX216vGvC26GdbVwA011V';
12+
const STRIPE_PLANS = {'EUR': 'plan_GgW4ovr7c6upzx', 'USD': 'plan_GejOEdJtfL3kdH'};
13+
const STRIPE_PHP_URL = 'https://api.cryptomator.org/stripe/prepare_payment.php';

layouts/donate/list.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ <h3 class="font-headline text-xl md:text-2xl leading-relaxed mb-4">{{ i18n "dona
7070
{{ end }}
7171
{{ define "script" }}
7272
{{ if hugo.IsDevelopment }}
73+
{{ $storeJs := resources.Get "js/store.dev.js" | resources.ExecuteAsTemplate "js/store.js" . }}
74+
<script type="text/javascript" src="{{ $storeJs.RelPermalink }}" defer></script>
7375
{{ $customerPortalJs := resources.Get "js/customerportal.js" }}
7476
<script type="text/javascript" src="{{ $customerPortalJs.RelPermalink }}" defer></script>
7577
{{ $altchaJs := resources.Get "js/altcha/altcha.js" }}
@@ -79,6 +81,8 @@ <h3 class="font-headline text-xl md:text-2xl leading-relaxed mb-4">{{ i18n "dona
7981
{{ $cardPaymentsJs := resources.Get "js/cardpayments.js" }}
8082
<script type="text/javascript" src="{{ $cardPaymentsJs.RelPermalink }}" defer></script>
8183
{{ else }}
84+
{{ $storeJs := resources.Get "js/store.prod.js" | resources.ExecuteAsTemplate "js/store.js" . | minify | fingerprint }}
85+
<script type="text/javascript" src="{{ $storeJs.RelPermalink }}" integrity="{{ $storeJs.Data.Integrity }}" defer></script>
8286
{{ $customerPortalJs := resources.Get "js/customerportal.js" | minify | fingerprint }}
8387
<script type="text/javascript" src="{{ $customerPortalJs.RelPermalink }}" integrity="{{ $customerPortalJs.Data.Integrity }}" defer></script>
8488
{{ $altchaJs := resources.Get "js/altcha/altcha.js" }}

0 commit comments

Comments
 (0)