Merge pull request #5708 from mempool/nymkappa/sca-notification
[accelerator] print sca status for google payment
This commit is contained in:
		
						commit
						25133d8505
					
				| @ -613,7 +613,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { | ||||
|               return; | ||||
|             } | ||||
|             const verificationToken = await this.$verifyBuyer(this.payments, tokenResult.token, tokenResult.details, costUSD.toFixed(2)); | ||||
|             if (!verificationToken) { | ||||
|             if (!verificationToken || !verificationToken.token) { | ||||
|               console.error(`SCA verification failed`); | ||||
|               this.accelerateError = 'SCA Verification Failed. Payment Declined.'; | ||||
|               this.processing = false; | ||||
| @ -623,10 +623,11 @@ export class AccelerateCheckout implements OnInit, OnDestroy { | ||||
|             this.servicesApiService.accelerateWithGooglePay$( | ||||
|               this.tx.txid, | ||||
|               tokenResult.token, | ||||
|               verificationToken, | ||||
|               verificationToken.token, | ||||
|               cardTag, | ||||
|               `accelerator-${this.tx.txid.substring(0, 15)}-${Math.round(new Date().getTime() / 1000)}`, | ||||
|               costUSD | ||||
|               costUSD, | ||||
|               verificationToken.userChallenged | ||||
|             ).subscribe({ | ||||
|               next: () => { | ||||
|                 this.processing = false; | ||||
| @ -752,9 +753,9 @@ export class AccelerateCheckout implements OnInit, OnDestroy { | ||||
|   } | ||||
| 
 | ||||
|   /** | ||||
|    * Required in SCA Mandated Regions: Learn more at https://developer.squareup.com/docs/sca-overview
 | ||||
|    * https://developer.squareup.com/docs/sca-overview
 | ||||
|    */ | ||||
|   async $verifyBuyer(payments, token, details, amount) { | ||||
|   async $verifyBuyer(payments, token, details, amount): Promise<{token: string, userChallenged: boolean}> { | ||||
|     const verificationDetails = { | ||||
|       amount: amount, | ||||
|       currencyCode: 'USD', | ||||
| @ -774,7 +775,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { | ||||
|       token, | ||||
|       verificationDetails, | ||||
|     ); | ||||
|     return verificationResults.token; | ||||
|     return verificationResults; | ||||
|   } | ||||
| 
 | ||||
|   /** | ||||
|  | ||||
| @ -143,8 +143,8 @@ export class ServicesApiServices { | ||||
|     return this.httpClient.post<any>(`${this.stateService.env.SERVICES_API}/accelerator/accelerate/applePay`, { txInput: txInput, cardTag: cardTag, token: token, referenceId: referenceId, userApprovedUSD: userApprovedUSD }); | ||||
|   } | ||||
| 
 | ||||
|   accelerateWithGooglePay$(txInput: string, token: string, verificationToken: string, cardTag: string, referenceId: string, userApprovedUSD: number) { | ||||
|     return this.httpClient.post<any>(`${this.stateService.env.SERVICES_API}/accelerator/accelerate/googlePay`, { txInput: txInput, cardTag: cardTag, token: token, verificationToken: verificationToken, referenceId: referenceId, userApprovedUSD: userApprovedUSD }); | ||||
|   accelerateWithGooglePay$(txInput: string, token: string, verificationToken: string, cardTag: string, referenceId: string, userApprovedUSD: number, userChallenged: boolean) { | ||||
|     return this.httpClient.post<any>(`${this.stateService.env.SERVICES_API}/accelerator/accelerate/googlePay`, { txInput: txInput, cardTag: cardTag, token: token, verificationToken: verificationToken, referenceId: referenceId, userApprovedUSD: userApprovedUSD, userChallenged: userChallenged }); | ||||
|   } | ||||
| 
 | ||||
|   getAccelerations$(): Observable<Acceleration[]> { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user