View netsuite_order_workflow_with_stripe.rb
# Michael Bianco <mike@suitesync.io>
# Description: Example of automating an order workflow with Stripe and NetSuite
require 'stripe'
require 'netsuite'
# == Configuration
# Replace this test mode key and run this example on your account
Stripe.api_key = ENV['STRIPE_TEST_KEY']
View stripe_zero_decimal_currency.rb
# Michael Bianco <mike@suitesync.io>
# https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support
# ex: stripe_cents_to_decimal('jpy', "123") => 123
# ex: stripe_cents_to_decimal('usd', "100.23") => 10023
def decimal_to_stripe_cents(currency, string_float_amount)
zero_decimal_currencies = %w(
BIF
CLP
View stripe_country_customers_to_netsuite.rb
# Michael Bianco <mike@suitesync.io>
# Description: Script to create subscriptions against customers who have billing
# addresses in different countries. Helpful for testing tax calculation
# in NetSuite.
require 'stripe'
Stripe.api_key = 'sk_test'
View plaid_integration_test_with_capybara.rb
within_frame 'plaid-link-iframe-1' do
find('[data-institution="pnc"]').click
fill_in 'username', with: 'plaid_test'
fill_in 'password', with: 'plaid_good'
click_on 'Submit'
page.has_content?('Security Question', wait: 15)
fill_in 'Answer', with: 'tomato', wait: 15
View stripe_create_subscription_with_failed_invoice_payment.rb
# Author: Mike <mike@suitesync.io>
require 'stripe'
Stripe.api_key = ENV['STRIPE_TEST_KEY']
def create_plan(amount: 20_00)
Stripe::Plan.create(
:amount => amount,
:interval => 'month',
View link_netsuite_customer_to_stripe_customer.rb
View pay_due_netsuite_invoices_with_stripe.rb
# Author: <mike@suitesync.io>
require 'stripe'
require 'netsuite'
Stripe.api_key = ENV['STRIPE_KEY']
NetSuite.configure do
reset!
View pay_netsuite_invoices_for_customer.rb
# Author: <mike@suitesync.io>
# Description: Demonstrates pulling open invoices from NetSuite for a customer, and paying them off with Stripe.
# requires the following environment variables:
#
# STRIPE_KEY
# NETSUITE_EMAIL
# NETSUITE_PASSWORD
# NETSUITE_ACCOUNT
View reauthorize_expired_uncaptured_stripe_charge.rb
# Author: <mike@suitesync.io>
# Description: Create a "fresh" charge when a uncaptured Stripe charge expires (i.e. is 7 days past the original authorization date)
# Resources:
# - https://support.stripe.com/questions/does-stripe-support-authorize-and-capture
# - https://stripe.com/blog/auth-capture
require 'stripe'
@token = 'sk_test_'
View apply_stripe_charge_to_netsuite_invoice.rb
# Michael Bianco <mike@suitesync.io>
# Description: Boilerplate implementing linking Stripe Charges to NetSuite Invoices
# Documentation: Reach out to SuiteSync for additional documentation!
# requires the following environment variables:
#
# STRIPE_KEY
# NETSUITE_EMAIL
# NETSUITE_PASSWORD