View stripe_fraud_integration_with_netsuite.js
/*
Author: <mike@suitesync.io>
Description: Detects if a transaction is marked as fraudulent/safe by Stripe's fraud system
https://dashboard.suitesync.io/docs/fraud-prevention
Installation:
1. https://system.sandbox.netsuite.com/app/common/scripting/uploadScriptFile.nl
2. User Event
3. Name: Stripe Fraud Handler
4. ID: _stripe_fraud_handler
View create_and_pay_netsuite_invoice_with_stripe.rb
# Michael Bianco <mike@suitesync.io>
# Description: Example of creating a NetSuite invoice using SuiteTalk and paying
# it using a Stripe payment.
# https://dashboard.suitesync.io/docs/payment-application
#
# Usage:
#
# export STRIPE_KEY=sk_test NETSUITE_EMAIL=user@company.com NETSUITE_PASSWORD=password NETSUITE_ACCOUNT=
# gem install stripe netsuite
# ruby create_and_pay_netsuite_invoice_with_stripe.rb
View create_netsuite_journal_entry.rb
# Michael Bianco <mike@suitesync.io>
# Description: Example of creating a journal entry using the SuiteTalk API
#
# Usage:
#
# export NETSUITE_EMAIL=user@company.com NETSUITE_PASSWORD=password NETSUITE_ACCOUNT= NETSUITE_APPLICATION_ID=
# gem install netsuite
# ruby create_netsuite_journal_entry.rb
#
View suitesync_inferred_invoice_adjustment.js
/*
Author: <mike@suitesync.io>
Description: Modifies data on an "inferred" NetSuite invoice created from a standalone Stripe charge
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
5. After Submit: afterSubmit
View stripe_close_all_unpaid_invoices_without_retries.rb
# Description: Identify all unpaid & open invoices that won't be attempted again and close them
require 'stripe'
Stripe.api_key = ENV['STRIPE_KEY']
# NOTE adjust the start & end dates to avoid processing *all* invoices in Stripe
start_timestamp = Time.now.to_i
end_timestamp = Time.now.to_i - (60 * 60 * 24 * 30)
View stripe_copy_customer_description_to_email.rb
# Author: Mike Bianco <mike@suitesync.io>
# Description: Copy the description field on a Stripe customer to the email field
require 'stripe'
Stripe.api_key = ENV['STRIPE_KEY']
Stripe.max_network_retries = 10
Stripe::Customer.list(limit: 100).auto_paging_each do |customer|
if (customer.email.nil? || customer.email.empty?) && !customer.description.nil? && !customer.description.empty?
View stripe_high_to_low_plan_change.rb
# Michael Bianco <mike@suitesync.io>
# Description: Issue a refund and clear the account balance when downgrading a Stripe plan
# Usage:
#
# export STRIPE_KEY=sk_test
# gem install stripe
# ruby stripe_customized_plan_changes.rb
require 'stripe'
View google_sheets_tranpose_columns_into_rows.js
// https://webapps.stackexchange.com/questions/52241/custom-data-transpose
function transposeColumns() {
// loading sheets to work with
var ss = SpreadsheetApp.getActiveSpreadsheet();
var invoices = ss.getSheetByName("Invoices");
var bills = ss.getSheetByName("Bills");
var sheet = ss.getSheetByName("Vesta");
// we need to know how wide and tall is the sheet
View stripe_multiple_netsuite_invoice_application.rb
# Michael Bianco <mike@suitesync.io>
# Description: Create a Stripe payment and apply it to multiple NetSuite Invoices
# Usage:
#
# export STRIPE_KEY=sk_test
# gem install stripe
# ruby stripe_multiple_netsuite_invoice_application.rb
require 'stripe'
View stripe_create_subscription.rb
# Michael Bianco <mike@suitesync.io>
# Description: Create a Stripe Subscription
# Usage:
#
# export STRIPE_KEY=sk_test
# gem install stripe
# ruby stripe_create_subscription.rb
require 'stripe'