-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Payment sandbox mode #657
Conversation
src/Payment/API.php
Outdated
{ | ||
$this->merchant = $merchant; | ||
if ($isSandboxMode == TRUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TRUE
-> true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- if ($isSandboxMode == TRUE) {
+ if ($isSandboxMode) {
src/Payment/API.php
Outdated
* | ||
* @var string | ||
*/ | ||
protected $sandboxMode = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- protected $sandboxMode = '';
+ protected $prefix = '';
It looks like PaymentAPITest.php has failed. https://travis-ci.org/overtrue/wechat/jobs/224199863#L342 |
@@ -240,7 +240,7 @@ public function testAuthCodeToOpenId() | |||
|
|||
$response = $api->authCodeToOpenId('authcode'); | |||
|
|||
$this->assertEquals(API::API_AUTH_CODE_TO_OPENID, $response['api']); | |||
$this->assertEqualsself::API_ENDPOINT . $this->prefix . API::API_AUTH_CODE_TO_OPENID, $response['api']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请在本地测试通过再提交,谢谢。
Let me close this PR, and do a clean one. |
@skyred 沙箱模式的签名是不是要从微信服务器获取? |
Following discussion from #507
This PR adds the feature. So, app user can set sandbox mode like this:
Another option to enable to sandbox can be in
$option
:But, this PR does't include the second way. Further contribution is welcomed.