What is Best Approach When integrating custom payment gateway to CiviCRM/Wordpress
Put your code in a native CiviCRM Extension! There are a number of Payment Processor Extensions already available - go here:

https://civicrm.org/extensions/home?title=&amp;body_value=payment&amp;field_extension_cms_tid=All&amp;field_extension_ready_value=All&amp;sort_by=title&amp;sort_order=DESC

That will find most of them!