You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need a webhook that returns data to a controller with post data of type
Message
The issue is that if you try to get data via the JInput, the data is not there..
also the deprecated:
$post = JRequest::get('post');
is not bringing any data...
Instead you need to use:
$postdata = file_get_contents("php://input");
Which i feel is pretty unsafe..for joomla standards in order to use!
the url that returns that explains the webhook is here:
Using JInput you can access $input->json->get('whatever'). The json in there loads up a JInputJson object that will let you pull that data through the API.
Steps to reproduce the issue
Need a webhook that returns data to a controller with post data of type
Message
The issue is that if you try to get data via the JInput, the data is not there..
also the deprecated:
$post = JRequest::get('post');
is not bringing any data...
Instead you need to use:
$postdata = file_get_contents("php://input");
Which i feel is pretty unsafe..for joomla standards in order to use!
the url that returns that explains the webhook is here:
https://github.com/VivaPayments/API/wiki/Webhooks
Expected result
the actual post data to be inside JINPUT....
the above function with file_get_contents gets the following data:
stdClass Object
(
[Url] => https://www.keeppet.gr/develop/index.php?option=com_keeppet&task=api.receiveVivaWebHook
[EventData] => stdClass Object
(
[Email] => chrisvalmas@gmail.com
[ParentId] =>
[Amount] => 340
[ClientId] =>
[MerchantId] => a488534f-b418-4a01-8031-7499f784ee1a
[OrderCode] => 334178772608
[ProductId] =>
[StatusId] => F
[FullName] => dasdas
[Statement] =>
[ResellerId] =>
[InsDate] => 2015-08-28T17:07:15.33
[TotalFee] => 0
[CardNumber] => 411111XXXXXX1111
[SourceCode] => Default
[CompanyName] => 6978999659
[TransactionId] => f6f18164-5e62-44e7-9fda-892ce1a771ad
[CurrencyCode] => 978
[OrderCulture] => el-GR
[MerchantTrns] => b1
[CustomerTrns] => dasddasdsa
[IsManualRefund] =>
[TargetPersonId] =>
[TransactionTypeId] => 5
[TotalInstallments] => 0
[TotalCommission] => 8.4
[CurrentInstallment] => 0
[ResellerSourceCode] =>
[ResellerSourceName] =>
[ResellerCompanyName] =>
[ResellerSourceAddress] =>
[CardTypeId] => 0
[AssignedMerchantUsers] => Array
(
)
)
Actual result
no data in jinput:
JInput Object
(
[options:protected] => Array
(
)
System information (as much as possible)
Joomla 3.4.3 hosted on Bluehost PHP 5.4
Additional comments
I can help in reproduce and check any code suggestions for this in my custom component as it's rather complicated to build up a test environmen!
The text was updated successfully, but these errors were encountered: