Use a standalone Stripe payment to create an invoice in NetSuite with custom data http://SuiteSync.io/
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 | |
require 'stripe' | |
Stripe.api_key = ENV['STRIPE_KEY'] | |
Stripe::Charge.create( | |
currency: 'usd', | |
amount: 100_00, | |
source: 'tok_visa', | |
description: "Order #123 from Fred", | |
metadata: { | |
# https://dashboard.suitesync.io/docs/standalone-charges#custom-netsuite-items-with-standalone-charges | |
netsuite_product_name: "identifer_of_netsuite_product" | |
# additional fields on the NetSuite invoice or NetSuite customer payment | |
# metadata fields can be mapped to whatever NetSuite field (on the invoice or customer payment) you'd like | |
# drop-downs needs to be specified using a NS internal ID: https://dashboard.suitesync.io/docs/field-customization#field-types | |
netsuite_department_id: 123 | |
netsuite_class_id: 234, | |
# free form text can just be passed along | |
netsuite_custom_field_data: "Some data for a custom NetSuite field" | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment