Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
letiantian committed Dec 20, 2016
1 parent c52a6f8 commit aff9ac7
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 41 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ com.qq.weixin.pay.WXPay类下提供了对应的方法:


## 安装
通过maven,具体待定。
maven:
```
<dependency>
<groupId>com.github.wxpay</groupId>
<artifactId>wxpay-sdk</artifactId>
<version>0.0.1</version>
</dependency>
```

## 示例
MyConfig.java:
Expand Down
95 changes: 94 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@

<groupId>com.github.wxpay</groupId>
<artifactId>wxpay-sdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
<name>wxpay-sdk</name>
<description>wxpay java sdk</description>
<url>https://github.com/wxpay/WXPay-SDK-Java</url>

<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
</properties>

<dependencies>
<dependency>
Expand All @@ -30,4 +38,89 @@
</dependency>
</dependencies>

<licenses>
<license>
<name>The BSD 3-Clause License</name>
<url>https://opensource.org/licenses/BSD-3-Clause</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>https://github.com/wxpay/WXPay-SDK-Java</url>
<connection>[email protected]:wxpay/WXPay-SDK-Java.git</connection>
<developerConnection>https://github.com/wxpay/WXPay-SDK-Java</developerConnection>
</scm>

<developers>
<developer>
<name>wxpay</name>
<email>[email protected]</email>
<url>http://wxpay.github.io</url>
</developer>
</developers>

<profiles>
<profile>
<id>release</id>
<distributionManagement>
<snapshotRepository>
<id>oss</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>oss</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<!-- Source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Gpg Signature -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
50 changes: 25 additions & 25 deletions src/main/java/com/github/wxpay/sdk/WXPay.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ else if (return_code.equals(WXPayConstants.SUCCESS)) {
}

/**
* 作用:提交刷卡支付<br/>
* 作用:提交刷卡支付<br>
* 场景:刷卡支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -171,7 +171,7 @@ public Map<String, String> microPay(Map<String, String> reqData) throws Exceptio


/**
* 作用:提交刷卡支付<br/>
* 作用:提交刷卡支付<br>
* 场景:刷卡支付
* @param reqData 向wxpay post的请求数据
* @param timeoutMs 超时时间,单位是毫秒
Expand All @@ -185,7 +185,7 @@ public Map<String, String> microPay(Map<String, String> reqData, int timeoutMs)


/**
* 作用:统一下单<br/>
* 作用:统一下单<br>
* 场景:公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -197,7 +197,7 @@ public Map<String, String> unifiedOrder(Map<String, String> reqData) throws Exce


/**
* 作用:统一下单<br/>
* 作用:统一下单<br>
* 场景:公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @param timeoutMs 超时时间,单位是毫秒 超时时间,单位是毫秒
Expand All @@ -211,7 +211,7 @@ public Map<String, String> unifiedOrder(Map<String, String> reqData, int timeout


/**
* 作用:查询订单<br/>
* 作用:查询订单<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -223,7 +223,7 @@ public Map<String, String> orderQuery(Map<String, String> reqData) throws Except


/**
* 作用:查询订单<br/>
* 作用:查询订单<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据 int
* @param timeoutMs 超时时间,单位是毫秒
Expand All @@ -237,7 +237,7 @@ public Map<String, String> orderQuery(Map<String, String> reqData, int timeoutMs


/**
* 作用:撤销订单<br/>
* 作用:撤销订单<br>
* 场景:刷卡支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -249,8 +249,8 @@ public Map<String, String> reverse(Map<String, String> reqData) throws Exception


/**
* 作用:撤销订单<br/>
* 场景:刷卡支付<br/>
* 作用:撤销订单<br>
* 场景:刷卡支付<br>
* 其他:需要证书
* @param reqData 向wxpay post的请求数据
* @param timeoutMs 超时时间,单位是毫秒
Expand All @@ -264,7 +264,7 @@ public Map<String, String> reverse(Map<String, String> reqData, int timeoutMs) t


/**
* 作用:关闭订单<br/>
* 作用:关闭订单<br>
* 场景:公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -276,7 +276,7 @@ public Map<String, String> closeOrder(Map<String, String> reqData) throws Except


/**
* 作用:关闭订单<br/>
* 作用:关闭订单<br>
* 场景:公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @param timeoutMs 超时时间,单位是毫秒
Expand All @@ -290,7 +290,7 @@ public Map<String, String> closeOrder(Map<String, String> reqData, int timeoutMs


/**
* 作用:申请退款<br/>
* 作用:申请退款<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -302,8 +302,8 @@ public Map<String, String> refund(Map<String, String> reqData) throws Exception


/**
* 作用:申请退款<br/>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付<br/>
* 作用:申请退款<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付<br>
* 其他:需要证书
* @param reqData 向wxpay post的请求数据
* @param timeoutMs 超时时间,单位是毫秒
Expand All @@ -317,7 +317,7 @@ public Map<String, String> refund(Map<String, String> reqData, int timeoutMs) th


/**
* 作用:退款查询<br/>
* 作用:退款查询<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -329,7 +329,7 @@ public Map<String, String> refundQuery(Map<String, String> reqData) throws Excep


/**
* 作用:退款查询<br/>
* 作用:退款查询<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @param timeoutMs 超时时间,单位是毫秒
Expand All @@ -343,7 +343,7 @@ public Map<String, String> refundQuery(Map<String, String> reqData, int timeoutM


/**
* 作用:对账单下载(成功时返回对账单数据,失败时返回XML格式数据)<br/>
* 作用:对账单下载(成功时返回对账单数据,失败时返回XML格式数据)<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -355,8 +355,8 @@ public Map<String, String> downloadBill(Map<String, String> reqData) throws Exce


/**
* 作用:对账单下载<br/>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付<br/>
* 作用:对账单下载<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付<br>
* 其他:无论是否成功都返回Map。若成功,返回的Map中含有return_code、return_msg、data,
* 其中return_code为`SUCCESS`,data为对账单数据。
* @param reqData 向wxpay post的请求数据
Expand All @@ -383,7 +383,7 @@ public Map<String, String> downloadBill(Map<String, String> reqData, int timeout


/**
* 作用:交易保障<br/>
* 作用:交易保障<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -395,7 +395,7 @@ public Map<String, String> report(Map<String, String> reqData) throws Exception


/**
* 作用:交易保障<br/>
* 作用:交易保障<br>
* 场景:刷卡支付、公共号支付、扫码支付、APP支付
* @param reqData 向wxpay post的请求数据
* @param timeoutMs 超时时间,单位是毫秒
Expand All @@ -409,7 +409,7 @@ public Map<String, String> report(Map<String, String> reqData, int timeoutMs) th


/**
* 作用:转换短链接<br/>
* 作用:转换短链接<br>
* 场景:刷卡支付、扫码支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -421,7 +421,7 @@ public Map<String, String> shortUrl(Map<String, String> reqData) throws Exceptio


/**
* 作用:转换短链接<br/>
* 作用:转换短链接<br>
* 场景:刷卡支付、扫码支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -434,7 +434,7 @@ public Map<String, String> shortUrl(Map<String, String> reqData, int timeoutMs)


/**
* 作用:授权码查询OPENID接口<br/>
* 作用:授权码查询OPENID接口<br>
* 场景:刷卡支付
* @param reqData 向wxpay post的请求数据
* @return API返回数据
Expand All @@ -446,7 +446,7 @@ public Map<String, String> authCodeToOpenid(Map<String, String> reqData) throws


/**
* 作用:授权码查询OPENID接口<br/>
* 作用:授权码查询OPENID接口<br>
* 场景:刷卡支付
* @param reqData 向wxpay post的请求数据
* @param timeoutMs 超时时间,单位是毫秒
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/com/github/wxpay/sdk/WXPayConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,40 @@ public interface WXPayConfig {


/**
* 获取App ID
* 获取 App ID
*
* @return App ID
*/
public String getAppID();


/**
* 获取Mch ID
* 获取 Mch ID
*
* @return Mch ID
*/
public String getMchID();


/**
* 获取API密钥
* 获取 API 密钥
*
* @return API密钥
*/
public String getKey();


/**
* 获取商户证书内容
*
* @return 商户证书内容
*/
public InputStream getCertStream();


/**
* HTTP(S)请求超时时间,单位毫秒
*
* @return 超时时间
*/
public int getTimeOutMs();
Expand Down
Loading

0 comments on commit aff9ac7

Please sign in to comment.