04. Training [14:56]

Description: This video explains the following:

  1. How to set and get the Process Mode.
  2. How to process crerdit card transactions in FileMaker.
  3. How to get the gateway response.

Transcript:

FM Credit Card training: In this video we are going to take a look at the integration steps and necessary plug-in function calls in order to process credit card transactions. First we’ll look at how to get and set the Process Mode. Then we’ll look at how to process a Credit Card Transaction; and how to get the Gateway Response.

0:20 Here we’re looking at our FileMaker demo file. Let’s take a look at our scripts under the hood so we can look at some of our plug-in function calls from the developer stand point. First you will notice we have all of our global demo buttons; we can just go ahead and minimize all of those scripts, we don’t need those for this demonstration here. We can minimize these global scripts as well; these are just registration related, plug-in checker script and a few others; so we are going to go ahead and minimize those. Here under the hood in our demo file, we’ve actually organized the scripts relating to the gateway neatly right beneath the actual name of the gateway. So currently our plug-in works with four different gateways: we have Authorize.Net, PayPal, OGone and Eway; and then we have these two scripts to set the Process Mode and get the Process Mode. And these are really basic, if we just open up the Get Process Mode; here you can see we perform some validation and plug-in checker scripts here at the beginning and then we simply just call the function GetProcessMode in order to retrieve the process mode. Very similar for Set Process Mode, we just basically call the Set Process Mode function and either set the process mode to TEST or LIVE. A requirement of working with the plug-in is that you do need to actually set the Process Mode. So let’s open up Data Viewer for just a moment; we’ll navigate to Watch, select Add Expression here and we’ll go ahead and look at all the Functions here by selecting External Functions; and now I can see I have all the FM Credit Card functions neatly organized right here. So if we were to actually scroll down to the GetProcessMode function and evaluate that, I can see that I’m actually in TEST mode. If I were to actually change the process mode using the SetProcessMode function; and I’ll go ahead and set it to LIVE since the parameter can only take the value of LIVE or TEST, I’m going to return a 0(zero) for success and if I were to go ahead and call the GetProcessMode, you can now see that I’m actually going to be in LIVE mode. For our video purposes here, we’re going to set the Process Mode to TEST since we do not want to process any live credit card transactions here. Go ahead and set that and result of 0, 0 always means a success with all of our plug-ins here.

2:40 Let’s go ahead and begin by working with Authorize.Net. So I’m actually going to close this window here and let’s go into our scripts and let’s just adjust some of these window sizes here to fit my screen. If we go to the Authorize.Net; these are all of the scripts that involve working with the Authorize.Net gateway. So if we were to go to choose a gateway in Authorize, you can see I have various different options; Authorize & Capture, Authorize, Capture….and all of our scripts basically correspond to these different options. All these scripts beneath these two at the top correspond with all of these different tabs. So if we were doing a Capture Only, we would just open up the capture script and you can see of course we always have our validation and plug-in checker script to make sure that the user doesn’t get into any trouble. And here quite simply, we’re just calling the AN_Capture function followed by the GetResp function in order to retrieve the response for the gateway. I think it’s better to actually show this in our data viewer rather than running through the script because you can actually see the values and responses here. So let’s go ahead and we’ll open the Data Viewer, navigate to Add Expression and let’s go down to look at all of our functions here. And something to make a note of is that there are 4 gateways we work with; all of the Authorized functions are all prefixed with AN, so you can see AN are all related to the Authorize. The Eway only has two and it’s all going to be prefixed with EW. The Ogone is prefixed with OG for all of the Ogone related functions and then PayPal is prefixed with PP; so you can see here these are all the PayPal functions.

4:25 We are going to start with Authorize.Net and we are actually going to do an authorizing capture. So let me just get the actual function here up and I’m going to go ahead and just comment that out. I have a live example here that we’re going to show you. I’m going to grab this right here and put this in here; so as you can see my first parameter, which is a required parameter, is the APILoginID which I’m just going to hardcode right here for our demonstration purposes. Then I have the TransactionKey, again I’m hardcoding that right here; now the login ID and TransactionKey are actually provided by Authorize.Net for your unique specific account that you’ve created. We then have the dollar amount that we want to do an authorization and capture for; I’m going to put in $3.50, we have the credit card number right here and we have the expiration date right here. These are required parameters; there are numerous different optional parameters that are available, and we’re going to save that for another video. So I’m leaving the optional parameter out of this request. If you ever had any questions as to what any of these parameters are, you can actually go to the functions guide; and I’ll go ahead and open up that now; we’ve organized the functions guide based off the different gateways, so as you can see here we have the first part is just error and registration related, second our global gateway related functions; third are all the Authorized.net related functions, all the PayPal, Ogone and then Eway. So if we were to actually take a look at the AN_AuthCapt function, which is what we are looking at, here I can see what the actual purpose of this function is: it’s going to authorize and capture funds in one action, I can see all the different parameters and the purpose/the values they take and different formats. I can see the return value so I’m going to get a transaction ID or I’m going to receive an error. Now you want to store the transaction ID I a safe place in FileMaker because if you are doing ta return or credit, you’re going to actually need to reference the transaction ID for the transaction that you want to do a return or credit on and we’re going to take a look at that a little bit later as well. Let’s go back into FileMaker and let’s just go ahead and evaluate this here. You can see I have successfully done an Authorize.Net Authorization and Capture in one step and i have returned the transaction ID here that you would actually store in FileMaker.

6:51 Let’s move forward and why don’t we actually go ahead and look at an Ogone Sale Function. So again I’ll comment out the actual raw function and I already have some really nice examples here for us. And again we have all of the parameters here and then we have the values that I’ve hardcoded in here. If we wanted to go ahead and look at what those parameters were, I can go into the functions guide and why don’t I just go all the way up to the top and let’s take a look at the Ogone and sale function right here. This tells me all of the parameters and the purpose and values. One thing to note about the Ogone functions is that when you are putting in an order ID, it must be a unique ID for each order; and again we have our required parameters and then our OptParam. So let me go into FileMaker; let me just make sure that this actually is a unique order ID, we may have used that number before so I’ll go ahead and put another number in there. I’m going to go ahead and evaluate that now; as you can see my sale has been successfully processed and this was for 10 Euros as we can see there, and I did actually get the transaction ID, so I’m going to go ahead and copy that transaction ID because the next thing we’re going to show you is actually an Ogone refund. So let me go into Ogone Refund right there; and I’ll go into my text file that I have and grab one of my examples for you, just put it down one so that way you can actually see the live example there. I’m going to have to copy this transaction ID because that’s going to go right into the pay ID parameter. We do need to fill out an amount; let’s just go ahead and keep it for the same amount of the sale; we’ll call it $10.00. And Final is a parameter I’m going to set to True; can either take the value of True or False. And again if you are not sure of the values let’s go back to our Acrobat file and let’s go ahead and look at an actual Ogone refund here; and here I can see these are all my parameters. So the pay ID is the ID from the original transaction and then Final is what we set to True or False and Final is basically as you can see it’s whether or not a refund is in the final transaction for the corresponding ID. So I’m going to go ahead and let’s go back to FileMaker and I will go ahead and evaluate this now; and I got a success, it returned again the same transaction ID because it did successfully refund that transaction. You can’t provide a final refund twice, so if I were to evaluate this again, I’m actually going to get an error string. What I can do to capture errors is I could go ahead and call GetLastError function and I’ll go ahead and put in “text” in order to return a textual description of the error. Here I can see that this is my error: The Gateway operation failed because the order has not been settled. You can dive further into these errors by the GetResp function and we’ll take a look at that in just a moment here.

9:55 Let’s go ahead and just continue on and process a Pay Pal request here. So for PayPal we are going to do an Authorize; go ahead and comment that out there; and let’s go back and grab my sample for PayPal. And as you can see again, I’ve pre-populated it with all of the values we need; just hardcoding it in and going to charge $10.01 right here. So let’s go ahead and select Evaluate Now and that should successfully return a Transaction ID; there we go, we’ve now successfully authorized our PayPal account. Now if we were off a couple values; let’s go ahead and maybe we’ll change the password to something we know isn’t valid; and we can go ahead and re-evaluate this transaction. We should receive an error and what you can do is you can either call the GetLastError function, which I’ll go ahead and do right now; leave the parameter blank if you’d like. We’re going to go ahead and put text in there and now I can see my description as that the user authentication failed. The GetResp function right here actually returns the response from the last gateway. So if we were looking at PayPal for example; let’s just go back to our documentation here and scroll all the way up to the Table of Contests so you can see in addition to having all of the function calls, we also have the available keys or fields for the GetResp function. So depending on the gateway you are working with; I’ll select PayPal since that’s the gateway I’m working with. Here I can see these are all of the possible transaction return values, so I can pass all of these different keys to my GetResp function. Let’s go ahead and we’ll just pass results to that and we’ll take a look and see what happens here. I did get a result of 1, so we do need to actually go back and we can see here the outcome of the attempted transaction, a 0 means that it was approved and any other value for results; such as a 1; that we got back  indicates that it’s been declined or an error.  So if we want to actually get a message with some text here, we probably want to call RESPMSG and there are all sorts for different combinations that you can do. Let’s see what our different result is here; and there I can get a specific error saying User authentication failed. So there are lots of different mixes and matches that you can make, depending on your scripting and your FileMaker needs and we certainly give you the flexibility to do that within our plug-in.

12:32 Let’s stay in FileMaker, let’s cancel out of here, and we will close our data viewer and let’s go look at a couple of our scripts here. So if we were to look at an Ogone sale, which you recall we previously did, you can see that it’s really similar to what I was doing in the data viewer; we just have it in script form were you can see we’re doing out validation, plug-in checkers, we’re calling the OG_Sale function, passing the necessary values; now you could even change your scripting if you want the result to actually be error, you could certainly trap for error here and return a custom dialog or you could just call the GetResp function and then pass whatever key or field you want in order to return your desired result. If we were to look at the Ogone gateway and evalue for the GetResp let’s see what the “NCERRORPLUS” is; you can see that’s what we’re passing to the GetResp. So let’s go ahead and look at Ogone.  Alright, so here we’re passing the NCERRORPLUS, and as you can see that returns an explanation of the error; so this is just how we have our actual demo file coded. Again, like I said you could call ERROR and then GetLastError or to be more specific and get the actual true response for the gateway, you could call GetResp and follow it with whatever field or key you want returned; such as the text or the number, there’s lots of different flavors and return values you can get from the gateway. So definitely take a look at this documentation.

14:04 And that pretty much about wraps it up; very simple function calls, I’m not going to go ahead and save that, and all dependent on what gateway provider you choose. Again, we work with all four of these different gateways; Authorize and PayPal are probably the biggest on the market , Ogone tends to be a little more Euro friendly and Eway is out of Australia. So we’re giving you lots of different varieties depending on your country and what your needs are.

Now we can begin to integrate the plug-in into your FileMaker solution. Please make sure you utilize all available tools we provide; such as training videos, documentation and reverse engineer our demo file. If you have any questions please contact us via email, phone or browse our forum if you have any questions. We look forward in assisting you in automating your credit card transactions in FileMaker today!