File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
src/Plugin/Wechat/Pay/Common
tests/Plugin/Wechat/Pay/Common Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## v3.2.13
2
+
3
+ ### optimized
4
+
5
+ - optimize: 微信退款可取消 notify_url(#741 )
6
+
1
7
## v3.2.12
2
8
3
9
### added
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ protected function doSomething(Rocket $rocket): void
26
26
$ config = get_wechat_config ($ rocket ->getParams ());
27
27
$ payload = $ rocket ->getPayload ();
28
28
29
- if (empty ($ payload ->get ('notify_url ' ))) {
30
- $ merge ['notify_url ' ] = $ config ['notify_url ' ] ?? '' ;
29
+ if (empty ($ payload ->get ('notify_url ' )) && ! empty ( $ config [ ' notify_url ' ]) ) {
30
+ $ merge ['notify_url ' ] = $ config ['notify_url ' ];
31
31
}
32
32
33
33
if (Pay::MODE_SERVICE === ($ config ['mode ' ] ?? null )) {
Original file line number Diff line number Diff line change @@ -79,4 +79,13 @@ public function testNormalNotifyUrl()
79
79
$ result = $ this ->plugin ->assembly ($ rocket , function ($ rocket ) { return $ rocket ; });
80
80
self ::assertEquals ('yansongda.cn ' , $ result ->getPayload ()->get ('notify_url ' ));
81
81
}
82
+
83
+ public function testEmptyNotifyUrl ()
84
+ {
85
+ $ rocket = (new Rocket ())
86
+ ->setParams (['_config ' => 'empty_wechat_public_cert ' ])->setPayload (new Collection ());
87
+ $ result = $ this ->plugin ->assembly ($ rocket , function ($ rocket ) { return $ rocket ; });
88
+
89
+ self ::assertArrayNotHasKey ('notify_url ' , $ result ->getPayload ()->all ());
90
+ }
82
91
}
You can’t perform that action at this time.
0 commit comments