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
public class BackupService | |
{ | |
private readonly string _connectionString; | |
private readonly string _backupFolderFullPath; | |
private readonly string[] _systemDatabaseNames = { "master", "tempdb", "model", "msdb" }; | |
public BackupService(string connectionString, string backupFolderFullPath) | |
{ | |
_connectionString = connectionString; | |
_backupFolderFullPath = backupFolderFullPath; |
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
public bool IsAuthenticWebhook(NameValueCollection requestHeaders, string requestBody, string shopifySecretKey) | |
{ | |
string hmacHeader = requestHeaders.Get("X-Shopify-Hmac-SHA256"); | |
if (string.IsNullOrEmpty(hmacHeader)) | |
{ | |
return false; | |
} | |
HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(shopifySecretKey)); |
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
private static void CreateFolder(string folderName,DriveService service) | |
{ | |
var fileMetadata = new Google.Apis.Drive.v3.Data.File() | |
{ | |
Name = folderName, | |
MimeType = "application/vnd.google-apps.folder" | |
}; | |
var request = service.Files.Create(fileMetadata); | |
request.Fields = "id"; | |
var file = request.Execute(); |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<appSettings> | |
<add key="AppId" value="your_app_id" /> | |
<add key="AppSecret" value="your_app_secret" /> | |
<add key="AppScope" value="read_orders,write_orders" /> | |
</appSettings> |
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
/** | |
* @NApiVersion 2.x | |
* @NScriptType Restlet | |
* @NModuleScope SameAccount | |
*/ | |
define(['N/search', 'N/record'], | |
/** | |
* @param {search} search | |
* @param {record} record | |
*/ |
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
const fs = require('fs'); | |
const readline = require('readline'); | |
const { google } = require('googleapis'); | |
//Drive API, v3 | |
//https://www.googleapis.com/auth/drive See, edit, create, and delete all of your Google Drive files | |
//https://www.googleapis.com/auth/drive.file View and manage Google Drive files and folders that you have opened or created with this app | |
//https://www.googleapis.com/auth/drive.metadata.readonly View metadata for files in your Google Drive | |
//https://www.googleapis.com/auth/drive.photos.readonly View the photos, videos and albums in your Google Photos | |
//https://www.googleapis.com/auth/drive.readonly See and download all your Google Drive files | |
// If modifying these scopes, delete token.json. |
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 CreateCustomerDeposit(salesOrderId, paymentMethod) { | |
try { | |
if (paymentMethod != 'free') { | |
var order = record.load({ | |
id: salesOrderId, | |
type: record.Type.SALES_ORDER, | |
isDynamic: true | |
}); |
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 IsNewOrder(orderId) { | |
var s = search.create({ | |
type: search.Type.SALES_ORDER, | |
filters: [ | |
['mainline', 'is', 'T'], 'and', | |
['trandate', 'onorafter', '04/01/2019'], 'and', | |
['otherrefnum', 'equalto', orderId] | |
], | |
columns: ['otherrefnum'] | |
}).run().getRange({ |
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
/** | |
* @NApiVersion 2.x | |
* @NScriptType Restlet | |
* @NModuleScope SameAccount | |
*/ | |
define(['N/search', 'N/record', 'N/util', './momentjs.js', './cafeaspMagento.js'], | |
/** | |
* @param {search} search | |
* @param {record} record | |
* @param {util} util |
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 RunSaveSearch() { | |
var mySearch = search.load({ | |
id: '111111' | |
}); | |
var array = []; | |
mySearch.run().each(function (result) { | |
log.debug('result', result); | |
var netamount = result.getValue({ | |
name: 'netamount' |
OlderNewer