diff --git a/jslib b/jslib
index e28e820286..de9bcac0ec 160000
--- a/jslib
+++ b/jslib
@@ -1 +1 @@
-Subproject commit e28e820286870df0111bd4feb8a219a3ae360ba7
+Subproject commit de9bcac0ec9f4429c17af4b952f58a2054aad02e
diff --git a/src/app/settings/adjust-storage.component.html b/src/app/settings/adjust-storage.component.html
index 5e4f40f32b..3417756e0a 100644
--- a/src/app/settings/adjust-storage.component.html
+++ b/src/app/settings/adjust-storage.component.html
@@ -27,3 +27,4 @@
+
diff --git a/src/app/settings/adjust-storage.component.ts b/src/app/settings/adjust-storage.component.ts
index b613f89f74..dde64552b1 100644
--- a/src/app/settings/adjust-storage.component.ts
+++ b/src/app/settings/adjust-storage.component.ts
@@ -3,6 +3,7 @@ import {
EventEmitter,
Input,
Output,
+ ViewChild,
} from '@angular/core';
import { ToasterService } from 'angular2-toaster';
@@ -13,6 +14,10 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
import { StorageRequest } from 'jslib/models/request/storageRequest';
+import { PaymentResponse } from 'jslib/models/response/paymentResponse';
+
+import { PaymentComponent } from './payment.component';
+
@Component({
selector: 'app-adjust-storage',
templateUrl: 'adjust-storage.component.html',
@@ -25,8 +30,10 @@ export class AdjustStorageComponent {
@Output() onAdjusted = new EventEmitter();
@Output() onCanceled = new EventEmitter();
+ @ViewChild(PaymentComponent) paymentComponent: PaymentComponent;
+
storageAdjustment = 0;
- formPromise: Promise;
+ formPromise: Promise;
constructor(private apiService: ApiService, private i18nService: I18nService,
private analytics: Angulartics2, private toasterService: ToasterService) { }
@@ -44,7 +51,10 @@ export class AdjustStorageComponent {
} else {
this.formPromise = this.apiService.postOrganizationStorage(this.organizationId, request);
}
- await this.formPromise;
+ const result = await this.formPromise;
+ if (result != null && result.paymentIntentClientSecret != null) {
+ await this.paymentComponent.handleStripeCardPayment(result.paymentIntentClientSecret, null);
+ }
this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' });
this.toasterService.popAsync('success', null,
this.i18nService.t('adjustedStorage', request.storageGbAdjustment.toString()));