I have a JavaScript button which works fine in classic but doesn't show up in lightning, my guess that JavaScript buttons are not supported in lightning, I couldn't convert it using the converter since it is complicated, how can I write it to accomplish the same functionality, this is the button, it is called Pay Now (Partially):
{!requireScript("/soap/ajax/32.0/connection.js")}
function isEmpty(val){
return (val === undefined || val == null || val.length <= 0) ? true : false;
}
var region = '{!PBSI__PBSI_Sales_Order__c.Stripe_Region__c }';
if(isEmpty(region))
{
region = '{!User.RegionText__c}';
}
result = sforce.connection.query("Select Id from fw1__Payment_Processor__c WHERE Name='" + region + "'");
records = result.getArray("records");
if (result == null || result.size < 1) {
/*alert('You need to setup the payment processor for this region (' + region + ') before making payment');
} else {*/
result=''
}
var payment;
payment = prompt('Please enter the payment amount.');
var RE = /^-{0,1}\d*\.{0,1}\d+$/;
if(RE.test(payment)){
window.open('/apex/fw1__Payment?amount='+payment+'&accountId={!PBSI__PBSI_Sales_Order__c.PBSI__CustomerId__c}&lookupField=Sales_Order__c&lookupId={!PBSI__PBSI_Sales_Order__c.Id}&reference={!PBSI__PBSI_Sales_Order__c.Name}&contactId={!PBSI__PBSI_Sales_Order__c.PBSI__ContactId__c}&Currency={!PBSI__PBSI_Sales_Order__c.CurrencyIsoCode}&Lookupobject=PBSI__PBSI_Sales_Order__c&Description1={!PBSI__PBSI_Sales_Order__c.PBSI__Customer__c}&Description2=Final+Order+Value=+{!PBSI__PBSI_Sales_Order__c.Final_Order_Total_From_Quote2__c}&processor='+region+'&paidAmountField=Paid_Amount__c', '_blank', 'width=640,height=480');
}
else{
alert('Invalid number');
}