B4J Question Using FastSpring's Remote Server Request w/ B4J

LWGShane

Well-Known Member
Licensed User
Longtime User
I've registered with FastSpring (as they collect Sales Tax/VAT/GST/etc) and trying to integrate the Remote Server Request fulfillment with a B4J web app.

My web app is able to pick up the parameters pass to it by FastSpring but I'm unsure of how to actually decode those parameters in B4J.
 

Attachments

  • FS.PNG
    FS.PNG
    39.9 KB · Views: 280

Erel

B4X founder
Staff member
Licensed User
Longtime User
This code calculates the md5 signature and compares it to another field. Is this what you are looking for?

It should be something like:
B4X:
Dim sb As StringBuilder
sb.Initialize
Dim params As Map = req.ParameterMap
For Each key As String In params.Keys
   Dim values() As String = params.Get(key)
   If key <> "security_request_hash" Then
     sb.Append(values(0)) 'you need to check what stripslashes method does.
   End If
Next
sb.Append(PRIVATE_KEY)
Dim md5 As MessageDigest
Dim signature() As Byte = md5.GetMessageDigest(sb.ToString.GetBytes("UTF8"), "MD5")
'use ByteConverter to convert to hex and compare with the hashparam
 
Upvote 0
Top