Under the micro-service architecture interface how to integrate Alipay payment service (a) the overall design

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_42237752/article/details/96102657

1, environment configuration

Micro-service architecture using SpringCloud technology stack technology, including:
distributed configuration center: SpringCloudConfig Version: 2.0.1
Service Discovery and Registration Center: Eureka Version: 1.4.3
inter-service load balancing: OpenFeign Version: 2.0.1
fuse mechanism: hystrix version: 1.3.1
here we must note: when using SpringBoot and SpringCloud there is a version matching relation:

Spring Boot Spring Cloud
1.2.x Angel version
1.3.x Brixton Version
1.4.x stripes Camden version
1.5.x Dalston version, Edgware version
2.0.x Finchley version

My father then used in the project is version 2.0.0 of springboot, and Finchley version of springcloud.
Here Insert Picture Description

2, Alipay Interface Application (sandbox environment)

Here declare it: Alipay actual environment requires businesses operating license verification, so here I personally just use the sandbox environment.
Refer to this blog specific process: how the next micro-architecture integrated service Alipay payment service interface (VI) Alipay Interface (sandbox environment) application

3, the project to build

Since these modules are a small a project, set up process is relatively complex, written in the articles in the crowded, so we divided the articles.
Micro services using maven build.
The directory structure follows
Here Insert Picture Description
the parent project: blog packaged form pom
remaining sub-projects, all packaged into a jar package. (Of course, if you want to use an external tomcat clustered configuration, that is, consumers need to be inside my blog-security packaged into war package)

(1) Set up the configuration center config

Refer to this blog specific process: how the next micro-architecture integrated service Alipay payment service interface (b) the use SpringCloudConfig to build distribution center

(2) build a service registry eureka

Refer to this blog specific process: how the next micro-architecture integrated service Alipay payment service interface (three) combined distribution center structures eureka service registry

(3) Add Alipay api-related entity classes

Here Insert Picture Description
Here are some of the main parameters of the request to package alipay, parameters and return values.
AlipayBizParameters all the necessary parameters are uploaded to the package when the transmission request. (In addition to the configuration parameters)
AlipayNotifyUrlParameters all the parameters are returned to the asynchronous package.
Specific parameters description can be found in Alipay's official website:
Upload parameters: https://docs.open.alipay.com/api_1/alipay.trade.precreate/
asynchronous return values: https://docs.open.alipay.com/ 270/105 902 /

(4) to provide payment services through an integrated provider alipay

Please refer to the specific process blog: under micro Services Architecture how to integrate Alipay payment service interface (iv) to provide integrated alipay payment service

(5) calls the payment service provider to provide in real projects

Please refer to the specific process blog: How the next micro-architecture integrated service Alipay payment service interface (e) consumer payment services consumers to build

(6) Use Docker project deployment

Guess you like

Origin blog.csdn.net/weixin_42237752/article/details/96102657