Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/app/account-app/account-transactions.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// --------- BEGIN RUNBOX LICENSE ---------
// Copyright (C) 2016-2026 Runbox Solutions AS (runbox.com).
//
// This file is part of Runbox 7.
//
// Runbox 7 is free software: You can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// Runbox 7 is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Runbox 7. If not, see <https://www.gnu.org/licenses/>.
// ---------- END RUNBOX LICENSE ----------

import { of } from 'rxjs';

import { AccountTransactionsComponent } from './account-transactions.component';
import { MobileQueryService } from '../mobile-query.service';
import { RunboxWebmailAPI } from '../rmmapi/rbwebmail';

describe('AccountTransactionsComponent', () => {
it('shows a generic label for card-or-wallet transactions', () => {
const component = new AccountTransactionsComponent(
{ matches: false, changed: of(false) } as MobileQueryService,
{} as RunboxWebmailAPI,
);

expect(component.methods.stripe).toBe('Card or wallet');
});
});
2 changes: 1 addition & 1 deletion src/app/account-app/account-transactions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class AccountTransactionsComponent implements OnInit {
creditcard: 'Netaxept',
giro: 'Offline',
paypal: 'PayPal',
stripe: 'Stripe',
stripe: 'Card or wallet',
};

statuses = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1> Payment Cards </h1>

<p> Here are the payment cards currently associated with your account.</p>

<p> The details of your payment cards are securely stored and processed by Stripe. </p>
<p> Your payment card details are handled securely through our card payment provider. </p>

<p> Runbox accepts a number of payment methods including credit and debit cards, PayPal, cryptocurrencies, and bank transfers. For details, please see <a href="https://runbox.com/price-plans/payment-methods/" target="info">Payment Methods</a>.</p>

Expand Down
60 changes: 60 additions & 0 deletions src/app/account-app/credit-cards/credit-cards.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// --------- BEGIN RUNBOX LICENSE ---------
// Copyright (C) 2016-2026 Runbox Solutions AS (runbox.com).
//
// This file is part of Runbox 7.
//
// Runbox 7 is free software: You can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// Runbox 7 is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Runbox 7. If not, see <https://www.gnu.org/licenses/>.
// ---------- END RUNBOX LICENSE ----------

import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { of } from 'rxjs';

import { CreditCardsComponent } from './credit-cards.component';
import { RunboxWebmailAPI } from '../../rmmapi/rbwebmail';
import { RunboxContactSupportSnackBar } from '../../common/contact-support-snackbar.service';
import { MatDialog } from '@angular/material/dialog';

describe('CreditCardsComponent', () => {
let fixture: ComponentFixture<CreditCardsComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CreditCardsComponent],
providers: [
{ provide: MatDialog, useValue: { open: jasmine.createSpy('open') } },
{
provide: RunboxWebmailAPI,
useValue: {
getCreditCards: () => of({ payment_methods: [], default: null }),
},
},
{ provide: RunboxContactSupportSnackBar, useValue: { open: jasmine.createSpy('open') } },
],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(CreditCardsComponent);
fixture.detectChanges();
});

it('describes card handling without naming Stripe', () => {
const text = fixture.nativeElement.textContent;

expect(text).toContain('handled securely through our card payment provider');
expect(text).not.toContain('Stripe');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
}
</style>

<h1 mat-dialog-title>Credit card setup via Stripe</h1>
<h1 mat-dialog-title>Add a payment card</h1>

<ng-template #legacyFallback>
<p> Form not loading? </p>

<p>
Make sure your browser extensions are not blocking access to <span style="font-family: monospace">stripe.com</span>.
Make sure your browser extensions are not blocking the payment form.
</p>
</ng-template>

Expand All @@ -51,7 +51,7 @@ <h1 mat-dialog-title>Credit card setup via Stripe</h1>
</div>

<div [style.display]="state === 'loading' ? 'block' : 'none'">
<div> Loading Stripe form... </div>
<div> Loading payment form... </div>
<mat-spinner style="margin:0 auto;"></mat-spinner>

<ng-container *ngTemplateOutlet="legacyFallback"></ng-container>
Expand Down
2 changes: 1 addition & 1 deletion src/app/account-app/stripe-payment-dialog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1 mat-dialog-title class="paymentMethodTitle">Card or wallet payment</h1>
</div>

<div [style.display]="state === 'loading' ? 'block' : 'none'">
<div> Loading Stripe payment form... </div>
<div> Loading payment form... </div>
<mat-spinner style="margin:0 auto;"></mat-spinner>
</div>

Expand Down
8 changes: 4 additions & 4 deletions src/app/account-app/stripe-payment-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ export class StripePaymentDialogComponent implements AfterViewInit {
}
} catch (err) {
console.error(err);
this.stripeError = 'Stripe validate failed';
this.stripeError = 'Unable to validate your payment details.';
this.state = 'failure';
return;
}

this.processing_message = 'Sending details to Stripe .. ';
this.processing_message = 'Sending your payment details...';
try {
const confirmed = await this.stripe.createConfirmationToken({
'elements': this.elements});
Expand All @@ -169,7 +169,7 @@ export class StripePaymentDialogComponent implements AfterViewInit {
});
} catch (err) {
console.error(err);
this.stripeError = 'Stripe submit failed';
this.stripeError = 'Unable to submit your payment details.';
this.state = 'failure';
return;
}
Expand All @@ -178,7 +178,7 @@ export class StripePaymentDialogComponent implements AfterViewInit {

handleConfirmationToken(cId: string) {
return new Promise<void>((resolve, reject) => {
this.processing_message = 'Confirming payment with Stripe .. ';
this.processing_message = 'Submitting your payment...';
this.paymentsservice.submitStripePayment(this.tid, cId).subscribe(res => {
if (res.status === 'requires_action') {
this.processing_message = 'Updating payment after redirect .. ';
Expand Down