$content='"{\"orderId\":\"ORDER-294\",\"paymentState\":\"CANCELED\",\"signature\":\"naK+I79Fd=\",\"message\":\"\u043f\u043b\u0430\u0442\u0443\",\"storeId\":\"KJBDJDAJAB3FB\"}"';
$res=json_decode(json_decode($content), true);
print_r(explode('-',$res['orderId'])[1]); // мне нужно получить число из orderId
$content=file_get_contents('php://input');
$res=json_decode(json_decode($content), true);
print_r(explode('-',$res['orderId'])[1]);
$products = array(
array(
'name'=>'sfdsfsf',
'count'=>5,
'price'=>100
)
);
$url='https://payparts2.privatbank.ua/ipp/v2/payment/create';
$storeId="4AAD1369CF734B64B70F";
$orderId=127043;
$storePass='75bef16bfdce4d0e9c0ad5a19b9940df';
$amount=500;
$partsCount=5;
$merchantType="PP";
$responseUrl="https://test.com.ua/";
$redirectUrl="https://test.com.ua/";
$sign=$storePass.$storeId.$orderId.$amount.'00'.$partsCount.$merchantType.$responseUrl.$redirectUrl.$products[0]['name'].$products[0]['count'].$products[0]['price'].'00'.$storePass;
$signature='IGBXgH788W9UgavBhQ8Y0LnDmPE=';
$json=array(
'storeId' => $storeId,
'orderId' => $orderId,
'amount' => $amount,
'partsCount' => $partsCount,
'merchantType' => $merchantType,
'products' => $products,
'responseUrl' => $responseUrl,
'redirectUrl' => $redirectUrl,
'signature' => $signature
);
$curl_h = curl_init($url);
curl_setopt($curl_h, CURLOPT_HTTPHEADER,
array(
'Accept: application/json; charset=utf-8',
'Content-Type: application/json; charset=UTF-8'
)
);
curl_setopt($curl_h, CURLOPT_POST, 1);
curl_setopt($resource, CURLOPT_POSTFIELDS, $json);
curl_setopt($curl_h, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl_h);
print_r($response);
А роутер в свою очередь должен форварднуть этот сигнал на 192.168.0.105 на порт 9.
Мак адрес нужен роутера а не компьютера.