patrickjust3k

api call for mortage info

Oct 5th, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. int CALCULATE_MORTGAGE_PAYMENT(int loan_amount, float interest_rate)
  2. {
  3. header_data = Map();
  4. header_data.put("X-Api-Key","*************************");
  5. calc_mortgage = invokeurl
  6. [
  7. url :"https://api.api-ninjas.com/v1/mortgagecalculator?loan_amount=" + loan_amount + "&interest_rate=" + interest_rate + "&duration_years=30"
  8. type :GET
  9. headers:header_data
  10. ];
  11. //info calc_mortgage;
  12. ifNull(calc_mortgage.getJSON("monthly_payment").getJSON("mortgage"),0);
  13. return monthly_payment;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment