Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API PIX - processor not found #20

Open
arivanbastos opened this issue Dec 27, 2022 · 0 comments
Open

API PIX - processor not found #20

arivanbastos opened this issue Dec 27, 2022 · 0 comments

Comments

@arivanbastos
Copy link

arivanbastos commented Dec 27, 2022

Todas requisições PIX que enviamos para a API retornam processor not found.

ProcessorID
image

XML postado:

<?xml version="1.0" encoding="UTF-8"?>
<transaction-request>
	<version>3.1.1.15</version>
	<verification>
		<merchantId>****</merchantId>
		<merchantKey>****</merchantKey>
	</verification>
	<order>
		<sale>
			<processorID>206</processorID>
			<referenceNum>1</referenceNum>
			<fraudCheck>N</fraudCheck>
			<customerIdExt>37568256634</customerIdExt>
			<billing>
				<name>João da Silva</name>
				<address>Rua Território do Amapá</address>
				<address2>N 10, Apto 01</address2>
				<district>Pituba</district>
				<city>Salvador</city>
				<state>Bahia</state>
				<postalcode>41830-540</postalcode>
				<country>BR</country>
				<phone>71999908199</phone>
				<email>[email protected]</email>
				<documents>
					<document>
						<documentType>CPF</documentType>
						<documentValue>59603497010</documentValue>
					</document>
				</documents>
			</billing>
			<transactionDetail>
				<payType>
					<pix>
						<expirationTime>3600</expirationTime>
						<paymentInfo>Transação de Teste</paymentInfo>
						<extraInfo>
							<info>
								<name>Produto de Teste</name>
								<value>1</value>
							</info>
						</extraInfo>
					</pix>
				</payType>
			</transactionDetail>
			<payment>
				<chargeTotal>1</chargeTotal>
			</payment>
		</sale>
	</order>
</transaction-request>

Resposta Obtida
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><api-error><errorCode>1</errorCode><errorMsg><![CDATA[processor not found ]]></errorMsg></api-error>

Código para reprodução:

$xml = file_get_contents('path/to/xml/file.xml');

$curl = curl_init('https://api.maxipago.net/UniversalAPI/postXML');
$opt = array(
	CURLOPT_POST => 1,
	CURLOPT_HTTPHEADER => array('Content-Type: text/xml; charset=UTF-8'),
	CURLOPT_SSL_VERIFYHOST => 2,
	CURLOPT_SSL_VERIFYPEER => 1,
	CURLOPT_CONNECTTIMEOUT => 30,
	CURLOPT_RETURNTRANSFER => 1,
	CURLOPT_POSTFIELDS => $xml
);

curl_setopt_array($curl, $opt);
$xmlResponse = curl_exec($curl);

$curlInfo = curl_getinfo($curl);
curl_close($curl);

if ($xmlResponse) { 
	$xml = simplexml_load_string($xmlResponse, "SimpleXMLElement", LIBXML_NOCDATA);
	$json = json_encode($xml);
	
	print_r($json);

} else { 
	throw new UnexpectedValueException('[maxiPago Class] Connection error with maxiPago! server', 503); 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant