PayPack Auto-Authorize Sales Order script allows you to automate the credit card authorization process for Sales Orders. By leveraging a NetSuite Saved Search, the system can periodically scan for orders that meet your specific business criteria and automatically trigger a Stripe authorization without manual intervention.
Create Saved Search
First, you must define which Sales Orders are eligible for automatic authorization.
A saved search template (PayPack Auto Authorize Sales Order Saved Search) is added via the PayPack SuiteApp for your convenience.
Configure Scheduled Script
The Map/Reduce script is the "engine" that processes the search results.
- Navigate to Customization > Scripting > Script Deployments.
- Find the deployment for: PayPack Auto-Authorize Sales Order MR.
- Click Edit on the deployment.
- Navigate to the Parameters subtab:
- Stripe Account ID: Enter the Internal ID of your PayPack Stripe Account record (only for configuration with multiple Stripe Account)
- Saved Search ID: Enter the saved search ID.
- Navigate to the Schedule subtab:
- Set the frequency (e.g., Daily, or Repeat every 15 minutes) based on how quickly you need orders authorized.
- Ensure the Status is set to Scheduled.
- Hover over the Save button and click Save & Execute (to run it immediately) or just Save to wait for the next scheduled interval.
How it Works
- Detection: The script runs on your defined schedule and pulls all Internal IDs from your Saved Search.
- Execution: For each Sales Order, PayPack sends a request to Stripe to create a payment intent with status requires_capture.
- Update: Upon a successful response from Stripe, the script updates the Sales Order:
- Populates the PayPack Payment Intent ID.
- Sets the PayPack Transaction Status to
requires_capture. - Logs the activity in the PayPack Logs subtab.
- Updates the Sales Order custom field: Authorized Success by checking the box.
Troubleshooting
- Search Results: If orders aren't authorizing, manually run your Saved Search to see if the records appear there. If they don't appear in the search, the script won't find them.
- Script Errors: Check Customization > Scripting > Script Execution Log for the MR script to see if Stripe returned any errors (e.g., "Expired Card" or "Insufficient Funds").