Trying to implement custom payment using SOAP. Payment system has working examples for php5 https://shop.nets.eu/web/partners/sample-code.
Soap works fine if I run this samples as plain PHP, but inside magento Soap fails.
When I send payment confirmation on checkout I Recieve error from magento REST:
http://mat24.dev/rest/default/V1/guest-carts/62398ebea871c954c98044c1fbe1da1f/payment-information
Status Code:400 Bad Request
{"message":"Unable to place order. Please try again later."}
Code fails at this string
$OutputParametersOfRegister = $client->__call()
Inside capture method I debugged all information and everything is ok, but I cannot see whats going on when I use Soap::__call()
My capture method is approximately looks like this:
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
try {
$merchantId = $this->getConfigData('merchant');
$token = $this->getConfigData('token');
$wsdl = $this->getConfigData('wsdl');
$terminal = $this->getConfigData('terminal');
$InputParametersOfRegister = array
(
"token" => $token,
"merchantId" => $merchantId,
"request" => $RegisterRequest
);
$client = new \SoapClient($wsdl,
['trace' => true, 'exceptions' => true]);
$this->log->info("P A Y M E N T before __call"); //this logging is visible
// Following string causes some error
$OutputParametersOfRegister = $client->__call('Register', ["parameters" => $InputParametersOfRegister]);
$RegisterResult = $OutputParametersOfRegister->RegisterResult;
$this->log->info("P A Y M E N T after __call"); // this logging is invisible
}
catch (\Exception $e) {
$this->log->error('PAYMENT ERROR : ' . $e->getCode() . ' ' . $e->getMessage());
throw new \Magento\Framework\Validator\Exception(__('Payment capturing error.'));
}
}
Please, any ideas how to debug it or what is the issue?