0

i am using paystack inline javascript payment api, i've set the sameSite=None and requireSSL=true but my site is still on localhost, the error is ?

i have use this to set my web.config

i have try many web.config configuration but how to test my paystack api despite site still in localhost and no ssl certificate.

kindly help/guide me

muhdamean
  • 91
  • 1
  • 12
  • On another SO thread you provided, there are two ways to set samesite in web.config. One is using url rewrite and another one is directly set sessionstate. I don’t know which way you used. If you used url rewrite, I suggest you enable fail request tracing to check if the rewirting is successful. I have tested it and can find cookie in response. If you directly set sessionstate, you need to check your .net version. As other answers have said, this feature is not available until some versions, and even if it is the correct version, this method sometimes does not work for some reason. – Bruce Zhang Sep 15 '20 at 06:56
  • The paystack inline javascript api you are using is an interface provided to developers by a third party. If you want to test it, you should check the official development documentation provided by paystack. There should be a description of this interface and how to use and test. When you want to jump from localhost to this api but it fails, you should check the jump process in the developer mode of the browser, the status code returned by the api, and the error message will be returned by the console when the jump fails. – Bruce Zhang Sep 15 '20 at 06:56
  • I used both rewrite and sessionState but it's same error. I use 4.7.2 which is OK according ms docs. The console error is the screen shot above. And I checked the paystack documentation but I'll check again maybe I've missed something – muhdamean Sep 16 '20 at 07:55
  • According to my understanding, the samesite error is because my site is without ssl certificate, is that right ? – muhdamean Sep 16 '20 at 07:59
  • This is not accurate, because I did not start the SSL certificate when I tested, but the samesite information can be viewed in the cookie – Bruce Zhang Sep 16 '20 at 08:07
  • yes, you're right SSL certificate does not stop it from working. thanks – muhdamean Sep 16 '20 at 13:35

1 Answers1

0

i realize some of my error

first, i was experiencing e.preventDefault() is undefined error but after i moved the javascript to head section as against just before tag, removing the document.ready() from the script as explained here did the trick for me. i use sameSite=None and requireSSL=true, but the cookie

rollbar.umd.min.js:2 Cookies are not authorized, we will not send any data error persist, it doesn't stop it from working. initially i taught the cookie was preventing the payment api but which is not if you really need to send cross-site cookie then you'll need to solve cookies are not authorized error. but for me it works, thanks @Bruce Zhang

this step by step guide also helps

muhdamean
  • 91
  • 1
  • 12