@@ -446,31 +446,33 @@ export class PayProV2 {
446
446
447
447
static processResponse ( responseData ) {
448
448
let payProDetails : any = {
449
+ paymentId : responseData . paymentId ,
449
450
payProUrl : responseData . paymentUrl ,
450
451
memo : responseData . memo
451
452
} ;
452
453
453
454
// otherwise, it returns err.
454
455
payProDetails . verified = true ;
455
456
456
- // getPaymentOptions
457
457
if ( responseData . paymentOptions ) {
458
458
payProDetails . paymentOptions = responseData . paymentOptions ;
459
459
payProDetails . paymentOptions . forEach ( option => {
460
460
option . network = NetworkMap [ option . network ] ;
461
461
} ) ;
462
462
}
463
463
464
- // network
465
464
if ( responseData . network ) {
466
465
payProDetails . network = NetworkMap [ responseData . network ] ;
467
466
}
468
467
469
468
if ( responseData . chain ) {
470
- payProDetails . coin = responseData . chain ?. toLowerCase ( ) ; // TODO responseData.coin ???
471
469
payProDetails . chain = responseData . chain ?. toLowerCase ( ) ;
472
470
}
473
471
472
+ if ( responseData . currency ) {
473
+ payProDetails . currency = responseData . currency ;
474
+ }
475
+
474
476
if ( responseData . expires ) {
475
477
try {
476
478
payProDetails . expires = new Date ( responseData . expires ) . toISOString ( ) ;
@@ -479,6 +481,14 @@ export class PayProV2 {
479
481
}
480
482
}
481
483
484
+ if ( responseData . time ) {
485
+ try {
486
+ payProDetails . time = new Date ( responseData . time ) . toISOString ( ) ;
487
+ } catch ( e ) {
488
+ throw new Error ( 'Bad time' ) ;
489
+ }
490
+ }
491
+
482
492
if ( responseData . instructions ) {
483
493
payProDetails . instructions = responseData . instructions ;
484
494
payProDetails . instructions . forEach ( output => {
0 commit comments