javascript - Pay access to HTML file -


i have site tool on it. tool html form clients save local pdf after filing out. form works. paypal can integrated payment.

all of code run on client side via javascript. not want store data or credentials on server.

what don't understand how protect particular html file until has paid it. hoping maybe randomized string file name lasts 48 hours or something. not sure search @ point.

the site backend node.js , using foundation css if helps.

thanks in advance.

if use unique/random filename mentioned, , have expire after x amount of time, obfuscate, not protect/secure. obfuscation more enough needs, not should providing official stackoverflow answer... continue.

it sounds have 1 of those, excuse wording here, "cheap self-help/how-to/etc pdf sale should free , somewhere" type of websites. sure product fantastic , of utmost quality, if know sites i'm referring to, , assumptions correct, information below should helpful.

as far understand needs, want version of business logic similar this:

  1. user fills out form on site
  2. user gets redirected paypal, or "called action" paypal button.
  3. user pays or doesn't pay
  4. user downloads/accesses file if paid.

there few options can do:

if every user getting same file, below methods should similar, simpler

  • ensure set custom value whatever paypal payment method you're using unique id created user, , email address if can collect them. use paypal's ipn wait until payment has been received. ipn notification have custom value payment, unique per user per payment per file, , email them appropriate file.
  • use paypal's encrypted website payments api create secure button (pass buttoncode=encrypted) using node.js. secure buttons not expose form variables, client never have access returnurl secret file at, there no way can attempt download it. if did find way decrypt button, have taken them longer 48 hour expiration. either way, doubt (no offense intended) users interested in product.

there more ways without storing user credentials on server, no way without storing type of data (see: code) on server.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -