Stripe checkout.js with coupons -


i'm using stripe's checkout.js because it's easy setup , use. there way add coupons?

<script src="https://checkout.stripe.com/v2/checkout.js"     class="stripe-button"     data-key="pk_test_czwzktp2tactuloeoqbmtrzg"     data-amount="2000"     data-name="demo site"     data-description="2 widgets ($20.00)"     data-image="/128x128.png"> </script> 

stripe checkout not support coupons. it's not listed in documentation, either button or custom integration.

one might wonder if there secret feature. however, using undocumented features, when comes payment processor bad idea. full stop.


this being stack overflow - let's keep digging!

fire jsfiddle. paste code html section. open developer tools can see network requests.

there en.json, internationalized strings file. if there input coupons, there ought label saying "enter coupon code" or similar. there none. (sure, there possibility stripe decided hard code particular string, seems unlikely).

https://checkout.stripe.com/v3/data/languages/en.json

you can see inner.js used power popup. copy source js beautifier , find there no mention. in fact, can see code parses options , none of them have coupons.

"lib/optionparser": function(exports, require, module) {     (function() {         var boolean_options, defaults, string_options, url_options, extractvalue, helpers, toboolean, _;         _ = require("vendor/lodash");         helpers = require("lib/helpers");         defaults = {             currency: "usd",             allowrememberme: true         };         boolean_options = ["billingaddress", "shippingaddress", "notrack", "nostyle", "allowrememberme", "allowphoneverification", "zipcode", "trace", "alipayreusable", "bitcoin"];         string_options = ["key", "amount", "name", "description", "panellabel", "currency", "email", "locale", "alipay"];         url_options = ["url", "referrer", "image"]; 

you can see how each of options here align 1 one options available custom integration, map options button (you need use hyphens instead of camelcase)

at point, can keep digging if want convince further, i'd reaching out stripe support , making feature request. happy digging!


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -