E
E
Evgeny Vlasov2018-02-25 13:51:26
PHP
Evgeny Vlasov, 2018-02-25 13:51:26

Response using php to the received json. How?

There are tasks:

  1. Send data to the bank server in xml using the POST method
  2. Get and process the response from the bank as json
  3. Give a response to the bank server in the form of json upon successful receipt of data and, quote "... If data is received unsuccessfully in the form of json, send an exception (not in the form of json)."

And if there are no difficulties (at the moment) with the first two points. In paragraph 1 - the usual html form and POST, in paragraph 2 - this is $r = $_POST (conditionally), then how to implement paragraph 3 is not at all clear to me.
I guess what needs to be done using cURL, but there are difficulties right away - I don’t know from which address the data will come, and there is nothing in $_SERVER['HTTP_REFERER'] .
Tell me where to look?
Is it true that this can be done with cURL? Are there any more convenient or more correct methods/ways? Or am I completely misunderstanding?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergej, 2018-02-25
@sayber

You can also use curl.
Regular push notification.
It all depends on where, how and what awaits an answer.
Usually you push, the server answers you something.
All events are logged.
You need to know where to push. If you don’t know, then something is wrong with the API architecture

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question