TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
Online payment collection
Has anyone got any experience of integrating DBFlex/TeamDesk with online payments. Bear in mind that I want to do as little interface building as possible as we have almost no skills in this area.

In general we want to be able to
- on the back of periodic invoices allow the invoice recipient make the payment online
- where authorised, collect the payment without any customer interaction
- however specifically NOT hold any credit card or similar data in our system
ID
963
Category
Integration/API
Author

Philipp Matuschka (MMB)
Date Created
2/22/2016 6:50:02 AM
Date Updated
8/25/2016 11:57:55 AM
Comments
cooper collier  2/22/2016 8:18:31 AM
This would depend on your choice of credit card processor. I have a client that someday wants this sort of thing, so I just did a 5 minute look for you.

With Stripe I think it could be done.

If you do not want to store the card info, then you have to make a button, check the ask the user feature so it prompts for CC info.

Then you will make a CALL URL event.

The STripe call will look something like this
https://api.stripe.com/v1/charges \ -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \ -d amount=400 \ -d currency=usd \ -d source=tok_17hIb42eZvKYlo2CguRWHS8Z \ -d description="Charge for test@example.com"

You will then get a response.
You will need to extract the important data from the response and put it into fields.
Keep in mind that you may want more than one transaction for each person, So you will need to make a linked table for payments.

Compared to some of the other API things I have been working on this weekend. This looks like it would be pretty easy.

You can look at the Stripe API documentation here.
https://stripe.com/docs/api#create_charge

If you have another credit card processor in mind. I have no idea. See if they have available developer/api documentation. I would be happy to take a 5 minute look at it. But do not know when that 5 min will be available today.

PS, when you are looking at api documents, you want to try and find info on HTTPS, "post /get", or CURL (CallURL). These should work with the TeamDesk: Rules: Action: "call URL"





Philipp Matuschka (MMB) 2/22/2016 8:20:20 AM
Cooper

Thanks for that. I had also found Stripe in my search. What I was wondering though was had anyone actually done it yet
cooper collier  2/22/2016 8:50:09 AM
Nope have not done it for credit processing..
I have just been testing API integration's all weekend. Working on the MAP issue that was in one of last weeks posting. USING curl API for credit cards is technically no different!

Here is how I have been testing..API's

1. Get an API key.
2. Build a request in something like notepad+ or notepad, I found this is way faster than initially doing it in teamdesk.

In the case of stripe it will look like this
https://api.stripe.com/v1/charges \ -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \ -d amount=400 \ -d currency=usd \ -d source=tok_17hIb42eZvKYlo2CguRWHS8Z \ -d description="Charge for test@example.com"

YOU have to replace the -u key with the API key that belongs to you.

Now just copy that to the address bar on a web page. You should get a response.
The response can be in JSON or XML. I prefer xml its easier for me to read. But json is ok . Here is a response from a map call I was working on last night....
=================
<response>
<script>
(function (b, d,a){window[b]=new function(){var f=window.alert,c=window.confirm,g=window.prompt,e=function(a){a.namespace=b;window.postMessage(a,"*")};this.set=function(b,c){b==d&&(a=c)};window.alert=function(b){var c=a.blockalert||a.renderalert||!1;e({alert:{blocked:c,message:b?b.toString():""}});return c?!1:f(b)};window.confirm=function(b){var d=a.blockconfirm||!1;e({confirm:{blocked:d,message:b?b.toString():""}});return d?!1:c(b)};window.prompt=function(b,c){var d=a.blockprompt||!1;e({prompt:{blocked:d,message:b? b.toString():"",def:c}});return d?!1:g(b,c)}}})("n8990527128335088", "6688882592134178", {"blockalert":true,"blockconfirm":false,"blockprompt":false,"renderalert":false});
</script>
<info>
<statusCode>0</statusCode>
<messages/>
<copyright>
<imageUrl>http://api.mqcdn.com/res/mqlogo.gif</imageUrl>
<imageAltText>© 2015 MapQuest, Inc.</imageAltText>
<text>© 2015 MapQuest, Inc.</text>
</copyright>
</info>
<routeError>
<errorCode>-400</errorCode>
<message/>
</routeError>
<route>
<sessionId>56cb12cf-0019-001b-02b7-5201-00163e57350f</sessionId>
<options>
.......
==========================

Each <section> can be extracted and put into a teamdesk column.

Once you have the format of the URL working. Put it into TeamDesk.

Make a new table. Put two fields in it, One a text call it name.
The second is a text multi-line call it full response

Now make a new button. Set the action to Call URL
Put the URL you just tested into it.
Make an assign with Responce() => full response.

go to the database, make a new record, type something in the name and save it.
view the record, click the button you made.
see if you get the response!
IF you do, your on the way!!
You can make a request to the processor
and get the response!

Then its all in the details.


Notes,
I recommend making an API Key variable, makes it much easier. [stripe api]
the Teamdesk "Call URL" action uses the <%[column]%> format to insert fields into the url.
So your call URL can be https://api.stripe.com/v1/charges \ -u sk_test_<%[stripe api}%> \ -d a......

ps.. glad you asked, it reminded me a client wants to do this exact thing with stripe, now I can tell them, it can be done, when I have time!





Philipp Matuschka (MMB) 2/25/2016 3:58:19 AM
Cooper

Thanks for that very detailed example. I know enough about this API stuff to understand your explanation, but not enough to reproduce it for my purposes. I guess it is an area I am just going to have to learn more about
basenine 5/5/2016 1:49:47 AM
That's a great instruction post Cooper.

Thanks for taking the time to do that

Cheers - Brett
Philipp Matuschka (MMB) 6/23/2016 2:20:19 PM
Cooper

In your first response to my post you wrote:
If you do not want to store the card info, then you have to make a button, check the ask the user feature so it prompts for CC info.

What do you mean by "ask the user". Do you mean User Input? If so surely this ends up doing exactly what I didn't want and collects the information in database fields. Or does Ask the user mean something else?
Philipp Matuschka (MMB) 8/25/2016 11:57:55 AM
All, we got Stripe integration working with some changes made by the DBFlex developers, some integration via external web pages and some work just using DBFlex configuration.

For credit card registration: From within DBFlex we call an external web page which in turn calls the Stripe Registration form. This collects credit card data from out customer and returns a token to our web page. this token can only be used in combination with our Stripe registration to make actual charges to the credit card. The token is passed back to DBFlex via an API call. As part of this we developed a simple mechanism to avoid DOS attacks. Essential is that we do NOT store any credit card information.

For collections the DBFlex developers kindly added the POST method to the Call URL action which enabled us to make a call to Stripe using our registration data and the token obtained for our customer as described above and make a credit card charge.
Feedback
Back to Search Results