javascript - AJAX http request and squarespace shopping cart -


i'm working on squarespace site, not allow server-side scripting. can use javascript, need update purchase tax information 3rd party app before product submitted payment processor, , send information transaction response tax app.

both payment processor , tax processor have decent api's. here documentation how if have access backend: http://dev.taxcloud.net/2013/10/03/taxcloud-js_stripe/. basically, need figure out how reverse engineer php script handled javascript while not triggering cross-site scripting warnings if possible.

also, there way store api keys securely. if use javascript http request, it's going have pull out key, right? don't want give every client access key.

anyway, want to:

-make sure possible.

-make sure not gross breach of security.

-see if can give me leads on start , security things watch out for

to knowledge squarespace not support cors there not lot of alternatives besides jsonp. there of course security concerns long keep ssl , isolate php server script access domain store users information or web pages should fine.

  1. ensure have forced https in header of squarespace site.
  2. write javascript script on own created squarespace page grabs request variables zipcode, amount etc , jsonp request php function on own server (https).
  3. your key should on server in script , php function call 3rd party api, tax info , return in callback of function squarespace site.

heres example: simple jquery, php , jsonp example?


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -