mirror of
https://github.com/mempool/mempool.git
synced 2025-09-28 22:53:41 +02:00
Merge pull request #6029 from mempool/nymkappa/accelerator-checkout-fix
[accelerator] we don't need to start a new price subscription at checkout
This commit is contained in:
@@ -474,19 +474,14 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
if (this.processing) {
|
||||
return;
|
||||
}
|
||||
if (this.conversionsSubscription) {
|
||||
this.conversionsSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
this.processing = true;
|
||||
this.conversionsSubscription = this.stateService.conversions$.subscribe(
|
||||
async (conversions) => {
|
||||
this.conversions = conversions;
|
||||
|
||||
if (this.applePay) {
|
||||
this.applePay.destroy();
|
||||
}
|
||||
|
||||
const costUSD = this.cost / 100_000_000 * conversions.USD;
|
||||
const costUSD = this.cost / 100_000_000 * this.conversions.USD;
|
||||
const paymentRequest = this.payments.paymentRequest({
|
||||
countryCode: 'US',
|
||||
currencyCode: 'USD',
|
||||
@@ -586,8 +581,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* GOOGLE PAY
|
||||
@@ -596,19 +589,14 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
if (this.processing) {
|
||||
return;
|
||||
}
|
||||
if (this.conversionsSubscription) {
|
||||
this.conversionsSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
this.processing = true;
|
||||
this.conversionsSubscription = this.stateService.conversions$.subscribe(
|
||||
async (conversions) => {
|
||||
this.conversions = conversions;
|
||||
|
||||
if (this.googlePay) {
|
||||
this.googlePay.destroy();
|
||||
}
|
||||
|
||||
const costUSD = this.cost / 100_000_000 * conversions.USD;
|
||||
const costUSD = this.cost / 100_000_000 * this.conversions.USD;
|
||||
const paymentRequest = this.payments.paymentRequest({
|
||||
countryCode: 'US',
|
||||
currencyCode: 'USD',
|
||||
@@ -711,8 +699,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Card On File
|
||||
@@ -721,16 +707,10 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
if (this.processing) {
|
||||
return;
|
||||
}
|
||||
if (this.conversionsSubscription) {
|
||||
this.conversionsSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
this.processing = true;
|
||||
this.conversionsSubscription = this.stateService.conversions$.subscribe(
|
||||
async (conversions) => {
|
||||
this.conversions = conversions;
|
||||
|
||||
const costUSD = this.cost / 100_000_000 * conversions.USD;
|
||||
const costUSD = this.cost / 100_000_000 * this.conversions.USD;
|
||||
if (this.isCheckoutLocked > 0) {
|
||||
return;
|
||||
}
|
||||
@@ -816,8 +796,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
this.isTokenizing--;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* CASHAPP
|
||||
@@ -826,20 +804,15 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
if (this.processing) {
|
||||
return;
|
||||
}
|
||||
if (this.conversionsSubscription) {
|
||||
this.conversionsSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
this.processing = true;
|
||||
this.conversionsSubscription = this.stateService.conversions$.subscribe(
|
||||
async (conversions) => {
|
||||
this.conversions = conversions;
|
||||
|
||||
if (this.cashAppPay) {
|
||||
this.cashAppPay.destroy();
|
||||
}
|
||||
|
||||
const redirectHostname = document.location.hostname === 'localhost' ? `http://localhost:4200`: `https://${document.location.hostname}`;
|
||||
const costUSD = this.cost / 100_000_000 * conversions.USD;
|
||||
const costUSD = this.cost / 100_000_000 * this.conversions.USD;
|
||||
const paymentRequest = this.payments.paymentRequest({
|
||||
countryCode: 'US',
|
||||
currencyCode: 'USD',
|
||||
@@ -903,8 +876,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* https://developer.squareup.com/docs/sca-overview
|
||||
|
Reference in New Issue
Block a user