Obtención de autorización
<?php
$end_point = "https://sandbox.decidir.com/services/t/1.1/Authorize.AuthorizeHttpSoap12Endpoint";
$wsdl = "https://sandbox.decidir.com/services/t/1.1/Authorize?wsdl";
$RequestKey=$_GET["rk"];
$AnswerKey=$_GET["pa"];
$headers = array(
'http'=>array(
'header'=>$http_header)
);
$contexto = stream_context_create($headers);
$array_de_datos = array(
"Merchant"=>"12345678",
"Security"=>"PRISMA RV82RVHO5T0O5CZUUTX2FLHU",
"RequestKey"=>$RequestKey,
"AnswerKey"=>$AnswerKey
);
$contexto = stream_context_create($headers);
$soap_client = new SoapClient($wsdl, array(
'stream_context'=>$contexto,
'location'=>$end_point,
'encoding'=>"UTF-8",
));
var_dump($soap_client->GetAuthorizeAnswer($array_de_datos));
Ejemplo de Respuesta:
object(stdClass)#2 (5){
["StatusCode"]=> int(-1) ["StatusMessage"]=> string(8)
"Aprobada" ["AuthorizationKey"]=> string(36)
"a79ea4a6-3fdb-ec2d-1176-080957dab2f3" ["EncodingMethod"]=> string(3)
"XML" ["Payload"]=> object(stdClass)#3 (2) {
["Answer"]=> object(stdClass)#4 (6) {
["FECHAHORA"]=> string(20) "2015-08-28T16:50:46Z"
["MONEDA"]=> string(0) ""
["NROTICKET"]=> string(3) "205"
["CODAUTORIZAción"]=> string(6) "165045"
["NROTARJETAVISIBLE"]=> string(16) "450799XXXXXX4905"
["CODBARRAS"]=> string(0) ""
}
["Request"]=> object(stdClass)#5 (3) {
["NROCOMERCIO"]=> string(8) "12345678"
["NROOPERAción"]=> string(10) "9238742988"
["MONTO"]=> string(5) "50.00"
}
}
}