4
I’m having a problem getting the data received from the payment order from pagseguro
. I’m doing the consultation he’s bringing me the results but I can’t get what’s inside the paymentOrders
for the simple fact that he brings me a code together someone would know how to solve it?
down with the return
stdClass Object
(
[date] => 2018-05-03T14:13:44-03:00
[resultsInThisPage] => 2
[currentPage] => 1
[totalPages] => 1
[paymentOrders] => stdClass Object
(
[98ECCE252FFE40FBAF8A143BF6B7C77A] => stdClass Object
(
[code] => 98ECCE252FFE40FBAF8A143BF6B7C77A
[status] => 1
[amount] => 75
[grossAmount] => 0
[lastEventDate] => 2018-04-08T16:01:26-03:00
[schedulingDate] => 2018-05-08T06:01:24-03:00
[transactions] => Array
(
)
[discount] => stdClass Object
(
[type] => DISCOUNT_PERCENT
[value] => 0
)
)
[CBA68FE94E0B49069397562DF8238AD9] => stdClass Object
(
[code] => CBA68FE94E0B49069397562DF8238AD9
[status] => 2
[amount] => 75
[grossAmount] => 75
[lastEventDate] => 2018-04-08T16:01:26-03:00
[schedulingDate] => 2018-04-08T16:01:24-03:00
[transactions] => Array
(
[0] => stdClass Object
(
[code] => BDEB784FE176479BA9844976DEC8B5D3
[date] => 2018-04-08T16:01:24-03:00
[status] => 1
)
)
[discount] => stdClass Object
(
[type] => DISCOUNT_PERCENT
[value] => 0
)
)
)
)
I tried to use as you described foreach($resOrders->paymentOrders as $key => $value){ var_dump($value); } but give me the following error
Trying to get property of non-object
and alsoInvalid argument supplied for foreach()
– jose
although it may be because the sandbox is under maintenance and will return only at 19 if Oce is testing in sandbox and clear.
– Leonardo Costa
I will check here, I also use pagseguro, but I created a class for the functionalities, so warning here.
– Wees Smith
and... I’m testing in sandbox and I think that might be it, because I came back with the code that was before and has the same mistake
– jose
I used the example code you posted here, and the foreach worked correctly. I’ll do a test straight from the sandbox, you’re doing the search by date range?
– Wees Smith
I am no longer using that url
https://ws.sandbox.pagseguro.uol.com.br/pre-approvals/{preApprovalCode}/payment-orders?email=suporte%40lojamodelo.com.br&token=57BE455F4EC148E5A54D9BB91C5AC12C
and with the result of it I want to take the right payment orders one by one to be shown– jose
try that one
https://ws.sandbox.pagseguro.uol.com.br/pre-approvals/payment-orders?email=suporte%40lojamodelo.com.br&token=57BE455F4EC148E5A54D9BB91C5AC12C
without theasdas/
– Wees Smith
intao but I need his code to show the client who effected this signature if I leave without will show all of there I do not want to show tds the orders of the client in question
– jose
return of your query is in xml?
– Wees Smith
it is not
json
the return– jose