I'm coding a payment gateway plugin for woocommerce but I'm getting stuck on this error when I send a payment auth request to the offsite company that processes the payments. Once the auth request is sent off, I'm supposed to get a response token, that will be appended to a url which will be the payment page the customer will see.
$hostedPageRequest = [ 'Request' => [ 'CardHolderResponseURL' => "https://offapp1/FAC.MerchantIntegration.WebTools/Home/HttpRequestParser", 'RecurringDetails' => null, 'ThreeDSecureDetails' => null, 'TransactionDetails' => [ 'AcquireId' => $acquirerId, 'Amount' => $amountFormatted, 'Currency' => $currency, 'CurrencyExponent' => 2, 'IPAddress' => '', 'MerchantId' => $merchantId, 'OrderNumber' => $orderNumber, 'Signature' => $signature, 'SignatureMethod' => 'SHA1', 'TransactionCode' => 8, 'CustomData' => '', ], ], ]; $result = $client->HostedPageAuthorize($hostedPageRequest); $token = $result->HostedPageAuthorizeResult->SingleUseToken; $paymentPageUrl = "https://$domain/MerchantPages/$pageset/$pagename/"; $redirectUrl = $paymentPageUrl.$token;
I get the json error on the "$result = $client->HostedPageAuthorize($hostedPageRequest)" line of the code.
What exactly am I doing wrong? I'm overall new to PHP and backend coding in general.