ConfigurationPayments

Payments

Configure Payment Methods

SC allows a developer to configure payment methods which are used during the payment process (You can find more information about the payment methods and PSP in the 'Payment methods and PSP gateway introduction' chapter in the 'Knowledge base' section). General configuration is done using the 'SQL Server Management Studio':
  • Open 'SQL Server Management Studio';
  • Locate the SC SQL database;
  • Open the 'PaymentMethod' table:

     
    The 'PaymentMethod' Table 
In this table the base configuration options are stored:
 
Option Description
WebsiteId Is the identification number of a website (see the table 'Websites').
Name Is the default name of the payment method. If no translation is available, it is shown in the 'PaymentMethodTranslation' table (see later).
PaymentModuleId Maps to the payment module in 'web.config' which implements the payment method. You can read about payment modules in the next chapter.
SortNo Specifies the order in which the payment method is displayed on a webshop.
Cost Specifies the amount of money which is added to the order (see 'Payment costs' on the 'Order Overview' page).
IsDefault Specifies if this payment method is chosen as default in the payment method list on the 'Order Overview' page.
ImagePath Specifies the image icon for the payment method.
Active Is a setting which enables or disables the payment method.
IsSystemPaymentMethod When this setting is set to 'True' then the payment method will not be shown to a user though it can still be used by a developer. This feature is useful when the standard Microsoft Dynamics NAV payment method needs to be used during the ordering process.
ExternalParameter Allows the use of external parameters for sending and receiving the payment provider specific data. For more information please read your PSP documentation.
VatRateId Refers to the VAT rate that is added to the payment method cost (VAT rates are specified in the 'VatRate' table).
 
The 'PaymentMethodCountry' table specifies which payment methods are available for the selected country:
 
 
The 'PaymentMethodCountry' Table 
 
If the 'CountryId' field for a payment method is 'NULL' then this payment method will be available for all countries.
If there is no record for a payment method in the 'PaymentMethodCountry' table then this payment method is not at all available.
 
The 'PaymentMethodTranslation' table consists of the translations of the payment method names to the different languages. For example:
 
 
The 'PaymentMethodTranslation' Table 
 
Another thing can be configured when using an external PSP is the mapping between the statuses used in the PSP provider and the statuses used in the Sana Commerce system. Sana Commerce supports a wide selection of payment methods which will all have their own statuses. This mapping can be defined in the PaymentStatusLookup table. For example:
 
 
The 'PaymentStatusLookup' Table 
 
This table has the following fields:
 
PaymentModuleId
The name of the payment module as defined in the web.config. The mapping for each PSP will be stored in the same table.
 
PSPStatus
The status as defined by the PSP. This will differ for each PSP, please refer to the documentation of the PSP for the correct names of these statuses.
 
PaymentStatus
The payment status in Sana Commerce the PSP status should map to.
The following 4 statuses are possible in Sana Commerce:
 
Status Description
New Order is newly created; order is not yet in the payment flow. This status can never be set by the PSP but only when the order is initially created.
In Progress Payment of the order is in progress. The user has not paid yet.
Paid Order is paid.
Cancelled Order is cancelled by the user or something went wrong in the payment process.
 
If a status changes in the PSP it can be changed in this table without requiring a deployment of the code.
 
Configure Payment Methods for Sana Commerce - NAV Connector 
 
In order to configure payment methods for Sana Commerce - NAV Connector G/L Account No. is used. G/L Account No. can be selected from the 'Chart of Accounts' window:
 
 
The 'G/L Account' Settings 
 
In order to G/L Account No. worked several properties should be specified on the G/L Account Card: 
  • 'Account type' should be set to 'Posting'; 
  • 'Direct Posting' should be selected. 
Also you can setup VAT Posting Groups on the G/L Account Card (tab 'Posting').
 
When user selects a payment method on a webshop corresponding sales line with the type 'G/L Account' is created; its number is specified on the 'Webshop Card' window in NAV.
 
 
Sales Line 'G/L Account' in the Order 
 
You should specify Payment Method Code on the 'Webshop Card' window. This code will be used during the on-line order payment, and will be automatically assigned to the 'Payment Method Code' field on the 'Sales Header' window.
 
The 'Payment Method Code' Field on the 'Webshop Card' Window 
ConfigurationPayments