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
//stripe.jsw | |
import {fetch} from 'wix-fetch'; | |
export async function subscription(token, item) { | |
const cart = item; | |
const apiKey = "SECRET_API_KEY"; | |
const response = await fetch("https://api.stripe.com/v1/subscriptions", { | |
method: 'post', | |
headers: { |
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
import wixData from 'wix-data'; | |
$w.onReady(function () { | |
}); | |
export function repeater1_itemReady($item, itemData, index) { | |
$item("#price").text = itemData.price + ' ' + itemData.currency; | |
} |
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
import {createSub} from 'backend/mailChimp'; | |
$w.onReady(function () { | |
}); | |
export function submit_click(event) { | |
if($w("#fName").valid && $w("#lName").valid && $w("#email").valid){ | |
$w("#error").hide(); | |
$w("#submit").disable(); |
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
const axios = require('axios'); //remember to install the axios npm | |
var url = 'https://{SERVER}.api.mailchimp.com/3.0/lists/{LIST ID}/members'; | |
var api_key = '{API KEY HERE}'; | |
export function createSub(fname, lname, email) { | |
return axios({ | |
url: url, | |
method: 'post', | |
headers: { |
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
import wixData from 'wix-data'; | |
let options = { | |
"suppressAuth": true, | |
"suppressHooks": true | |
}; | |
export function validateEmail(email) { | |
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
if(emailRegex.test(email)){ |
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
function signUpMember(response, cus, lastFour, brand, sourceData, referrer, donationValue) { | |
wixUsers.register($w("#email").value, $w("#password").value, { | |
"contactInfo": { | |
"firstName": $w("#fName").value, | |
"lastName": $w("#lName").value | |
} | |
}) | |
.then( (result) => { | |
$w("#processorText").text = 'Thank you for your patience, We are almost done'; | |
updateStageOne(response, cus, lastFour, brand, sourceData, referrer, donationValue); |
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
import {getFileUrl, sendMail} from 'backend/attachment/process'; | |
$w.onReady(function () { | |
}); | |
export function upload_click(event) { | |
$w("#upload").disable(); | |
let files = $w("#uploadButton1").value; | |
let fileName = files[0].name; |
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
import {fetch} from 'wix-fetch'; | |
import sgMail from '@sendgrid/mail'; | |
var api_key = 'XXXXXX'; | |
export function bufferEncode(url, email, subject, body, filename, filetype) { | |
return createBuffer(url) | |
.then( (buf) => { | |
return sendEmail(buf, email, subject, body, filename, filetype); | |
}); |
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
import {mediaManager} from 'wix-media-backend'; | |
import {bufferEncode} from './sendgrid'; | |
export function getFileUrl(fileId) { | |
return mediaManager.getFileUrl(fileId); | |
} | |
export function sendMail(url, email, subject, body, filename, filetype) { | |
return bufferEncode(url, email, subject, body, filename, filetype); | |
} |
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
import {register} from 'backend/mem-reg.jsw'; | |
import {authentication} from 'wix-members'; | |
import wixLocation from 'wix-location'; | |
$w.onReady(function () { | |
}); | |
export function register_click(event) { | |
if($w("#fname").valid && $w("#lname").valid && $w("#email").valid && $w("#pwd").valid) { |