Skip to content

Url encoded headers#98

Open
aleksanderkakol wants to merge 24 commits intomasterfrom
headers-from-json-to-urlencoded
Open

Url encoded headers#98
aleksanderkakol wants to merge 24 commits intomasterfrom
headers-from-json-to-urlencoded

Conversation

@aleksanderkakol
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Tpay OpenAPI SDK -

$payload = <<<'JSON'
{
"type": "ALIAS_UNREGISTER",
"msg_value": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

payload is still incorrect msg_value is array of objects not direct object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

// You can access any notification field by $notification->fieldName

// $blikAliasRegisteredProcessor->process($notification)
exit('{"result":true}');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected result is plaintext TRUE not JSON

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

throw new TpayException('Not recognised or invalid notification event: '.json_encode($source));
}

$source = $source['msg_value'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants