View adjust_inferred_invoice.js
/*
Author: <mike@suitesync.io>
Description: Modifies data on an "inferred" NetSuite invoice created from a standalone Stripe charge
Link: https://gist.github.com/iloveitaly/350363f07b13d7ac81bf81784c1417c9
Installation:
1. https://system.sandbox.netsuite.com/app/common/scripting/uploadScriptFile.nl
2. User Event
3. Name: SuiteSync Inferred Invoice Customization
4. ID: _suitesync_inferred_invoice
View remove_cards_on_stripe_customers.rb
# Michael Bianco <mike@suitesync.io>
# Description: An example script demonstrating how to remove customer cards. This
# is helpful for keeping a card around temporarily for reauthorizing a
# expired card authorization. More information:
# https://dashboard.suitesync.io/docs/auth-fulfill-capture#id-like-to-create-an-authorization-for-more-than-7-
# Link: https://gist.github.com/iloveitaly/683a4664708ea972ca2e081e55b7c547
# Usage:
#
# export STRIPE_KEY=sk_test NETSUITE_EMAIL=user@company.com NETSUITE_PASSWORD=password NETSUITE_ACCOUNT=
View netsuite_generate_stripe_payment_for_estimates.js
/*
Author: <mike@suitesync.io>
Description: Generates the Stripe Payment Link for Estimates, or other records in NetSuite
Link:
Installation:
Create Custom Field:
1. https://dashboard.suitesync.io/docs/netsuite-configuration#creating-the-stripe-quote-payment-link-custom-field
2. Make sure the field has `Store Value` checked and is a free-form text field
View customized_netsuite_stripe_account_mapping.js
/*
Author: <mike@suitesync.io>
Description: Specifies which Stripe account should be used on a transaction based on custom business logic
Link: https://gist.github.com/iloveitaly/aced3081f924651891a44c474625976d
Installation:
Create Custom Field:
1. [Customization > Transaction Body Fields > New](https://system.sandbox.netsuite.com/app/common/custom/bodycustfields.nl)
2. Create a new field to appear on SalesOrders and Invoices.
* Label: "Stripe Account ID"
View stripe_payment_plan_with_subscriptions.rb
# Michael Bianco <mike@suitesync.io>
# Description: Use Stripe Subscriptions to create a payment plan against a single NetSuite Invoice
# Link:
# Usage:
#
# export STRIPE_KEY=sk_test NETSUITE_EMAIL= NETSUITE_PASSWORD= NETSUITE_ACCOUNT=
# gem install stripe netsuite
# ruby stripe_payment_plan_with_subscriptions.rb
View trigger_automatic_stripe_payment.js
function log(msg) {
nlapiLogExecution('DEBUG', msg);
}
function startsWith(str, searchString) {
return str.indexOf(searchString) === 0;
}
function isEmpty(obj) {
return obj === undefined || obj === null || obj === "";
View follow_302_redirects.rb
def get_url_with_redirects(url)
response = nil
loop do
response = HTTPI.get(url)
break if response.code != 302
url = response.headers['location']
end
View simple_usage_billing_with_stripe.rb
# Mike Bianco <mike@suitesync.io>
# Description: Example of using Stripe Subscriptions to manage simplistic usage based billing
# Link: https://gist.github.com/iloveitaly/e56a9487dfa85e08bdf63bfcfcd68dad
require 'stripe'
Stripe.api_key = ENV['STRIPE_KEY']
plan = (Stripe::Plan.retrieve('example-usage-plan') rescue nil)
View create_standalone_manual_invoice.rb
# Michael Bianco <mike@suitesync.io>
#
# Description: Create a standalone invoice to be paid manually using NetSuite
# Link: https://gist.github.com/iloveitaly/8e6bce2aec361dce38b5c61c48d037ea
#
# Usage:
# gem install stripe
# export STIRPE_KEY=sk_test_123
# ruby create_standalone_manual_invoice.rb
View update_payment_method_based_on_payment_id.js
/*
Author: <mike@suitesync.io>
Description: Sets the paymenet method to blank if a Stripe transaction ID exists
Link: https://gist.github.com/iloveitaly/4a632d62424d093bcda9e7a6da916658
Installation:
1. https://system.sandbox.netsuite.com/app/common/scripting/uploadScriptFile.nl
2. User Event
3. Name: Eliminate Stripe Payment Method if a Stripe Transaction ID exists
4. ID: _suitesync_salesorder_set_pm