File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,18 @@ public function getCardToken()
77
77
78
78
private function everyPayRequestHmac ()
79
79
{
80
+ $ options = SignedDataOptions::gateway (
81
+ $ this ->request ->getSecret ()
82
+ )->dontInclude ([
83
+ 'utf8 ' ,
84
+ 'hmac ' ,
85
+ '_method ' ,
86
+ 'authenticity_token '
87
+ ]);
88
+
80
89
return SignedData::make (
81
90
$ this ->data ['request ' ],
82
- SignedDataOptions::gateway (
83
- $ this ->request ->getSecret ()
84
- )
91
+ $ options
85
92
)['hmac ' ];
86
93
}
87
94
Original file line number Diff line number Diff line change @@ -31,6 +31,17 @@ public static function backend($secret)
31
31
]);
32
32
}
33
33
34
+ public function dontInclude (array $ fields )
35
+ {
36
+ $ this ->options ['dontInclude ' ] = array_unique (
37
+ array_merge (
38
+ $ this ->options ['dontInclude ' ] ?? [],
39
+ $ fields
40
+ )
41
+ );
42
+ return $ this ;
43
+ }
44
+
34
45
public function shouldHmacInclude ($ field )
35
46
{
36
47
return !in_array ($ field , $ this ->options ['dontInclude ' ]);
You can’t perform that action at this time.
0 commit comments