RealTimeDesigner Support Network
Wiki Forums Libraries Docs Support RealTimeDesigner Home

RealTimeDesigner WIKI

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rtd_manual_ch_12_interfacing_with_other_applications [2012/02/11 20:59]
mark [FORMSEND FIELDS]
rtd_manual_ch_12_interfacing_with_other_applications [2012/12/27 11:45] (current)
mark [OTHER FIELDS]
Line 10: Line 10:
 ==== FORMSEND FIELDS ==== ==== FORMSEND FIELDS ====
  There are just some new fields here, in the "FORMSEND FIELDS" area, which are very important:  There are just some new fields here, in the "FORMSEND FIELDS" area, which are very important:
-- EXTERNAL FORM: Target URL Page +  - EXTERNAL FORM: Target URL Page 
-- EXTERNAL FORM: Target Port +  - EXTERNAL FORM: Target Port 
-- EXTERNAL FORM: Custom Params +  - EXTERNAL FORM: Custom Params 
-- EXTERNAL FORM: Submit method +  - EXTERNAL FORM: Submit method 
-"Target URL Page" is essentially where the module sends the data.+**"Target URL Page"** is essentially where the module sends the data.
 For example, something like "http://mydomain.com/mypage.php" For example, something like "http://mydomain.com/mypage.php"
-Basically, the same value you would insert in a form as "action". +Basically, the same value you would insert in a form as "action".\\ 
-"Target port" is the port you want to address while sending data+**"Target port"** is the port you want to address while sending data
 Normally, for webservers, this port is 80. But it may happen that, for security reasons, you need to Normally, for webservers, this port is 80. But it may happen that, for security reasons, you need to
-address a different port. +address a different port.\\ 
-"Custom Params" is the place to enter your custom form fields, if needed.+**"Custom Params"** is the place to enter your custom form fields, if needed.
 If filled, it must be written in querystring form, so something like: If filled, it must be written in querystring form, so something like:
-param1=abc&param2=123&param3=helloworld etc... +param1=abc&param2=123&param3=helloworld etc...\\ 
-"Submit method" is how to send data+**"Submit method"** is how to send data
 If it's set to "Silent", the checkout will work normally, but you will have your form sent to your If it's set to "Silent", the checkout will work normally, but you will have your form sent to your
-processing page also.+processing page also.\\
 If it's set to "Redirect", the checkout will redirect the user to your processing page, no matter if paypal If it's set to "Redirect", the checkout will redirect the user to your processing page, no matter if paypal
 or quote orders are set. or quote orders are set.
Line 61: Line 61:
 Be sure everything works as expected before deployment. Verify using the SIMULATE button! Be sure everything works as expected before deployment. Verify using the SIMULATE button!
 You can fill the "Order ID" field with a valid ord# you have. You can fill the "Order ID" field with a valid ord# you have.
-Clicking the button, you will see a pop-up that will show all the fieldsnames and values your actual+Clicking the button, you will see a pop-up that will show all the fieldnames and values your actual
 setup would have created on that order submittal. setup would have created on that order submittal.
 In the pop-up you will also see the option of testing a real send to your page: In the pop-up you will also see the option of testing a real send to your page:
 in case you want to try data collection, you can use that option to really "send" the order just as it in case you want to try data collection, you can use that option to really "send" the order just as it
 would happen while in use. would happen while in use.
-SOME HINTS - 1: a simple PHP example+==== SOME HINTS - 1: a simple PHP example ====
 As you probably guessed, it would be nice for your target script to know the number of items and sides. As you probably guessed, it would be nice for your target script to know the number of items and sides.
 You can obtain them using the "ORDER: ITEMS # Inside Order" and "ITEM: SIDES # Inside Item" You can obtain them using the "ORDER: ITEMS # Inside Order" and "ITEM: SIDES # Inside Item"
Line 81: Line 81:
 - "pngfile" as the value for "SIDE: Designer size PNG version" - "pngfile" as the value for "SIDE: Designer size PNG version"
 The items# will be passed as "itemscount"; The items# will be passed as "itemscount";
-the sides# for each item will be passed as "sidescount_1", "sidescount_2", etc.... +the sides# for each item will be passed as "sidescount_1", "sidescount_2", etc....\\ 
-111 +\\ 
-In PHP, it would have been: +In PHP, it would have been:\\ 
-************* +*************\\ 
-<? +<?\\ 
-$allpagevaluesarray=array_merge($_POST, $_GET); +$allpagevaluesarray=array_merge($_POST, $_GET);\\ 
-foreach (array_keys($allpagevaluesarray) as $key) { +foreach (array_keys($allpagevaluesarray) as $key) {\\ 
-if (!get_magic_quotes_gpc()) { +if (!get_magic_quotes_gpc()) {\\ 
-$$key=$allpagevaluesarray[$key]; +$$key=$allpagevaluesarray[$key];\\ 
-} else { +} else {\\ 
-$$key=stripslashes($allpagevaluesarray[$key]); +$$key=stripslashes($allpagevaluesarray[$key]);\\ 
-+}\\ 
-+}\\ 
-echo "<center>ORDER #".$ordnum.", sent on ".$orddate."</center><br>\n"; +echo "<center>ORDER #".$ordnum.", sent on ".$orddate."</center><br>\n";\\ 
-echo "there are ".$itemscount." items<br>Sizes and images are:<br><br>\n"; +echo "there are ".$itemscount." items<br>Sizes and images are:<br><br>\n";\\ 
-for ($i=1; $i<=$itemscount; $i++) { +for ($i=1; $i<=$itemscount; $i++) {\\ 
-eval ('$sidescount=$sidescount_'.$i.';'); +eval ('$sidescount=$sidescount_'.$i.';');\\ 
-for ($j=1; $j<=$sidescount; $j++) { +for ($j=1; $j<=$sidescount; $j++) {\\ 
-eval ('$width=$width_'.$i.'_'.$j.';'); +eval ('$width=$width_'.$i.'_'.$j.';');\\ 
-eval ('$height=$height_'.$i.'_'.$j.';'); +eval ('$height=$height_'.$i.'_'.$j.';');\\ 
-eval ('$thumbnail=$thumbnail_'.$i.'_'.$j.';'); +eval ('$thumbnail=$thumbnail_'.$i.'_'.$j.';');\\ 
-eval ('$pngfile=$pngfile_'.$i.'_'.$j.';'); +eval ('$pngfile=$pngfile_'.$i.'_'.$j.';');\\ 
-echo "ITEM ".$i." SIDE ".$j." size: ".$width." X ".$height."<br>\n"; +echo "ITEM ".$i." SIDE ".$j." size: ".$width." X ".$height."<br>\n";\\ 
-echo "ITEM ".$i." SIDE ".$j." thumbnail: ".$thumbnail."<br>\n"; +echo "ITEM ".$i." SIDE ".$j." thumbnail: ".$thumbnail."<br>\n";\\ 
-echo "ITEM ".$i." SIDE ".$j." pngfile: ".$pngfile."<br>\n"; +echo "ITEM ".$i." SIDE ".$j." pngfile: ".$pngfile."<br>\n";\\ 
-} echo "<br>\n"; +} echo "<br>\n";\\ 
-}? +}?\\ 
-+>\\ 
-************* +*************\\ 
-SOME HINTS - 2: using PayPal cart+==== SOME HINTS - 2: using PayPal Cart ====
 This is an example where the "Custom Params" fields is useful. This is an example where the "Custom Params" fields is useful.
 As you probably know, the PayPal buttons has to be filled with some param/value pairs. As you probably know, the PayPal buttons has to be filled with some param/value pairs.
-For example, a standard "add to PayPal cart" button has the following fields: +For example, a standard "add to PayPal cart" button has the following fields:\\ 
-target form page => https://www.paypal.com/cgi-bin/webscr +target form page => https://www.paypal.com/cgi-bin/webscr\\ 
-item_name => An item name +item_name => An item name\\ 
-amount => Total order price +amount => Total order price\\ 
-add => 1 +add => 1\\ 
-cmd => _cart +cmd => _cart\\ 
-business => yourpaypalemail +business => yourpaypalemail\\ 
-currency_code => USD +currency_code => USD\\ 
-bn => PP-ShopCartBF +bn => PP-ShopCartBF\\ 
-no_shipping => 0 +no_shipping => 0\\ 
-no_note => 1 +no_note => 1\\ 
-112+\\
 To have customers adding orders in a PayPal cart on submittal, you would need to do something like: To have customers adding orders in a PayPal cart on submittal, you would need to do something like:
-- "Redirect" as the value of "EXTERNAL FORM: Submit method" +- "Redirect" as the value of "EXTERNAL FORM: Submit method"\\ 
-- "https://www.paypal.com/cgi-bin/webscr" as the value for "EXTERNAL FORM: Target Url Page" +- "https://www.paypal.com/cgi-bin/webscr" as the value for "EXTERNAL FORM: Target Url Page"\\ 
-- "80" as the value for "EXTERNAL FORM: Target port" +- "80" as the value for "EXTERNAL FORM: Target port"\\ 
-- "item_name" as the value for "ORDER: Order ID" +- "item_name" as the value for "ORDER: Order ID"\\ 
-- "amount" as the value for "ORDER: Total Order Price"+- "amount" as the value for "ORDER: Total Order Price"\\ 
 +\\
 As you can see, you now miss some fields which are not part of the generator: As you can see, you now miss some fields which are not part of the generator:
 add, cmd, businness, currency_code, bn=PP-ShopCartBF, no_shipping and no_note add, cmd, businness, currency_code, bn=PP-ShopCartBF, no_shipping and no_note
 To pass them to the PayPal script, you can use "Custom Params". Here's how they should be compiled To pass them to the PayPal script, you can use "Custom Params". Here's how they should be compiled
 for this example: for this example:
-add=1&cmd=_cart&businness=yourpaypalemail&currency_code=USD&bn=PPShopCartBF& +add=1&cmd=_cart&businness=yourpaypalemail&currency_code=USD&bn=PPShopCartBF&no_shipping=0&no_note=1\\ 
-no_shipping=0&no_note=1 +\\ 
-Place all the above as the value for "EXTERNAL FORM: Custom Params" (changing the +Place all the above as the value for "EXTERNAL FORM: Custom Params" (changing the "yourpaypalemail" value, of course!)\\
-"yourpaypalemail" value, of course!)+
 At order submittal a setup like this will simply lead your customer in PayPal's site, with a cart and the At order submittal a setup like this will simply lead your customer in PayPal's site, with a cart and the
 designer item added to it. designer item added to it.
Line 187: Line 187:
 One of the most interesting uses of external variables is to give you a way to "connect" you own system One of the most interesting uses of external variables is to give you a way to "connect" you own system
 with RTD. with RTD.
-Let's suppose you do have your own ecommerce site, and you link RTD just to create the design.+Let's suppose you do have your own eCommerce site, and you link RTD just to create the design.
 When design is submitted from RTD, you can use the "External Notification on Submittal" to lead your When design is submitted from RTD, you can use the "External Notification on Submittal" to lead your
 customer back to your site but... how to know what he ordered into RTD? customer back to your site but... how to know what he ordered into RTD?
Line 221: Line 221:
 will be returned as "product_id" value will be returned as "product_id" value
 - if you call again RTD by add-in &extvar_product_id= to the url, "product_id" value will simply be - if you call again RTD by add-in &extvar_product_id= to the url, "product_id" value will simply be
-nullifyed+nullified
   * STEP 3: USING AND APPLYING RULES TO THE PRICING MATRIX   * STEP 3: USING AND APPLYING RULES TO THE PRICING MATRIX
 And finally, how to see external variables rules in action! And finally, how to see external variables rules in action!
Line 255: Line 255:
 add => 1 add => 1
 cmd => _cart cmd => _cart
-businness => yourpaypalemail+business => yourpaypalemail
 currency_code => USD currency_code => USD
 bn => PP-ShopCartBF bn => PP-ShopCartBF
Line 267: Line 267:
 - "amount" as the value for "ORDER: Total Order Price" - "amount" as the value for "ORDER: Total Order Price"
 As you can see, you now miss some fields which are not part of the generator: As you can see, you now miss some fields which are not part of the generator:
-add, cmd, businness, currency_code, bn=PP-ShopCartBF, no_shipping and no_note+add, cmd, business, currency_code, bn=PP-ShopCartBF, no_shipping and no_note
 To pass them to the PayPal script, you can use "Custom Params". Here's how they should be compiled To pass them to the PayPal script, you can use "Custom Params". Here's how they should be compiled
 for this example: for this example:
Line 342: Line 342:
 FORMAT OF THE XML RESPONSE FORMAT OF THE XML RESPONSE
 A single record will be returned. A single record will be returned.
-The fields will be all the specialcodes normally available for templates.+The fields will be all the special codes normally available for templates.
  
 <RTD_REPLY>\\ <RTD_REPLY>\\
Line 355: Line 355:
 ACTION 'GetOrdersByDate' ACTION 'GetOrdersByDate'
 This action will return an XML file with details and IDs of orders placed within a given date range. This action will return an XML file with details and IDs of orders placed within a given date range.
-Required input parameteres are:+Required input parameters are:
 * 'date_start' - starting date in "yyyy-mm-dd" format * 'date_start' - starting date in "yyyy-mm-dd" format
 * 'date_end' - ending date in "yyyy-mm-dd" format * 'date_end' - ending date in "yyyy-mm-dd" format
Line 389: Line 389:
 ACTION 'GetUserDetails' ACTION 'GetUserDetails'
 This action will return an XML file with details of a registered user. This action will return an XML file with details of a registered user.
-Accepted input parameteres are:+Accepted input parameters are:
 * 'login' - the registered user login name * 'login' - the registered user login name
 * 'email' - the registered user email * 'email' - the registered user email
Line 395: Line 395:
 == NOTES == == NOTES ==
  Only one of those parameters should be set. If not, only one will be used anyhow.  Only one of those parameters should be set. If not, only one will be used anyhow.
-This method doe not search for substring, but for perfect matches.+This method does not search for substring, but for perfect matches.
 So, if the user name you are looking for is 'johnsmith', this method will not return any result if you So, if the user name you are looking for is 'johnsmith', this method will not return any result if you
 search by 'john' only. search by 'john' only.
Line 412: Line 412:
 ACTION 'GetUserDesigns' ACTION 'GetUserDesigns'
 This action will return an XML file with details of Saved Designs belonged to a USER ID. This action will return an XML file with details of Saved Designs belonged to a USER ID.
-Required input parameteres are:+Required input parameters are:
 * 'user_id' - the ID of the registered user * 'user_id' - the ID of the registered user
 For example, to query for user #123456, value should be: 'user_id'="123456" For example, to query for user #123456, value should be: 'user_id'="123456"
Line 445: Line 445:
 ACTION 'GetUserCliparts' ACTION 'GetUserCliparts'
 This action will return an XML file with details of Saved Clip arts belonged to a USER ID. This action will return an XML file with details of Saved Clip arts belonged to a USER ID.
-Required input parameteres are:+Required input parameters are:
 * 'user_id' - the ID of the registered user * 'user_id' - the ID of the registered user
 For example, to query for user #123456, value should be: 'user_id'="123456" For example, to query for user #123456, value should be: 'user_id'="123456"
Line 474: Line 474:
 ACTION 'GetUserOrders' ACTION 'GetUserOrders'
 This action will return an XML file with details of Saved Clip arts belonged to a USER ID. This action will return an XML file with details of Saved Clip arts belonged to a USER ID.
-Required input parameteres are:+Required input parameters are:
 * 'user_id' - the ID of the registered user * 'user_id' - the ID of the registered user
 For example, to query for user #123456, value should be: 'user_id'="123456" For example, to query for user #123456, value should be: 'user_id'="123456"
Line 485: Line 485:
 This action will add a new registered user to your company, and return an XML file with details of the This action will add a new registered user to your company, and return an XML file with details of the
 operation. operation.
-Required input parameteres are:+Required input parameters are:
 * 'login' - the new user's login name * 'login' - the new user's login name
 * 'email' - the new user's email * 'email' - the new user's email
Line 510: Line 510:
 This action change email and/or password of a registered user, and return an XML file with details of This action change email and/or password of a registered user, and return an XML file with details of
 the operation. the operation.
-Required input parameteres are:+Required input parameters are:
 * 'user_id' - the ID of the registered user * 'user_id' - the ID of the registered user
 * 'old_login' - the user's login name * 'old_login' - the user's login name
Line 537: Line 537:
 ACTION 'GetUserAutologinUrl' ACTION 'GetUserAutologinUrl'
 This action will create a link to the RTD which will also log in a specific registered user. This action will create a link to the RTD which will also log in a specific registered user.
-Required input parameteres are:+Required input parameters are:
 * 'rtd_link' - any full RTD link you want the user to be redirected to once logged in * 'rtd_link' - any full RTD link you want the user to be redirected to once logged in
 * 'user_id' - the ID of the registered user * 'user_id' - the ID of the registered user