Android Question Using Curl for Paypal

fasilosman

Active Member
Licensed User
Longtime User
Does anyone know that can we use the Curl links for paypal creditcard payments. Is it possible.

Ex-
........................
curl -v https://api.sandbox.paypal.com/v1/payments/payment \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [{
"credit_card": {
"number": "4417119669820331",
"type": "visa".........................................................
 

fasilosman

Active Member
Licensed User
Longtime User
I don't think that there is any valid http request that it is not possible to create with OkHttp.

You can create this request with Job.PostString. The data itself is JSON.

I tried job.PostString using HttpUtils2 library for the following Curl and I got error message as "SSLPeerUnverifiedException: Nopeercertificate"
............Curl..............
curl -v https://api.sandbox.paypal.com/v1/oauth2/token \
-H "Accept: application/json" \
-H "Accept-Language: en_US" \
-u "client_id:secret" \
-d "grant_type=client_credentials"
..................................
...........My Code............
Dim Job As HttpJob
Job.Initialize("MyToken",Me)
Job.Username = "AcY........4NJUL"
Job.Password = "EMD.....GplHKi-x"
Job.PostString("https://api.sandbox.paypal.com/v1/oauth2/token","grant_type=client_credentials")
Job.GetRequest.SetHeader("Accept", "application/json")
Job.GetRequest.SetHeader("Accept-Language", "en_US")
Job.GetRequest.SetContentType("application/json")
Job.GetRequest.SetContentEncoding("text/plain")
................................................
 
Upvote 0
Top