Integration with CIELO

Asked

Viewed 323 times

0

I have a question about how to treat --data-binary, the header I know I can handle it that way:

$data = [
    'USER'      => $this->username,
    'PWD'       => $this->password,
    'SIGNATURE' => $this->signature,
    'METHOD'    => 'SetExpressCheckout',
    'VERSION'   => 86,
];

Now the --data-binary below, I don’t know how to assign.

curl
--data-binary
{  
   "MerchantOrderId":"2014113245231706",
   "Customer":{  
      "Name":"Comprador rec programada"
   },
   "Payment":{  
     "Type":"CreditCard",
     "Amount":1500,
     "Installments":1,
     "SoftDescriptor":"123456789ABCD",
     "RecurrentPayment":{
       "AuthorizeNow":"false",
       "EndDate":"2019-12-01",
       "Interval":"SemiAnnual",
       "StartDate":"2015-06-01"
     },
     "CreditCard":{  
         "CardNumber":"1234123412341231",
         "Holder":"Teste Holder",
         "ExpirationDate":"03/2019",
         "SecurityCode":"262",
         "SaveCard":"false",
         "Brand":"Visa"
     }
   }
}

Can someone give me a hand?

  • 1

    Can you be clearer in your question? What do you need to do? How did you try to do it? What mistakes did you make? Add that to the question to make it easier for us to understand.

  • Make a CURLOPT_POSTFIELDS with the data of json guy, curl_setopt(CURLOPT_POSTFIELDS, $json). Maybe that’s enough, but I’m not sure.

  • my question is exactly how to put the data-Binary inside the JSON: I don’t know how to treat the Custumer, payment and Credit Card divisions ː "Merchantorderid":"2014113245231706", "Customer":+ "Name":"Buyer rec programmed" },

  • It is not clear your doubt, the --data-binary only indicates that what comes next is the information to be sent, it does not have to be placed inside the JSON, this makes no sense. For example curl -d "parametro=valor&outro=coisa" the -d indicates that it will be a x-www-form-urlencoded with the values ("parameter=value&other=thing"), if it is -f must make a multipart/form-data... The --data-binary indicates, to the best of my knowledge, that it should be sent "as is" without any treatment by CURL. Already the creation of the JSON is something else, which should be documented in the API.

  • My question is this, how to document the JSON in the API ? Can you help me, please?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.