ConfigurationDocData PSP Module

DocData PSP Module

Configure a Test DocData Payment Module

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 'Frontend/Bin' folder of Sana Commerce.
  • 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="ResponseUseXml" value="false" isRequestParameter="false" />
        <add name="ResponseUsePost" value="true" isRequestParameter="false" />
        <add name="IsFramed" value="true" isRequestParameter="false" />
        <add name="merchant_name" value="…" isRequestParameter="true" />
        <add name="merchant_password" value="…" isRequestParameter="false" />
        <add name="profile" value="…" 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="DebugDomains" value="localhost" isRequestParameter="false" />
       <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 the DocData payment methods. There are two ways to do this:
    • Configure the DocData payment methods in the backoffice. For more information read this chapter.
    • Configure the DocData payment methods by running the 'ConfigureDocDataInDB.sql' SQL script on the Sana Commerce database.
      The 'ConfigureDocDataInDB.sql' SQL script will add the 'American Express card', 'Master card', 'Ideal' and 'Banktransfer' payment methods.
      These payment methods will be available for all countries configured in the system. No translations for the payment methods will be set by this script - this should be done manually.

    • After the script has been run, all fields should be checked for the correct values. By default the script makes these new payment methods active by setting the 'Active' field value to 'true'. Therefore these payment methods will be immediately available on the frontend.

      Before running the script make sure that you have changed the '@siteId' variable (if needed) to match the appropriate website identifier.

      Keep in mind that this script assigns each payment method to a separate payment profile. Check that the names of the payment profiles in the 'PaymentMethod' table (in the 'Fields' column) match the names of the payment profiles as configured in the DocData backoffice.

  • 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 

  • Check in the backoffice that correct values are set in the 'PSP code' and 'PSP profile name' fields for DocData payment methods. In the screenshot below you can see an example of configuration of the 'Master Card' DocData payment method in Sana Commerce - Backoffice.


    Configuring the 'Master Card' DocData Payment Method in Sana Commerce - Backoffice

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

    If the value of the 'PSP profile name' field 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=
  • Find the 'files' folder, where the DocData payment method icons are stored. Copy the 'files' folder to 'Frontend\content\'. These icons will be displayed on the frontend in the payment method selection control.
  • When all the changes are made, the 'Refresh site cache' button in the 'Sana Commerce - Backoffice' should be clicked.
  • 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