From 7d9e275803e90b621b4419561962086e5f41a3f2 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Wed, 12 Mar 2025 14:56:15 +0100 Subject: [PATCH 1/3] [accelerator] show square receipt if available --- .../accelerate-checkout.component.html | 19 +++++++++++++++++-- .../accelerate-checkout.component.ts | 16 ++++++++-------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html index 4594fd9fc..2038d4b6c 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html @@ -567,14 +567,29 @@ } @else if (step === 'success') {
-

Your transaction is being accelerated!

+

+ @if (accelerationResponse) { + Your transaction is being accelerated! + } @else { + Transaction is already being accelerated! + } +

- Your transaction has been accepted for acceleration by our mining pool partners. + @if (accelerationResponse) { + Your transaction has been accepted for acceleration by our mining pool partners. + } @else { + Transaction has already been accepted for acceleration by our mining pool partners. + }
+ @if (accelerationResponse?.receiptUrl) { + + }

diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index ac6c7f147..06d2fa4cd 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -87,6 +87,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { math = Math; isMobile: boolean = window.innerWidth <= 767.98; isProdDomain = false; + accelerationResponse: { receiptUrl: string | null } | undefined; private _step: CheckoutStep = 'summary'; simpleMode: boolean = true; @@ -194,11 +195,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { this.scrollToElement('acceleratePreviewAnchor', 'start'); } if (changes.accelerating && this.accelerating) { - if (this.step === 'processing' || this.step === 'paid') { - this.moveToStep('success', true); - } else { // Edge case where the transaction gets accelerated by someone else or on another session - this.closeModal(); - } + this.moveToStep('success', true); } } @@ -541,7 +538,8 @@ export class AccelerateCheckout implements OnInit, OnDestroy { `accelerator-${this.tx.txid.substring(0, 15)}-${Math.round(new Date().getTime() / 1000)}`, costUSD ).subscribe({ - next: () => { + next: (response) => { + this.accelerationResponse = response; this.processing = false; this.apiService.logAccelerationRequest$(this.tx.txid).subscribe(); this.audioService.playSound('ascend-chime-cartoon'); @@ -668,7 +666,8 @@ export class AccelerateCheckout implements OnInit, OnDestroy { costUSD, verificationToken.userChallenged ).subscribe({ - next: () => { + next: (response) => { + this.accelerationResponse = response; this.processing = false; this.apiService.logAccelerationRequest$(this.tx.txid).subscribe(); this.audioService.playSound('ascend-chime-cartoon'); @@ -777,7 +776,8 @@ export class AccelerateCheckout implements OnInit, OnDestroy { costUSD, verificationToken.userChallenged ).subscribe({ - next: () => { + next: (response) => { + this.accelerationResponse = response; this.processing = false; this.apiService.logAccelerationRequest$(this.tx.txid).subscribe(); this.audioService.playSound('ascend-chime-cartoon'); From cac404ae9bbce0c6192fddf3a99bb8c79483f134 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Wed, 12 Mar 2025 15:26:44 +0100 Subject: [PATCH 2/3] [accelerator] make sure we cannot go back from 'success' step --- .../accelerate-checkout/accelerate-checkout.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index 06d2fa4cd..0db40af82 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -200,7 +200,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { } moveToStep(step: CheckoutStep, force: boolean = false): void { - if (this.isCheckoutLocked > 0 && !force) { + if (this.isCheckoutLocked > 0 && !force || this.step === 'success') { return; } this.processing = false; From 1121377c7a888d8a1d12859cf9488d3db4b56249 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Wed, 12 Mar 2025 15:27:00 +0100 Subject: [PATCH 3/3] [accelerator] add missing response from cashapp payment --- .../accelerate-checkout/accelerate-checkout.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index 0db40af82..7fc1e88ef 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -870,7 +870,8 @@ export class AccelerateCheckout implements OnInit, OnDestroy { tokenResult.details.cashAppPay.referenceId, costUSD ).subscribe({ - next: () => { + next: (response) => { + this.accelerationResponse = response; this.processing = false; this.apiService.logAccelerationRequest$(this.tx.txid).subscribe(); this.audioService.playSound('ascend-chime-cartoon');