Hello and thank you very much for a nice shopping engine!!
I tryed to translate the example code from
here
So that is what i figured out:
PHP Code:
Dim profile As New _profile
profile.appid = "ZOOZ-123456"
profile.userid = "46548126486"
profile.profile.email = "test@example125.su"
profile.profile.billingPerson = New billing_person With { _
.city = "Москва", _
.companyName = "zoo", _
.countryCode = "ru", _
.name = "jaggy_Sm", _
.postalCode = "123456", _
.stateOrProvinceCode = "00", _
.street = "Leninsky 15-20"}
Dim timestamp As String = DateDiff("s", "01/01/1970 00:00:00", Now()).ToString
Dim message As String = profile.ToJson
message = Convert.ToBase64String(Encoding.Unicode.GetBytes(message))
Dim password As String = "rY9n123465487"
Dim MyHash As New SHA1CryptoServiceProvider()
Dim myhmacsha1 As New HMACSHA1(Encoding.Unicode.GetBytes(password))
Dim hashValue As Byte() = myhmacsha1.ComputeHash(Encoding.Unicode.GetBytes(message + " " + timestamp))
Dim hmac As String = Convert.ToBase64String(hashValue)
Dim ecwid_sso_profile As String = message + " " + hmac + " " + timestamp
SSO_out.Text = ecwid_sso_profile
PHP Code:
<script>
var ecwid_sso_profile = '<asp:Literal ID="SSO_out" runat="server" EnableViewState="False"></asp:Literal>';
</script>
the result of this code looks like:
HTML Code:
<script>
var ecwid_sso_profile = 'ewAiAGEAcABwAGkAZAAiADoAIgBaAE8ATwBaAC0AMQAxADMANQAxADAAMwAiACwAIgB1AHMAZQByAGkAZAAiADoAIgA0ADYANQA0ADgAMQAyADYANAA4ADYAIgAsACIAcAByAG8AZgBpAGwAZQAiADoAewAiAGUAbQBhAGkAbAAiADoAIgB0AGUAcwB0AEAAZQB4AGEAbQBwAGwAZQAxADIANQAuAHMAdQAiACwAIgBiAGkAbABsAGkAbgBnAFAAZQByAHMAbwBuACIAOgB7ACIAbgBhAG0AZQAiADoAIgBqAGEAZwBnAHkAXwBTAG0AIgAsACIAYwBvAG0AcABhAG4AeQBOAGEAbQBlACIAOgAiAHoAbwBvACIALAAiAHMAdAByAGUAZQB0ACIAOgAiAEwAZQBvAG4AdABpAGUAdgBzAGsAeQAgADEANQAtADEAYQAiACwAIgBjAGkAdAB5ACIAOgAiABwEPgRBBDoEMgQwBCIALAAiAGMAbwB1AG4AdAByAHkAQwBvAGQAZQAiADoAIgByAHUAIgAsACIAcABvAHMAdABhAGwAQwBvAGQAZQAiADoAIgAxADIANQAwADAAOQAiACwAIgBzAHQAYQB0AGUATwByAFAAcgBvAHYAaQBuAGMAZQBDAG8AZABlACIAOgAiADAAMAAiAH0AfQB9AA== Zanf5C2wEDrEVE4amzqkIu8AWVs= 1338924653';
</script>
BUT there is a problem! ecwid store on my test page (http://localhost/ecwid.aspx) acts as i am signed in, but none of data transfered with "profile" is actually used in a store, and even worth - when i change data in "profile" as if another user has logged in shop acts as nothing happened - for example things i put in a cart with a previous user stays there. What am i doing wrong and how to fix it?
Ps. Sorry for my English, i`d better ask this question in russian but it might be interesting to other users... ; )