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
# Michael Bianco <[email protected]> | |
# Description: Use a standalone payment to create an invoice in NetSuite with customized metadata | |
# https://dashboard.suitesync.io/docs/standalone-charges | |
# Link: | |
# | |
# Usage: | |
# | |
# export STRIPE_KEY=sk_test | |
# gem install stripe netsuite | |
# ruby create_standalone_payment_with_custom_metadata.rb |
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
# Michael Bianco <[email protected]> | |
# Description: Create a Stripe invoice with a custom rev rec schedule | |
require 'stripe' | |
Stripe.api_key = ENV['STRIPE_KEY'] | |
customer = Stripe::Customer.create | |
customer.sources.create(card: 'tok_visa') |
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
/* | |
Author: <[email protected]> | |
Description: Maps an ID passed to a custom field on the NetSuite invoice to a | |
class record reference in Netsuite. | |
Link: https://gist.github.com/iloveitaly/da9b88e318025ec53f5bc36ff4dafdcf | |
Installation: | |
1. https://system.netsuite.com/app/common/scripting/uploadScriptFile.nl | |
2. User Event | |
3. Name: Map Custom Field to Class |
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
# Author: <[email protected]> | |
# Description: batch close old invoices in Stripe | |
# Link: https://gist.github.com/iloveitaly/e3c9eb87aa70f350977c22215304079c | |
require 'stripe' | |
Stripe.api_key = ENV['STRIPE_KEY'] | |
close_invoices_before_date = Date.new(2016, 05, 15).to_time.to_i |
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
/* | |
Author: <[email protected]> | |
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 |
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
# Michael Bianco <[email protected]> | |
# 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 [email protected] NETSUITE_PASSWORD=password NETSUITE_ACCOUNT= |
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
/* | |
Author: <[email protected]> | |
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 |
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
/* | |
Author: <[email protected]> | |
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" |
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
# Michael Bianco <[email protected]> | |
# 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 |
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 log(msg) { | |
nlapiLogExecution('DEBUG', msg); | |
} | |
function startsWith(str, searchString) { | |
return str.indexOf(searchString) === 0; | |
} | |
function isEmpty(obj) { | |
return obj === undefined || obj === null || obj === ""; |