Skip to content

Commit

Permalink
* Add support for WeChat Mini Program mode
Browse files Browse the repository at this point in the history
* Bump version to 1.0.20
  • Loading branch information
holajsh committed Apr 20, 2020
1 parent b622269 commit 0ba8a8e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<name>Connect2pay Java Client</name>
<groupId>com.payxpert</groupId>
<artifactId>connect2pay-client</artifactId>
<version>1.0.19</version>
<version>1.0.20</version>
<packaging>jar</packaging>
<description>This is the Java implementation of the PayXpert Connect2pay Payment Page API.</description>
<url>https://www.payxpert.com/</url>
Expand Down Expand Up @@ -91,7 +91,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down Expand Up @@ -212,12 +212,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.9</version>
<version>2.10.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9.1</version>
<version>2.10.3</version>
</dependency>
<dependency>
<groupId>net.sf.oval</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.payxpert.connect2pay.client.requests;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.payxpert.connect2pay.constants.WeChatPaymentMode;

import net.sf.oval.constraint.CheckWith;
Expand Down Expand Up @@ -30,6 +31,10 @@ public class WeChatDirectProcessRequest extends GenericRequest<WeChatDirectProce
@MaxLength(64)
private String notificationTimeZone;

@JsonProperty("openID")
@MaxLength(64)
private String openId;

public String getCustomerToken() {
return customerToken;
}
Expand Down Expand Up @@ -75,6 +80,15 @@ public WeChatDirectProcessRequest setNotificationTimeZone(String notificationTim
return getThis();
}

public String getOpenId() {
return openId;
}

public WeChatDirectProcessRequest setOpenId(String openId) {
this.openId = openId;
return getThis();
}

@Override
protected WeChatDirectProcessRequest getThis() {
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public class WeChatDirectProcessResponse extends GenericResponse<WeChatDirectPro
private String timestamp;
private String sign;

// Mini Program specific parameters
private String paySign;
private String signType;

/**
* @return the result code
*/
Expand Down Expand Up @@ -216,4 +220,25 @@ public void setSign(String sign) {
this.sign = sign;
}

/**
* @return The signature to be used with mini program mode
*/
public String getPaySign() {
return paySign;
}

public void setPaySign(String paySign) {
this.paySign = paySign;
}

/**
* @return The signature type used with mini program mode
*/
public String getSignType() {
return signType;
}

public void setSignType(String signType) {
this.signType = signType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ public enum WeChatPaymentMode {
/**
* SDK mode: to be used for in-app mode
*/
SDK;
SDK,

/**
* MiniProgram mode: used when the payment must be performed from WeChat Mini Program
*/
MINIPROGRAM;

@JsonValue
public String getFormattedName() {
Expand Down

0 comments on commit 0ba8a8e

Please sign in to comment.