View hide_and_quit_apps.sh
This file contains 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 quit_apps() { | |
for app in $@; do | |
echo "Quitting $app..." | |
osascript -e "with timeout of 30 seconds | |
quit app \"$app\" | |
end timeout" | |
if [ $? -ne 0 ]; then | |
# if the application did not quit on it's own, let's force it! |
View fidelity_charitable_export.js
This file contains 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
$x("//a[contains(@href, \"fc-services/api/v1/document/download\")]").forEach(el => { el.download = el.text.replace("(PDF)", "").replace("/", "-") + ".pdf"; var e = document.createEvent('MouseEvents'); e.initEvent('click' ,true ,true); el.dispatchEvent(e);}) |
View stripe_zero_decimal_currencies.rb
This file contains 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
# https://stripe.com/docs/currencies#zero-decimal | |
ZERO_DECIMAL_CURRENCIES = %w( | |
BIF | |
CLP | |
DJF | |
GNF | |
JPY | |
KMF | |
KRW | |
MGA |
View custom_line_item_tax.rb
This file contains 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
# Description: Example of using custom line item taxes in Stripe & NetSuite | |
Stripe.api_key = ENV['STRIPE_KEY'] | |
customer = Stripe::Customer.create | |
Stripe::InvoiceItem.create( | |
customer: customer.id, | |
description: 'A great product', | |
amount: 10_00, |
View map_stripe_coupons_to_netsuite.rb
This file contains 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
# Mike Bianco <mike@suitesync.io> | |
# Description: Connect Stripe coupons to existing NetSuite discount items | |
# Usage: map_stripe_coupons_to_netsuite.rb mapping.csv | |
# Link: https://gist.github.com/iloveitaly/eed7602d055d5402dd34d0ba79de6ca2 | |
require 'stripe' | |
require 'csv' | |
Stripe.api_key = ENV['STRIPE_KEY'] |
View update_stripe_customer_from_netsuite.js
This file contains 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
// Link: https://gist.github.com/iloveitaly/0e6d012d8dffa2444e0b36c0ec7b5781 | |
define([ 'N/search', 'N/record', 'N/runtime', 'N/error', 'N/https' ], | |
function(search, record, runtime, error, https) { | |
var STRIPE_KEY = 'sk_test_123'; | |
var STRIPE_ENDPOINT = 'https://api.stripe.com/v1/'; | |
function afterSubmit(context) { | |
if(context.type !== context.UserEventType.UPDATE) { |
View netsuite_gift_card_code_using_external_service.js
This file contains 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: Mike Bianco <mike@suitesync.io> | |
Description: Generate a gift card code using an external service when a sales order is created | |
Link: | |
# Setup Instructions | |
## Upload Script | |
https://system.sandbox.netsuite.com/app/common/scripting/uploadScriptFile.nl | |
File Name: gift_card_generate_before_submit.js |
View create_standalone_payment_with_custom_metadata.rb
This file contains 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 <mike@suitesync.io> | |
# 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 |
View stripe_invoice_with_custom_rev_rec.rb
This file contains 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 <mike@suitesync.io> | |
# 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') |
View map_custom_field_to_netsuite_field.js
This file contains 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: <mike@suitesync.io> | |
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 |
NewerOlder