Request in Cielo API in PHP using cURL

-1

I'm trying to do a REQUEST of the form below, I'm not getting:

public function subscribe(){   
$json_url = 'https://apisandbox.cieloecommerce.cielo.com.br/1/sales/';  

$json_string  = json_encode(array(     

    "MerchantOrderId"=>"2014113245231706",
     "Customer" => array(
        "Name" => "Comprador rec programada"
     ),

     "Payment" => array(
        "Type" => "CreditCard",
        "Amount" => 1500,
        "Installments" => 1,
         "SoftDescriptor" => "Assinatura Fraldas"  
     )    


));


$ch = curl_init($json_url);

$options = array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array('Content-type: application/json'), CURLOPT_POSTFIELDS => $json_string
    );

    curl_setopt_array( $ch, $options );
    $result = curl_exec($ch); // Getting jSON result string

    print_r($result);                

    }
    
asked by anonymous 22.02.2017 / 14:18

2 answers

1
  

I am JUST relying on the documentation available at

22.02.2017 / 15:05
0

22.02.2017 / 15:24