Prior to even looking at the eDirectory code, it is recommend you thoroughly review the API of the Payment gateway which you are trying to implement. Most gateways have similar methods, and doing so will allow you to see correspondence in the eDirectory code.
Here are typically the steps to implement a gateway. ***See disclaimer about code customizations below.
1 - Create a file that will contain settings information for the payment gateway, for example (conf/payment_paypal.inc.php )
2 - Edit the code that allows these settings to be configured in the Site Manager via /sitemgr/prefs/paymentgateway.php and the settings configurations forms /includes/forms/form_paymentsettings_paypal.php for example)
3 - Checkout forms for the payment gateway should be created such as /includes/forms/form_billing_paypal.php
4 - Additionally code to receive the response from the payment gateway must be created such as /includes/code/billing_paypal.php
5 - The payment method selection form must be altered so the user can select which payment method to use: includes/code/form_paymentmethod.php
6 - Some gateways have another receipt file that must be created members/billing/receipt.php
---