Swagger Specification for PayPal Payment

329 views
Skip to first unread message

Jnr

unread,
Feb 22, 2017, 4:52:45 AM2/22/17
to Swagger
Using a basic JSON Swagger format, I would like to create a PayPal payment. I need to include the following types: intent, sale, and transaction (as stipulated in PayPal API docs) in a payment request - But I need help doing so. 

Could anybody assist me on how to structure a basic swagger spec file for a PayPal payment? NOTE: OAuth is already configured in our platform that uses the access tokens and headers.

Below is my swagger file:
{
 
"swagger": "2.0",
 
"info": {
   
"description": "this is a payment request to through PayPal",
   
"title": "Swagger PayPal Payment",
   
"version": "1.0.0"
 
},
   
"host": "api.sandbox.paypal.com",
   
"basePath": "/v1/payments",
   
"schemes": [ "https" ],
 
"paths": {
   
"/payment":
   
{
     
"post": {
       
"summary": "Creates a payment"
       
"description": "Creates a payment request to Paypal",


       
"responses": {
         
"200": {
           
"description": "OK"
         
}
       
}
     
}
   
}
 
}
}

Ron Ratovsky

unread,
Feb 23, 2017, 2:01:47 PM2/23/17
to swagger-sw...@googlegroups.com

It’s hard to say without diving into their docs, and I’m afraid I don’t have time for that right now.

You basically need to define a model for the payload and define it as a body parameter.

I’d suggest using our online editor for that, take a look at the examples, and it should be fairly simple.

If you have specific questions, report back and we’ll try to answer.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ervinvdmerwe

unread,
Feb 23, 2017, 2:16:11 PM2/23/17
to swagger-sw...@googlegroups.com
Hi, thanks for your reply. I created a payload in body with all the required objects according to their documentation. 

I'll be testing the file soon and post back. 
I sort of figured it out after posting the question. 



Sent from my Samsung Galaxy smartphone.
Reply all
Reply to author
Forward
0 new messages