Using Stripe API - how to structure body and response?

Using Stripe API - how to structure body and response?

  

Hey all, I'm experiencing trouble using REST with the Stripe API. This is my first time doing this and need some amount of help. I'm using some information I copied from the Stripe Demo as my starting point.

Specifically, I'm trying to figure out how to create a card token to begin the transaction process.

1. I've created the input variables I need to pass card data from my input form here:

2. This is where I run into trouble. What information do I put in the body? How is it supposed to be formatted? (I'm using Form URL Encoded but I don't know how to format it)

3. As you can see, the response section already had some data from the Stripe Demo component I copied it from. Can I put additional information in the response section to request more information from Stripe?

I just need a really quick crash course on what I should input in the body request and response sections.

Thanks,

-Levi

Bump. I'm really stuck on how to format this. 

Hi Levi,

What specific information do you need that isn't already supported in the "CreateTokenResponse" structure?

If all the fields you need are already in that structure, just invoke the "CreateToken" REST API Method passing the required input arguments.
You don't need to put anything in that "Request" text box since the all inputs, their place in the server request ("Authorization" input will be sent in Header, other inputs will be sent in Body which will be URL-encoded by the platform) and their data types are already defined.

Having said that, consider using the OutSystems Server Actions available in the same module instead of the REST API methods (there's a "CustomerCreateSilent" server action that abstracts the initial step of obtaining a token before creating a customer) as long as they fit your requirements.

Regards,
Pedro

Pedro Sousa wrote:

Hi Levi,

What specific information do you need that isn't already supported in the "CreateTokenResponse" structure?

If all the fields you need are already in that structure, just invoke the "CreateToken" REST API Method passing the required input arguments.
You don't need to put anything in that "Request" text box since the all inputs, their place in the server request ("Authorization" input will be sent in Header, other inputs will be sent in Body which will be URL-encoded by the platform) and their data types are already defined.

Having said that, consider using the OutSystems Server Actions available in the same module instead of the REST API methods (there's a "CustomerCreateSilent" server action that abstracts the initial step of obtaining a token before creating a customer) as long as they fit your requirements.

Regards,
Pedro

Thank you for your response Pedro, I'll try again with the information you've given me. I am using the "CustomerCreateSilent" server action and was trying to figure out the tokenization part of the action. Because I'm new to using outsystems/APIs in general, I have been confused on what I'm supposed to have input and where to input it.

I'm attempting to dissect it so I can learn how it works and how to pass arguments/variables to other APIs I use in the future.

-Levi