File tree 3 files changed +12
-5
lines changed
3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,21 @@ export class TrolleyService {
42
42
user . email ,
43
43
) ;
44
44
45
- if ( foundRecipient ?. length === 1 ) {
45
+ if (
46
+ foundRecipient ?. length === 1 &&
47
+ // make sure it's same email address
48
+ foundRecipient [ 0 ] . email === user . email
49
+ ) {
46
50
return foundRecipient [ 0 ] ;
47
51
}
48
52
49
53
const userInfo = await this . tcMembersService . getMemberInfoByUserHandle (
50
54
user . handle ,
51
55
{ fields : BASIC_MEMBER_FIELDS } ,
52
56
) ;
53
- const address = userInfo . addresses ?. [ 0 ] ?? { } ;
57
+ const address = ( userInfo . addresses ?. [ 0 ] ?? { } ) as unknown as {
58
+ [ key : string ] : string ;
59
+ } ;
54
60
55
61
const recipientPayload = {
56
62
type : 'individual' as const ,
@@ -148,7 +154,7 @@ export class TrolleyService {
148
154
const recipient = await this . getPayeeRecipient ( user ) ;
149
155
const link = this . trolley . getRecipientPortalUrl ( {
150
156
email : user . email ,
151
- trolleyId : recipient . trolley_id ,
157
+ userId : user . id ,
152
158
} ) ;
153
159
154
160
return { link, recipientId : recipient . trolley_id } ;
Original file line number Diff line number Diff line change @@ -471,6 +471,7 @@ export class WinningCreateRequestDto {
471
471
grossAmount : 15.0 ,
472
472
installmentNumber : 1 ,
473
473
currency : 'string' ,
474
+ billingAccount : '1234' ,
474
475
} ,
475
476
] ,
476
477
} )
Original file line number Diff line number Diff line change @@ -29,13 +29,13 @@ export class TrolleyService {
29
29
* @throws This function assumes that `TROLLEY_WIDGET_BASE_URL`, `TROLLEY_ACCESS_KEY`,
30
30
* and `TROLLEY_SECRET_KEY` are defined and valid. Ensure these constants are properly set.
31
31
*/
32
- getRecipientPortalUrl ( recipient : { email : string ; trolleyId : string } ) {
32
+ getRecipientPortalUrl ( recipient : { email : string ; userId : string } ) {
33
33
const widgetBaseUrl = new url . URL ( TROLLEY_WIDGET_BASE_URL as string ) ;
34
34
const querystring = new url . URLSearchParams ( {
35
35
ts : `${ Math . floor ( new Date ( ) . getTime ( ) / 1000 ) } ` ,
36
36
key : TROLLEY_ACCESS_KEY ,
37
37
email : recipient . email ,
38
- refid : recipient . trolleyId ,
38
+ refid : recipient . userId ,
39
39
hideEmail : 'false' ,
40
40
roEmail : 'true' ,
41
41
locale : 'en' ,
You can’t perform that action at this time.
0 commit comments