The Development method of shop++ third Party payment plug-in
I believe that friends engaged in e-commerce software development know more about SHOP++ online mall software. Recently, I am also studying SHOP++, and have an in-depth understanding of shop++ third-party payment plug-in development. SHOP++ third-party payment is developed using plug-in mechanism, and it is very easy to expand new third-party payment. The following is the basic method of plug-in development. You can refer to it:
1. Reference and copy the net.shopxx.plugin.alipayDirect package
2. Rename package name, plug-in class (AlipayDirectPlugin.java) name, configuration controller class (AlipayDirectController.java) name, configuration view (setting.ftl) name
3. Modify the @ Component annotation value of the plug-in class and make it unique
4. Modify the plug-in class implementation method, as follows:
/ * *
* get the plug-in name
, /
Public abstract String getName ()
/ * *
* get the plug-in version
, /
Public abstract String getVersion ()
/ * *
* get plug-in author
, /
Public abstract String getAuthor ()
/ * *
* obtain the plug-in URL
, /
Public abstract String getSiteUrl ()
/ * *
* obtain the installation URL, manage the installation link address of the background plug-in, and return null if you do not need the installation function. If you need this function, you need to write the corresponding configuration controller class.
, /
Public abstract String getInstallUrl ()
/ * *
* obtain the uninstall URL, manage the uninstall link address of the background plug-in, and return null if you do not need the uninstall function. If you need this function, you need to write the corresponding configuration controller class.
, /
Public abstract String getUninstallUrl ()
/ * *
* get the setting URL, and manage the backend plug-in to set the link address. If you do not need to set the function, return null. If you need this function, you need to write the corresponding configuration controller class.
, /
Public abstract String getSettingUrl ()
/ * *
* obtain the request URL and jump to the URL of the third-party payment interface
, /
Public abstract String getRequestUrl ()
/ * *
* obtain the request method and jump to the request method of the third-party payment interface
, /
Public abstract RequestMethod getRequestMethod ()
/ * *
* obtain the request character code and jump to the character code of the third-party payment interface
, /
Public abstract String getRequestCharset ()
/ * *
* obtain the request parameters and jump to the request parameters of the third-party payment interface
*
* @ param sn
* No.
* @ param description
* description
* @ param request
* httpServletRequest
* @ return request parameters
, /
Public abstract Map getParameterMap (String sn, String description, HttpServletRequest request)
/ * *
* verify whether the notification is legal, and whether the return result after the completion of the third party payment is legal.
*
* @ param sn
* No.
* @ param notifyMethod
* Notification method
* @ param request
* httpServletRequest
Is the * @ return notification legal?
, /
Public abstract boolean verifyNotify (String sn, NotifyMethod notifyMethod, HttpServletRequest request)
/ * *
* get the notification return message and receive the response of the return result after the completion of the third party payment
*
* @ param sn
* No.
* @ param notifyMethod
* Notification method
* @ param request
* httpServletRequest
* @ return Notification return message
, /
Public abstract String getNotifyMessage (String sn, NotifyMethod notifyMethod, HttpServletRequest request)
/ * *
* obtain the timeout and pay for the timeout
, /
Public abstract Integer getTimeout ()