Open
Conversation
|
Tpay OpenAPI SDK - |
| $payload = <<<'JSON' | ||
| { | ||
| "type": "ALIAS_UNREGISTER", | ||
| "msg_value": { |
Contributor
There was a problem hiding this comment.
msq_value is array of objects
{
"id": "1010",
"event": "ALIAS_REGISTER",
"msg_value": [
{
"value": "user_unique_alias_123",
"type": "UID",
"expirationDate": "2024-11-02 14:15:01"
}
],
"md5sum": "d303c5af701cdfcaed02f66603239eef"
}
here is urlencoded example (this format is used in reality)
id=1010&event=ALIAS_REGISTER&md5sum=d303c5af701cdfcaed02f66603239eef&msg_value[][value]=user_unique_alias_123&msg_value[][type]=UID&msg_value[][expirationDate]=2024-11-02+14%3A15%3A01
Contributor
There was a problem hiding this comment.
payload is still incorrect msg_value is array of objects not direct object
| // You can access any notification field by $notification->fieldName | ||
|
|
||
| // $blikAliasRegisteredProcessor->process($notification) | ||
| exit('{"result":true}'); |
Contributor
There was a problem hiding this comment.
Expected result is plaintext TRUE not JSON
| throw new TpayException('Not recognised or invalid notification event: '.json_encode($source)); | ||
| } | ||
|
|
||
| $source = $source['msg_value']; |
Contributor
There was a problem hiding this comment.
$source['msg_value'] is array of objects - (probably intented for mutiple events in single webhook call), foreach in line 219 will not be able to properly read parameters from simple array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.