you did not specify on which version of Kentico you are developing you custom payment gateway.
A custom payment gataway example for 8.1 version is available on Creating custom payment gateway. The ShoppingCartInfoObj is crated from:
orderID, only if orderID (is not available). If you are using 8.0 Payment form web part in your checkout process, it will be - see the code of PaymentForm.ascx.cx.
ShoppingCart object. It is initiated in 7.0 checkout process).
Ivana Tomanickova, Developer