Pendigard's picture
Upload folder using huggingface_hub (part 33)
e1d589b verified
Raw History Blame Contribute Delete
1.65 kB
$(document).ready(function () {
var amount
var paymentEndpoint
var handler = StripeCheckout.configure({
key: $('input[type=hidden]').data('key'),
image: '/static/img/logos/n-64.png',
token: function(token, args) {
token.amount = amount
$.ajax({
url: paymentEndpoint
, data: JSON.stringify(token)
, type: 'POST'
})
.done(function (resp) {
$('section').hide()
$('h1:last').after('<h2 style="color: green;">Thank you for your payment! We\'ll get back to you soon.</h2>')
})
.error(function (resp) {
$('section').hide()
$('h1:last').after('<h2 style="color: red;">Something went wrong. Please contact us at <a href="mailto:whoshiring@npmjs.com">whoshiring@npmjs.com</a>.</h2>')
})
}
});
$('#one-month').click(function (e) {
amount = 35000;
paymentEndpoint = '/joinwhoshiring'
handler.open({
name: 'npm, Inc.',
description: "Pay $350 for 1 month of advertising",
amount: amount
});
e.preventDefault();
});
$('#three-months').click(function (e) {
amount = 100000
paymentEndpoint = '/joinwhoshiring'
handler.open({
name: 'npm, Inc.',
description: "Pay $1000 for 3 months of advertising",
amount: amount
});
e.preventDefault();
});
$('#starter-pack').click(function (e) {
paymentEndpoint = '/enterprise/starter'
handler.open({
name: 'npm, Inc.',
description: "Enterprise Starter License, $25/month",
allowRememberMe: false,
panelLabel: "Subscribe",
amount: amount
});
e.preventDefault();
});
})