ConfigurationDocData PSP Module

DocData PSP Module

Configure a Test DocData Payment Module

 
Before continuing, please make sure that the payment library is already configured correctly (database, logging, configuration) otherwise please read this section.
 
In order to add the DocData Payment Module to a project, please undertake the following steps:
  • Copy the 'Sana.Commerce.Payment.DocData.dll', 'Sana.Commerce.Payment.DocData.pdb' and 'Sana.Commerce.Payment.DocData.xml' files from the DocData release to the project and create a reference to 'Sana.Commerce.Payment.DocData.dll' in the starter site project.
  • Add a new payment module configuration entry in the <payment-configuration> node of the Starter Site's 'web.config' to the DocData module. This entry should contain the following values:

    <module name="DocData" type="Sana.Commerce.Payment.DocData.DocDataPaymentModule, Sana.Commerce.Payment.DocData">
        <settings>
            <clear />
            <add name="merchant_name" value="…" isRequestParameter="true" />
            <add name="merchant_password" value="…" isRequestParameter="false" />
            <add name="profile" value="…" isRequestParameter="false" />  
            <add name="DebugDomains" value="localhost" isRequestParameter="false" />
            <add name="ResponseUseXml" value="false" isRequestParameter="false" />
            <add name="ResponseUsePost" value="true" isRequestParameter="false" />
            <add name="IsFramed" value="true" isRequestParameter="false" />
            <add name="days_pay_period" value="14" isRequestParameter="false" />
            <add name="PostUrl" value=https://test.tripledeal.com/ps/com.tripledeal.paymentservice.servlets.PaymentService?command=new_payment_cluster" isRequestParameter="false"  />
            <add name="statusUrl" value="https://test.tripledeal.com/ps/com.tripledeal.paymentservice.servlets.PaymentService?command=status_payment_cluster" isRequestParameter="false" />
            <add name="PaymentPage" value="https://test.tripledeal.com/ps/com.tripledeal.paymentservice.servlets.PaymentService?command=show_payment_cluster" isRequestParameter="true" />
           <add name="return_url_success" value="checkout/ordersubmit.aspx?id=" isRequestParameter="true" />
           <add name="return_url_canceled" value="checkout/Ordercancelled.aspx?id=" isRequestParameter="true" />
           <add name="return_url_pending" value="checkout/ordersubmit.aspx?id=" isRequestParameter="true" />
           <add name="return_url_error" value="checkout/orderfailed.aspx?id=" isRequestParameter="true" />
           <add name="DebugConfirmUrl" value="checkout/PaymentConfirm.aspx?id={0}" isRequestParameter="false" />
        </settings>
    </module>
     
 
For an explanation of these configuration values, please read this chapter and the chapter 'DocData specific configuration values' below.
  • Configure DocData payment methods in the database. To do this, find and run the 'ConfigureDocDataInDB.sql' SQL script on the Sana Commerce database.
  • Request a test account from DocData and modify the merchant_name and merchant_password to the merchant name and password you have received from DocData. (Note that the password differs from the password used for logging into the DocData backoffice.)
  • Log into the DocData backoffice and configure or verify payment profiles. This can be done in 'Settings > Edit Payment profiles'. Each payment method must be configured under a separate profile. You can find the configured profiles in the following place in backoffice (marked by the red box):


    Configuring Payment Methods in the DocData Backoffice 

  • Open 'PaymentMethod' table in Sana Commerce database (make sure that you have successfully run the 'ConfigureDocDataInDB.sql' SQL script, as described previously). Check that correct values are set in 'ExternalParameter' and 'Fields' columns for DocData payment methods. In the screenshot below you can see an example of configuration of three DocData payment methods in the Sana Commerce database.


    Configuring Three DocData Payment Methods in the Sana Commerce Database

    Note that the values of 'ExternalParameter' column should match the identifiers of appropriate payment methods in DocData backoffice. Also, in the 'Fields' column the values of 'profile' XML field should match the names of appropriate payment profiles in DocData backoffice (see previous screenshot also).

    If the value of 'profile' XML field in 'Fields' column is not set for a certain payment method, then the system will use the default payment profile, which is specified in DocData module configuration in 'web.config' file of Starter Site. In the example below, the value of default profile name in configuration is set to 'standard':
    <add name="profile" value="standard" isRequestParameter="false" />  
 In order to test the payment flow in the development environment, there are two possible scenarios:
  • The development machine/server cannot be accessed externally by the DocData server (most common scenario): in this case add all domains used by the development server in the 'DebugDomains' setting in the 'web.config'. Multiple domains can be separated by the ',' character. This will make it possible to test the whole flow of a test payment, when the confirm page cannot be reached by DocData. This setting is for debugging purposes only and should not be used in any live situation.
  • The development machine/server can be accessed. In this case you can configure DocData to test the payment flow. Remove the 'DebugDomains' setting from the payment module configuration. In the backoffice of DocData configure the correct URL's in 'Settings > View/Edit merchant profile > URL'.

     
    Configuring URL Settings 
 Configure URLs the following way:
 
Name Value
 Return URL success  http://<domain>/checkout/ordersubmit.aspx?id=
 Return URL canceled  http://<domain>/checkout/orderfailed.aspx?id=
 Return URL error  http://<domain>/checkout/orderfailed.aspx?id=
 Return URL pending  http://<domain>/checkout/ordersubmit.aspx?id=
 Update URL  http://<domain>/checkout/paymentconfirm.aspx?id=
  • Create payment methods that need to pay with the new DocData payment module for the correct countries and payment methods. The 'PaymentModuleId' field should match the name of the payment module as configured in the configuration ('DocData' in the example).  Click here for more information about configuring payment methods in Sana Commerce.
  • Test the payment/checkout flow to see if everything works, using the newly configured payment methods and the correct payment statuses that are set.
ConfigurationDocData PSP Module