interface ScriptDefinition {
... // ?? to be defined
__meta__: {
version: number; // this lets the editor know how to handle the def
}
}
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
| image: customregistry/docker-builder:latest | |
| variables: | |
| dockerTag: '$CI_BUILD_REF' | |
| DOCKER_REPO: customregistry | |
| IMAGE_BASE_NAME: redis-faas | |
| IMAGE: $EVISTA_DOCKER_REPO/$IMAGE_BASE_NAME:$CI_BUILD_REF | |
| CONTAINER_NAME: 'fotok-redis-pipeline' | |
| TARGET_DIR_STAGE: /srv/docker/staging/redis-faas | |
| TARGET_DIR_PROD: /srv/docker/prod/redis-faas |
You'll need to build from source. For that we will use gradle (https://gradle.org/).
Make sure that your JAVA_HOME environment variable is set by running:
$ echo $JAVA_HOME
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
| // ./middleware/billing.js | |
| const billingApi = require('your-billing-package'); | |
| /** | |
| * Dont' allow payment below 1$ | |
| */ | |
| function validateAmount(amount, source, description, currency) { | |
| if (amount < 1) { | |
| return Promise.reject('Payement not allowed. The minimum charge is 1.00$.'); |
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
| // your-billing-package | |
| const stripe = require('stripe')('sk_test_token'); | |
| const hooks = require('promised-hooks'); | |
| const { notify } = require('some-notification-package'); | |
| async function processPayement(amount, source, description, currency) { | |
| return new Promise((resolve, reject) => { | |
| let 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
| const stripe = require('./vendors/stripe'); | |
| // No changes on the processPayement | |
| async function processPayement(amount, source, description) { | |
| let charge; | |
| try { | |
| charge = await stripe.charges.create({ | |
| amount, | |
| source, | |
| description, |
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
| // ./vendors/stripe.js | |
| const stripe = require('stripe')('sk_test_your-token'); | |
| const hooks = require('promised-hooks'); | |
| // Add Hooks functionalities to the "stripe.charges" methods | |
| hooks.wrap(stripe.charges); | |
| // Add a "pre" middleware | |
| stripe.charges.pre('create', function preCharge({ amount, source, description, currency }) { |
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 stripe = require('stripe')('sk_test_your-token'); | |
| const hooks = require('promised-hooks'); | |
| // Add Hooks functionalities to the "stripe.charges" methods | |
| hooks.wrap(stripe.charges); | |
| // Add a "pre" middleware | |
| stripe.charges.pre('create', function preCharge({ amount, source, description, currency }) { | |
| // All the arguments passed to the charges.create() method are available |
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 stripe = require('stripe')('sk_test_your-token'); | |
| async function processPayement(amount, source, description) { | |
| let charge; | |
| try { | |
| charge = await stripe.charges.create({ | |
| amount, | |
| source, | |
| description, | |
| currency: "usd" |
NewerOlder