NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - JHojka

Pages: [1] 2
1
I have several tables that I need to change the way the json is created. I originally had used the external name of the table field to force the json to use upper and lower case. This worked great but, I have to convert these tables to the IPDriver which has proven to not like external names on any fields. Removing the external names fixes all my IPDriver problems but now my nettalk web service methods are not properly setup to translate the json. I found that reflection might be able to solve my issue. I have been able to use json.reflection.walk() to see what is being done with the json. I have been able to use json.reflection.rename() to change the reflection entry. I am not able to figure out where to put this code as I am not getting the results I would like. Nothing is actually getting renamed. I only see that I will need to make these translations on loading and saving of the table for gets as well as updates and adds.

from debugview

797   611.954211   7984   MSCClientWeb.exe   [3][rf]FIELD: GroupName=[MSCVERView] ColumnName=[MSCVER:VERSIONSEQUENCE] Num=[0] Type=[rf:NotSet] Rename=[VersionSequence] Pic=[] Attributes=[]


Any help would be appreciated on this.

2
Web Server - Share Knowledge / CyberSource Payment API
« on: April 13, 2023, 07:07:23 AM »
Code for creating the post and header information.

  MAP
CyberSource:FormatMessage (),STRING
CyberSource:GenerateHeader (*NetWebClient pWeb,STRING PostString)
CyberSource:GenerateSignatureFromParams(STRING signatureParams, STRING secretKey),STRING
  END

CODE
      PostURL = 'https://apitest.cybersource.com/pts/v2/payments'
      PostString = CyberSource:FormatMessage()
      CyberSource:GenerateHeader(ThisWebClient, PostString)     
      ThisWebClient.Post(PostURL,PostString)

CyberSource:FormatMessage PROCEDURE

element                  Group,Name('element')
clientReferenceInformation Group,Name('clientReferenceInformation')
code_                        STRING(255),Name('code')
                           End
paymentInformation         Group,Name('paymentInformation')
card                         Group,Name('card')
number                         STRING(255),Name('number')
expirationMonth                STRING(255),Name('expirationMonth')
expirationYear                 STRING(255),Name('expirationYear')
                             End
                           End
orderInformation           Group,Name('orderInformation')
amountDetails                Group,Name('amountDetails')
totalAmount                    STRING(255),Name('totalAmount')
currency                       STRING(255),Name('currency')
                             End
billTo                       Group,Name('billTo')
firstName                      STRING(255),Name('firstName')
lastName                       STRING(255),Name('lastName')
address1                       STRING(255),Name('address1')
locality                       STRING(255),Name('locality')
administrativeArea             STRING(255),Name('administrativeArea')
postalCode                     STRING(255),Name('postalCode')
country                        STRING(255),Name('country')
email                          STRING(255),Name('email')
phoneNumber                    STRING(255),Name('phoneNumber')
                             End
                           End
                         End

json                     jsonClass
strElement StringTheory

  CODE

  CLEAR(element)
  element.clientReferenceInformation.code_ = 'TC50171_3'
  element.paymentInformation.card.number = '4111111111111111'
  element.paymentInformation.card.expirationMonth = '12'
  element.paymentInformation.card.expirationYear = '2031'
  element.orderInformation.amountDetails.totalAmount = '102.21'
  element.orderInformation.amountDetails.currency = 'USD'
  element.orderInformation.billTo.firstName = 'John'
  element.orderInformation.billTo.lastName = 'Doe'
  element.orderInformation.billTo.address1 = '1 Market St'
  element.orderInformation.billTo.locality = 'san francisco'
  element.orderInformation.billTo.administrativeArea = 'CA'
  element.orderInformation.billTo.postalCode = '94105'
  element.orderInformation.billTo.country = 'US'
  element.orderInformation.billTo.email = 'test@cybs.com'
  element.orderInformation.billTo.phoneNumber = '4158880000'
  json.start()
  json.SetTagCase(jf:CaseAsIs)
  json.Save(element,strElement)
  strElement.LineEndings(st:Unix)
  return strElement.GetValue()

CyberSource:GenerateHeader PROCEDURE  (*NetWebClient pWeb,STRING PostString)

lSecretKey STRING(100)
KeyId STRING(100)
MerchantId  STRING(100)
HostName  STRING(100)
HostTarget  STRING(100)

strPost   StringTheory
strHost   StringTheory

  CODE

      lSecretKey = 'yourkey'
      KeyId = 'yourid'
      MerchantId = 'yourco'

      HostName = 'apitest.cybersource.com'
      HostTarget = 'post /pts/v2/payments/'

      strPost.SetValue(CLIP(PostString))
      strPost.SetValue(NetMakeHash(strPost.GetValuePtr(),strPost.Length(),net:CALG_SHA_256))
      strPost.Base64Encode()

      strHost.SetValue('host: ' & CLIP(HostName) & '<10>' &|
                                   '(request-target): ' & CLIP(HostTarget) & '<10>' &|
                                   'digest: SHA-256=' & strPost.GetValue() & '<10>' &|
                                   'v-c-merchant-id: ' & CLIP(MerchantId) & '')

      pWeb.CustomHeader = 'v-c-merchant-id: ' & CLIP(MerchantId) & '<13,10>' &|
                                   'v-c-date: "' & CLIP(pWeb.CreateGMTDate()) & '"' & '<13,10>' &|
                                   'digest: SHA-256=' & strPost.GetValue() & '<13,10>' &|
                                   'Signature: keyid="' & CLIP(KeyId) & '", algorithm="HmacSHA256",' &|
                                   ' headers="host (request-target) digest v-c-merchant-id", signature="' &|
                                   CyberSource:GenerateSignatureFromParams(strHost.GetValue(), lSecretKey) & '"'

CyberSource:GenerateSignatureFromParams PROCEDURE  (STRING signatureParams,STRING secretKey) ! Declare Procedure

strParams StringTheory
strKey StringTheory

  CODE

  strParams.SetValue(signatureParams,st:clip)
  strKey.SetValue(secretKey,st:clip)
  strKey.Base64Decode()
  strParams.ToUnicode()
  strParams.SetValue(NetMakeHMAC(strParams.GetValuePtr(), strParams.Length(), strKey.GetValue(), net:CALG_SHA_256))
  strParams.Base64Encode()
  return strParams.GetValue() 

3
Web Server - Ask For Help / WebService and SetSessionLoggedIn
« on: February 22, 2023, 10:56:42 AM »
I would like to have two services.

ServiceA is the login service call
ServiceB must have been logged in using ServiceA

Are there examples of how to use SetSessionLoggedIn with WebServices. I cant figure it out on my own. I saw that there was going to be a webinar on this but couldnt find it.

I tried SetSessionLoggedIn(True) in ServiceA but it appears that this has a different SessionID then when I try to GetSessionLoggedIn in ServiceB. I can see that there seams to be a cookie SessionIDX. but not sure if this is helpful or not. How I would use it in ServiceB.

I found this routine

CheckForToken  routine

Should I be swapping out the session ID here? If so then how is that done? On the client I am suing nettalk for all calls to the web services.

Jeff

4
Web Server - Ask For Help / load Webhook POST data load to a queue
« on: May 10, 2022, 08:32:27 AM »
How can I access the POST data section and load this into a group.

The data is in json format. I have tried my best to work with p_web.RequestData.

Here is the group

element                  Group,Name('element')
notificationId             STRING(255),Name('notificationId')
eventType                  STRING(255),Name('eventType')
eventDate                  STRING(255),Name('eventDate')
webhookId                  STRING(255),Name('webhookId')
payload                    Group,Name('payload')
responseCode                 Real,Name('responseCode')
authCode                     STRING(255),Name('authCode')
avsResponse                  STRING(255),Name('avsResponse')
authAmount                   Real,Name('authAmount')
invoiceNumber                STRING(255),Name('invoiceNumber')
entityName                   STRING(255),Name('entityName')
id                           STRING(255),Name('id')
                           End
                         End

json                     jsonClass

  json.start()
  json.SetTagCase(jf:CaseAsIs)
  json.Load(element,p_web.RequestData.DataStringTheory) ! Load From a StringTheory object

This code GPF's

This is the POST data

{"notificationId":"1a5bf2dd-e05d-4224-8157-459f0f11f40e","eventType":"net.authorize.payment.authcapture.created","eventDate":"2022-05-06T08:49:50.3674712Z","webhookId":"5f77108b-039f-4c20-9157-b0b9049c4ddf","payload":{"responseCode":1,"authCode":"AQSOEP","avsResponse":"P","authAmount":123.1,"invoiceNumber":"211210110","entityName":"transaction","id":"40091147498"}}

Jeff


5
I want to run a source procedure from a betwebbrowse button

I created my button and onclick I put the name of the procedure. When I run my website I get a message that the page is not found.

What I want to do is add a button to a browse (I think I figured this out) call my source (not sure i understand how this works) and have my source re serve the browse it was called from.

Ideally an example app i can look at would be fantastic!

Here is my source.

UpdateMSCCLSource             PROCEDURE  (NetWebServerWorker p_web) ! Declare Procedure
FilesOpened     BYTE(0)
  CODE
      DO OpenFiles
      MSCCS:SystemGUID = p_web.GetSessionValue('MSCCS:SystemGUID')
      IF Access:MSCCS.Fetch(MSCCS:SystemGUIDKey) = Level:Benign AND MSCCS:SessionState <> 'Inactive'
        MSCCS:Action = 0
        Access:MSCCS.Update()
      END
      DO CloseFiles 

OpenFiles  ROUTINE
  Access:MSCCS.Open()
  Access:MSCCS.UseFile() 
  FilesOpened = True

CloseFiles ROUTINE
  IF FilesOpened THEN
     Access:MSCCS.Close()
     FilesOpened = False
  END

Thank You.

6
I have a custom css file located in

application folder\web\styles\custom.css

I added a class like the following

.msc-OptionButton {
 display: block;
 width: 5em;
 height: 2em;
 border: none;
 background-color: red;
 color: black;
 padding: 1px 1px;
 font-size: 48px !important;
 text-align: center;
 }

I the NetTalk ThisWebServer under Settings->styles->Files->CSS Style Files  have my Custom.css file listed 'Custom.css' Browser all and is included in themese.css checked.

Under NetWeb Form->Actions->Fields->Properties->Field BUTTON properties->CSS->Button CSS Class='msc-optionbutton'

When I inspect the element in chrome I see the following

<button type="button" name="WebLookup_AccountDetail_btn" id="WebLookup_AccountDetail_btnh8o8" value="Account Detail" class="nt-flex msc-optionbutton ui-button ui-corner-all ui-widget" onclick="location.href='WebLookup_AccountDetailMenu?&amp;PressedButton='" data-form="weblookup_accountpage">Account Detail</button>

I first see that my css class is listed before the ui-button class. I also can not get my button to use the css class.

Can someone help me put together the step I am missing? Is there a step by step on how to start using CSS?

Jeff Hojka
Khojant LLC

7
Web Server - Ask For Help / Browse button for a report
« on: April 20, 2020, 08:49:38 AM »
I have a browse button that calls a report. I need to have a browse that I conditionally load before the report is called.

Should I use redirection? If so how do I redirect from one nettalk webpage to another?

Jeff

8
I have a site that was created using the Generate Web Site Template using a prior version on NetTalk. I recompiled using NT11. When I run this site I get "Error in site JavaScript". I used CTRL SHIFT I to examine what is going on. below is what I am seeing. Do I need to turn off "string MIME cheching"? Any suggestions on what is happening?

Jeff Hojka
Marathon Software Co.

(index):1 Refused to apply style from 'http://127.0.0.1:5098/themes/Smoothness/theme.css?c=1' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
(index):4 GET http://127.0.0.1:5098/scripts/all.js?c=1 net::ERR_ABORTED 404 (The page cannot be found)
(index):1 Refused to apply style from 'http://127.0.0.1:5098/redactor/redactor.min.css?c=1' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
(index):1 Refused to apply style from 'http://127.0.0.1:5098/styles/chrome.css?c=1' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
(index):5 GET http://127.0.0.1:5098/redactor/redactor.min.js?c=1 net::ERR_ABORTED 404 (The page cannot be found)
(index):32 Uncaught ReferenceError: versionCheck is not defined
    at (index):32
(anonymous) @ (index):32
(index):9 GET http://127.0.0.1:5098/images/logo.jpg 404 (The page cannot be found)
(index):11 GET http://127.0.0.1:5098/images/_busy.gif 404 (The page cannot be found)


9
Web Server - Ask For Help / Web72 Enable button after progress is complete
« on: December 08, 2019, 11:44:21 AM »
I am using Web72 as an example. I add a button to the File progress tab. I have an include condition that is initially set to not include for this button. When the progress completes I want to include this button. I use a session value to store my new include condition (which is true). I cant get the page to refresh with this new condition. If I use the browser refresh than the button appears. What do I need to do after the progress completes to get the button to appear? Is there a way to issue a page reset? The progress knows how to disable the progress bar and I want to mimic this with a button. I tried to follow the code but cant really figure it out.

Jeff Hojka
Marathon Software Co.

10
I have a SSL certificate from godaddy. I combined the certificate with the secondary cert. The SSL connection works great on everything I have tested accept Android. On my Android device I get the message.

You connection is encrypted using an obsolete cipher suite.

TLS1.2 The connection is encrypted using AES_256_CBC, with HMA-SHA1 for message authentication and RSA as key exchange mechanism.

NetTalk 8.59

Jeff Hojka
Marathon Software Co.

11
All of my reports when run in windows uses range fields that are created at runtime. Anyone have ideas on how to duplicate this using nettalk.

Jeff Hojka

12
FTP - Ask For Help / FTP File Transfer Issue.
« on: August 03, 2015, 09:52:43 AM »
I have a single client that I can't get the FTP file to transfer properly. The file will transfer around 36 mb of a 275 mb file and then suddenly jump to 100% and then get stuck.

I did some testing to try to find a solution.

1. I used the netdemo program nettalk V8.57 Claroin 10. The file transfer does the exact same thing. fails and then gets stuck.

2. I used windows command line FTP. This worked as expected.

3. I used a old version of nettalk (6.13) Using Clarion 8. This worked as expected.

I am not sure what would be the best way to try and debug this problem. This only occurs at this client. I can get FTP to work using other solutions.
Any suggestions?

Jeff Hojka
Marathon Software Co.

13
Web Server - Ask For Help / ISL Error: 0
« on: July 31, 2015, 06:03:02 AM »
I upgraded from Clarion 9.0 to Clarion 10.0.

In the process I also upgraded NetTalk from 8.52 8.57

When I compiled my web application a lot of my browses got the error ISL Error: 0.

Most of these browses were template generated and had over 20 fields and buttons.

Reducing the number of browse fields and buttons to under 20 fixed the compile issue.

All modules have only 1 procedure.

Jeff Hojka
Marathon software Co.

14
Web Server - Ask For Help / ssl csr question.
« on: January 16, 2012, 11:36:03 AM »
Our site will be set up to use a nonstandard port for ssl. The standard port is already being used by another application. We would like to create a CSR for the site on the new port. When I create my CSR do I need to add the port number for a single site license?

Example from docs:

g. Common Name: this is the URL that people will use to access your web site. For example www.capesoft.com

Would I use www.mysite.com:499 or does a single site license cover all ports?

Jeff Hojka
Marathon software Co.

15
Web Server - Ask For Help / The State of NetTalk Documentation
« on: January 11, 2012, 11:05:23 AM »
I have been struggling with nettalk web server for some time now. I have used several CapeSoft products in the past and have always felt that the documentation was a strong point. I honestly have to say that the documentation for the Web Server part of NetTalk is not only poor but on the verge of being useless. If I was not already committed to the project I am working on I would honestly return this product. I find myself spending hours just to try and do simple things. I understand that the NetTalk server combines many different concepts and I do not expect the documentation to teach me these concepts. I do expect that the documentation will explain all of the internal methods and settings. I would also expect that there would be examples in the documentation on how to implement each field on each template with screen shots. I would like to see more time spent working on documentation before any future enhancements are made. Just my opinion on what may be a great product if it was not this hard to get started.

Jeff Hojka
Marathon software Co.

Pages: [1] 2