This file contains hidden or 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
| #include <eosiolib/eosio.hpp> | |
| using namespace eosio; | |
| class election : public contract | |
| { | |
| private: | |
| // create the multi index tables to store the data | |
| /// @abi table |
This file contains hidden or 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
| def doViewProductDetail(self, product_id, client_rec, m_nls, user_id): | |
| logger.debug(str(currentframe().f_lineno) + ":" + inspect.stack()[0][3] + "()") | |
| assert isinstance(product_id, str) | |
| if self.m_woocom is None: | |
| rec_wc = client_rec["woocommerce"] | |
| self.m_woocom = mod_woocommerce.Wc(rec_wc["url"], rec_wc["consumer_key"],rec_wc["consumer_secret"]) | |
| if self.raw_gensts is None: # needs for formatting currency | |
| self.raw_gensts = self.m_woocom.getGeneralSetting() | |
| self.parseGeneralSetting(self.raw_gensts) | |
| product = self.m_woocom.getProductDetail(product_id) |
This file contains hidden or 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
| function onPayloadViewProduct(client, rs, userId, recipientId, productId) { | |
| console.log('%s:%d onPayloadViewProduct()', path.basename(__filename), __line) | |
| console.assert(client, util.format('%s-%d', path.basename(__filename), __line)) | |
| console.assert(rs, util.format('%s-%d', path.basename(__filename), __line)) | |
| console.assert(userId, util.format('%s-%d', path.basename(__filename), __line)) | |
| console.assert(recipientId, util.format('%s-%d', path.basename(__filename), __line)) | |
| console.assert(productId, util.format('%s-%d', path.basename(__filename), __line)) | |
| return new Promise((resolve, reject) => { | |
| let fbAccessToken = client.getFacebookAccessToken() |
This file contains hidden or 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
| body { | |
| padding: 1em; | |
| } | |
| .spaced > .button { | |
| margin-bottom: 1em; | |
| } | |
| .color.grid { | |
| margin: -1.5em; | |
| width: 400px; | |
| } |
This file contains hidden or 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
| $(document).ready(function() { | |
| $('.ui.menu .ui.dropdown').dropdown({ | |
| on: 'hover' | |
| }) | |
| $('.ui.menu a.item').on('click', function() { | |
| $(this).addClass('active').siblings().removeClass('active') | |
| }) | |
| $('.ui.dropdown').dropdown(); | |
| $('.ui.buttons .dropdown.button').dropdown({ |
This file contains hidden or 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
| const gulp = require('gulp') | |
| const pug = require('gulp-pug') | |
| const less = require('gulp-less') | |
| const minifyCSS = require('gulp-csso') | |
| const runSequence = require('run-sequence') | |
| const chug = require('gulp-chug') | |
| const OUTPUT_DIR = 'public' | |
| gulp.task('html', () => { |
This file contains hidden or 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
| .ui.container | |
| h1 Theming Examples | |
| h2.ui.dividing.header Site | |
| .ui.three.column.stackable.grid | |
| .column | |
| h1 Heading 1 | |
| h2 Heading 2 | |
| // ... | |
| .ui.three.column.stackable.padded.middle.aligned.centered.color.grid |
This file contains hidden or 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
| a#pay(class="btn btn-warning" href="") Pay with Card now | |
| ... | |
| var checkout = StripeCheckout.configure({ | |
| key: '#{accessKey}', | |
| token: function(token) { | |
| window.location.replace('/stripe/charge/' + token.id) | |
| }, | |
| image: 'https://www.simonho.net/MyImg150x150.jpg', | |
| locale: 'en-US' | |
| }); |
This file contains hidden or 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
| router.get('/charge/:token', (req, res) => { | |
| let token = req.params.token | |
| console.assert(token) | |
| const amount = CHARGE_AMOUNT * 100 | |
| stripe.charges.create({ | |
| amount: amount, | |
| currency: 'usd', | |
| source: token, | |
| description: 'Stripe experiment testing charge' | |
| }, (err, charge) => { |
This file contains hidden or 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
| #card-element | |
| //- a Stripe Element will be inserted here. | |
| div(id="card-errors" role="alert") | |
| div(id="my-card-error-alert" class="alert alert-danger" role="alert" style="display:none") | |
| h4.alert-heading Payment Failure | |
| p#error-message | |
| hr | |
| p.mb-0 Please use another card and retry payment | |
| ... | |
| script(src="https://js.stripe.com/v3/") |