Guest User

Untitled

a guest
Jan 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. module FdrGateway
  2. class Env
  3. def self.fdr_api_cert
  4. ENV['FDR_API_CERT'].gsub("\\n", "\n")
  5. end
  6. def self.fdr_api_key
  7. ENV['FDR_API_KEY'].gsub("\\n", "\n")
  8. end
  9. end
  10. late_fee_accounts_with_params = [
  11. {account_id: 'FD REFERENCE', transactionAmount: 'LATE FEE AMOUNT'},
  12. ]
  13.  
  14. late_fee_failures = []
  15. late_fee_accounts_with_params.each do |params|
  16. result = RestApi.call(
  17. path: '/fs/maintenance/v2/adjustmentTransaction',
  18. account_id: params[:account_id],
  19. json_params: {
  20. batchPrefix: 'RL',
  21. batchType: '05',
  22. transactionCode: '282',
  23. transactionAmount: params[:transactionAmount],
  24. merchantAccountIdentifier: '515942010000248',
  25. transactionPostingDate: 'DATE OF EXECUTION'
  26. }
  27. )
  28.  
  29. if result.failure?
  30. late_fee_failures << "Account #{params[:account_id]} failed with status #{result.status}"
  31. end
  32. end
  33.  
  34. puts late_fee_failures
Add Comment
Please, Sign In to add comment