Commit 7f7e1490 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(chore): Use pricing matrix on subscription components

1 merge request!578WIP: Marketing pages
Pipeline #88081680 passed with stages
in 46 minutes and 58 seconds
<button
class="mdl-button mdl-button--colored mdl-color--green"
*ngIf="user && !isPlus()"
(click)="purchase(20, 'month')"
(click)="purchase()"
[hidden]="active"
>
Upgrade - 20 Tokens/month
</button>
<button
class="mdl-button mdl-button--colored mdl-color--green"
*ngIf="user && !isPlus() && false"
(click)="purchase(200, 'year')"
[hidden]="active"
>
Upgrade - 200 Tokens/year
Upgrade - {{ minds.upgrades.plus['monthly']['tokens'] }} Tokens/month
</button>
<!--<button-->
<!-- class="mdl-button mdl-button&#45;&#45;colored mdl-color&#45;&#45;green"-->
<!-- *ngIf="user && !isPlus() && false"-->
<!-- (click)="purchase(200, 'year')"-->
<!-- [hidden]="active"-->
<!--&gt;-->
<!-- Upgrade - 200 Tokens/year-->
<!--</button>-->
<button
class="mdl-button mdl-button--colored mdl-color--green"
*ngIf="user && isPlus()"
......@@ -27,7 +27,7 @@
*ngIf="!user"
routerLink="/login"
>
Upgrade - 200 Tokens/year
Upgrade - {{ minds.upgrades.plus['monthly']['tokens'] }} Tokens/month
</button>
<div class="m-plus--subscription mdl-card mdl-shadow--4dp" *ngIf="active">
......
......@@ -33,7 +33,6 @@ export class PlusSubscriptionComponent {
active: boolean = false;
@Output('completed') completed$: EventEmitter<any> = new EventEmitter();
@Input('showSubscription') showSubscription: boolean;
payment: any = {};
payload: any;
minds = window.Minds;
......@@ -71,7 +70,7 @@ export class PlusSubscriptionComponent {
this.purchase();
}
async purchase(amount: number = 20, period: 'month' | 'year' = 'month') {
async purchase(/*amount: number = 20, period: 'month' | 'year' = 'month'*/) {
if (!this.session.isLoggedIn()) {
this.modal.open();
return;
......@@ -81,7 +80,9 @@ export class PlusSubscriptionComponent {
WirePaymentsCreatorComponent,
await this.wirePaymentHandlers.get('plus'),
{
default: this.payment,
interval: 'monthly',
currency: 'tokens',
amount: this.minds.upgrades.plus['monthly']['tokens'],
onComplete: wire => {
this.completed = true;
this.user.plus = true;
......
......@@ -86,6 +86,9 @@ export class ProSubscriptionComponent implements OnInit {
WirePaymentsCreatorComponent,
await this.wirePaymentHandlers.get('pro'),
{
interval: this.interval,
currency: this.currency,
amount: this.minds.upgrades.pro[this.interval][this.currency],
onComplete: () => {
this.active = true;
this.minds.user.pro = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment