update,
This commit is contained in:
27
task1/utils/checkPaymentLinkAvailable.js
Normal file
27
task1/utils/checkPaymentLinkAvailable.js
Normal file
@@ -0,0 +1,27 @@
|
||||
function checkPaymentLinkAvailable(current_row) {
|
||||
var output = { state: "init", debug: { current_row }, error: {} };
|
||||
try {
|
||||
var sheet = SpreadsheetApp.openById(SHEET_ID).getSheetByName(
|
||||
SHEET_STUDENT_PROGRESS
|
||||
);
|
||||
|
||||
var payment_link_cell = getCell(
|
||||
sheet,
|
||||
current_row,
|
||||
COL_STUDENT_PROGRESS_PAYMENT_LINK
|
||||
);
|
||||
var payment_link = readCell(payment_link_cell);
|
||||
console.log({ payment_link });
|
||||
|
||||
if (payment_link.search(/^https?:\/\/.+/) > -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (error) {
|
||||
output = { ...output, error };
|
||||
console.log('checkPaymentLinkAvailable error')
|
||||
console.log(output);
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user