Dayanden Posted July 12, 2009 Posted July 12, 2009 FileMaker Pro 10 Advance I am not even sure if the is this right place to post this but here we go. I am working on a program that i would like to integrate with PayPal so that payments can be made for an order. It is fully functional with the exception of the PayPal integration. I don’t have any idea where to even start. This is the gap i need to fill though. Click make payment button - FileMaker sends $ amount to PayPal Costumer makes payment on PayPal - FileMaker receives some kind of conformation Once confirmation is received the program continues doing what it should if payment is placed successfully. I have looked around but have not seen much regarding how to do this. Any guidance or suggestions would be appreciated. Thanks
fseipel Posted July 13, 2009 Posted July 13, 2009 You should be able to achieve this with a WebViewer, if it needs to be done within Filemaker Pro client. PayPal describes how to set up a 'buy now' button here (essentially, an HTML form post). https://www.paypal.com/uk/mrb/pal=Q8VXLGUPTNFSY?cmd=p/xcl/rec/singleitem-techview-outside If you want the 'buy now' to be clicked without user doing anything, simply add JavaScript to the example provided above to submit the form named "_xclick" -- e.g., it might look like this: document._xclick.submit(); I suggest you build the URL using a 'data' URL e.g. http://proofgroup.com/blog/2008/dec/google_mapping_basics_web_viewer; this way Filemaker can set the price, etc dynamically. It wasn't clear if you had more than one item they might purchase. Regarding confirmation of received payment, you could query the HTML source after buyer pays, or use PayPal Web Services to find the transaction. For the former, use GetLayoutObjectAttribute("webviewername";"content"); see http://web.mit.edu/ist/usergroups/filemaker/fmug/pres/scraping.pdf for detailed example.
Dayanden Posted July 15, 2009 Author Posted July 15, 2009 Thank you this information is very helpful.
Dayanden Posted July 15, 2009 Author Posted July 15, 2009 Ok i have the WebViewer working and i can make payments through PayPal. I am trying to use the GetLayoutObjectAttribute("webviewername";"content" ) to get the content of the PayPal page after the payment has been processed If i put the above function in how it is formated it returns nothing. I assume that i need to put the “name” of the WebViewer in but have no idea how to locate this. Once i get the content from the WebViewer i will need to locate the the Transaction ID: on the page and extract it to a storage variable on the database. I think i can get that to work but any help or recommendations on this would be nice as well. The line in the web viewer is Transaction ID: 7DY875693R478523L An email with your order summary has been sent to [email protected]
comment Posted July 15, 2009 Posted July 15, 2009 Once i get the content from the WebViewer i will need to locate the the Transaction ID: on the page and extract it to a storage variable on the database. I think i can get that to work but any help or recommendations on this would be nice as well. See: http://fmforums.com/forum/showpost.php?post/308504/
Cabinetman Posted July 16, 2009 Posted July 16, 2009 I am trying to use the GetLayoutObjectAttribute("webviewername";"content" ) I assume that i need to put the “name” of the WebViewer in but have no idea how to locate this. In layout mode and with the 'Object Info' box showing click once on the Web Viewer. Then type in any name you wish to use for it in the 'Object Name' box... You just have to name it.
Newbies carfax Posted July 17, 2009 Newbies Posted July 17, 2009 > Ok i have the WebViewer working and i can make payments through PayPal. Would you be able to post a sample url for those of us also a bit confused? Any help much appreciated. Alex
Dayanden Posted July 17, 2009 Author Posted July 17, 2009 Cabinetman I have been using from FileMaker 3 but i have never needed to name layout objects. So simple figures i missed it. Thanks. Carfax this is what i have so far. Ignore spelling errors on variables. As long as i can read them i normally don’t go back and fix them. Anyone with a better understanding please feel free to comment. "https://www.paypal.com/xclick/business=" & SMPT::Paypal Account & "&" & "quantity=1&" & "item_name=Diplomas+Order+" & Payment Account Log::CCI_Buisiness Name & "&" & "invoice=" & 1 & "&amount=" & Payment Account Log::Billing_Total & "&address1=" & Payment Account Log::CCI_Buisiness Name & "&address2=" & Payment Account Log::CCI_Billing Street Address & "&city=" & Payment Account Log::CCI_Billing City & "&state=" & Payment Account Log::CCI_Billing State & "&zip=" & Payment Account Log::CCI_Billing Zip Code & "&email=" & Payment Account Log::CCI_Buisiness Email & "&first_name=" & " " & "&last_name=" & " " This is what i know about that so far: "https://www.paypal.com/xclick/business=" This takes the WebViewer to PayPal. & SMPT::Paypal Account & "&" This variable i get from the database to select the correct PayPal account. (Example: [email protected]) "quantity=1&" & this sends the number of the item you are ordering. I am not doing anything to complicated so i only need to send one item at a time. "item_name=Diplomas+Order+" & Payment Account Log::CCI_Buisiness Name & "&" This is the name of the item as PayPal will show it. Again i use a variable to pull the biz name out of the database. "invoice=" & 1 & I think this lets you set an invoice number to the order but i don’t really see this anywhere on the PayPal screen. The number 1 could be changed to anything i think. "&amount=" & Payment Account Log::Billing_Total & This is the amount that PayPal is to charge in the WebViewer. Again i use a variable to send that total to PayPal. ----- I am not positive about anything below this line or what it really does for PayPal------- address1=" & Payment Account Log::CCI_Buisiness Name & Not sure what this links to but i have been using a variable to put in the business name of the person making an order. Hasn't messed anything up yet. "&address2=" & Payment Account Log::CCI_Billing Street Address & Again not sure what this links to but i have been using a variable to put in the business street address of the person making an order. and again it hasn't messed anything up yet. "&city=" & Payment Account Log::CCI_Billing City & I have been sending the city variable in this section. "&state=" & Payment Account Log::CCI_Billing State & I have been sending the state variable in this section. "&zip=" & Payment Account Log::CCI_Billing Zip Code & I have been sending the zip code variable in this section. "&email=" & Payment Account Log::CCI_Buisiness Email & I have been sending the biz contact email variable in this section. "&first_name=" & " " & "&last_name=" & " " I assume you can send the customers name in this section but as i am dealing with businesses and am unsure and don’t care who really places the order as long as it gets paid so i send blank information. I found a sample code on this forum i think some where and just started pluging and messing with it. Hope this helps. Now that i know how to name layer objects and can get the code from the page displayed in the WebViewer (Which works! Thanks again Cabinetman for the missing link.) I am trying to sift through the payment approved screen to get the transaction ID out of it when the customer transmits the final order after paying. Does anyone have any idea if it would be possible to automatically detect if the WebViewer has the approved screen up so i could have the program automatically run the script to get the Transaction ID with out having the user press another button? I don’t think this is possible but i never hurts to ask and se if there is a FMP Master out there with insight.
Newbies carfax Posted July 23, 2009 Newbies Posted July 23, 2009 Don't know if this will help because I am coming from the standpoint of processing directly from my invoice db suing FileMaker and not a web browser but I have had some success thanks to the above posts. I have created a FileMaker webviewer that successfully processes - at least to the Sandbox test site. FileMaker then captures the Authorization code to a field automatically and marks the record "Paid" so that it cannot be processed again (if the webviewer is run again it could potentially wipe out the Auth field with a new Auth or with an error code. So, I click a button from the main invoice record which runs a main script and subscripts. The subscripts fill in things like Ship to info - if this is blank it takes the Bill to info. Subscripts also set the Test API info - that way I only have to call a different subscript when I am ready to use LIVE API info. The webviewer resides on its own layout which the main script goes to after collecting the appropriate variables. The webviewerlooks like this: If ( My_FileMaker_DB::Payment Received = "Y" ; "ALREADY PAID" ; "https://api-3t.sandbox.paypal.com/nvp?" & "METHOD=DoDirectPayment" & "&" & "VERSION=2.3" & "&" & "USER=" & $$USER & "&" & "PWD=" & $$PWD & "&" & "SIGNATURE=" & $$SIGNATURE & "&" & "PAYMENTACTION=Sale" & "&" & "CURRENCYCODE=CAD" & "&" & "INVOICEID=" & My_FileMaker_DB::Invoice # & "&" & "AMT=" & My_FileMaker_DB::Total & "&" & "CREDITCARDTYPE=" & My_FileMaker_DB::CC Type & "&" & "ACCT=" & My_FileMaker_DB::Credit Card # & "&" & "EXPDATE=" & My_FileMaker_DB::Expiry Month & My_FileMaker_DB::Expiry Year & "&" & "CVV2=" & My_FileMaker_DB::Security # & "&" & "BUSINESS=" & My_FileMaker_DB::Bill to Name & "&" & "FIRSTNAME=" & My_FileMaker_DB::Bill to Name & "&" & "LASTNAME=Accounts" & "&" & "STREET=" & My_FileMaker_DB::Bill to Address & "&" & "CITY=" & My_FileMaker_DB::Bill to City & "&" & "STATE=" & My_FileMaker_DB::Bill to Prov & "&" & "COUNTRYCODE=CA" & "&" & "ZIP=" & My_FileMaker_DB::Bill to PCode & "&" & "SHIPTONAME=" & $$ShipName & "&" & "SHIPTOSTREET=" & $$ShipAddress & "&" & "SHIPTOCITY=" & $$ShipCity & "&" & "SHIPTOSTATE=" & $$ShipProv & "&" & "SHIPTOZIP=" & $$ShipPCode & "&" & "SHIPTOCOUNTRYCODE=" & $$ShipCountryCode & "&" & "SHIPTOCOUNTRY=" & $$ShipCountry) Note that I am in Canada and using CAD as the Currency. The script will pause for a few seconds to make sure the processing occurs. A successful processing will result in the webviewer filling with something like this: TIMESTAMP=2009%2d07%2d22T13%3a04%3a27Z&CORRELATIONID=44ff929cbe0b4&ACK=Success&VERSION=2%2e3&BUILD=981639&AMT=368%2e48&CURRENCYCODE=CAD&AVSCODE=X&CVV2MATCH=M&TRANSACTIONID=71J5178959946154J The script now runs a subscript that fills scrapes the 17 rightmost characters into a variable and fills our Authorization Code field with that variable: Set Variable [$sourcecode; ValueGetLayoutObjectAttribute 9 "paypalwebviewer" ; "content"9] If [My_FileMaker_DB:Approval # = ""] Set Field [My_FileMaker_DB:Approval #; Right ( $sourcecode ; 17 )] End if Note that you will have to give the webviewer a name which you can do in the FileMaker Info pallete. After we capture the Auth code the script returns to the main Invoice record layout and sets a "Paid" field to Yes so that the webviewer will not get initiated again even if we go back to that layout - which we normally wouldn't have to or want to do. So, one click payment from my invoice db. If I have guts I will go LIVE today. Hope this helps.
angelleye Posted October 26, 2011 Posted October 26, 2011 I've just released a PayPal plugin for FileMaker (more of a set of custom functions, really) that allows you to work directly with PayPal's API's from within FileMaker using custom functions just like any other functions you use within FM. It's very simple to use and I'm extremely happy to have it done myself just because of the time it's already saved me. I don't have much documentation yet, but it's pretty straight forward and it works great. I do have an overview video and I'm happy to answer any questions you might have about it. Feedback appreciated!
Recommended Posts
This topic is 4777 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now