File tree 2 files changed +3
-4
lines changed
components/pay-theory-hosted-field
2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ const sessionId = self.crypto.randomUUID();
13
13
export const getData = async ( url : string ,
14
14
apiKey : string ,
15
15
sessionKey : string | null ) => {
16
- // Validate that the session key is generated by crypto.randomUUID
16
+ // Validate that the host is the hosted checkout url if a session key is provided
17
17
// If it is not, set it to null
18
- if ( sessionKey && ! sessionKey . match ( / ^ [ 0 - 9 a - f ] { 8 } - [ 0 - 9 a - f ] { 4 } - 4 [ 0 - 9 a - f ] { 3 } - [ 8 9 a b ] [ 0 - 9 a - f ] { 3 } - [ 0 - 9 a - f ] { 12 } $ / ) ) {
18
+ if ( sessionKey && ! hostedCheckoutEndpoint . includes ( window . location . host ) ) {
19
19
sessionKey = null ;
20
20
}
21
21
Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ class PayTheoryHostedField extends HTMLElement {
43
43
origin : window . location . origin ,
44
44
styles : this . _styles ,
45
45
placeholders : this . _placeholders ,
46
- session : this . _session ,
47
- amount : this . _amount ,
46
+ amount : this . _amount
48
47
} ;
49
48
const json = JSON . stringify ( token ) ;
50
49
const encodedJson = window . btoa ( json ) ;
You can’t perform that action at this time.
0 commit comments