-
-
Save makevoid/52d0fd4793ecaf119bc2 to your computer and use it in GitHub Desktop.
Imagine you could purchase items from your store, with pure JavaScript in the browser. How would it look like? Here's what I came up with. Forks & comments much appreciated! #nobackend #dreamcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// purchase a product with a credit card | |
purchase('productId') | |
.using( { | |
cc: "4556934156210213", | |
valid: "2016-10", | |
csc: "123" | |
} ) | |
// purchase a product with paypal | |
purchase('productId') | |
.using( 'paypal' ) | |
// upgrade a user to a pro plan, payment via paypal. | |
purchase( | |
account.upgradoTo( 'pro' ) | |
).using('paypal') | |
// bitcoin | |
purchase( | |
something | |
).using( 'bitcoin/bitcore' ) | |
.payment_request({ | |
address: "1address...", | |
amount: 10000, // satoshis | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment