发码方表
发码方表列出了不同长度用户展示码的发码方ID (CII) 及对应的发码方,并提供了描述码长度及格式的正则表达式。 使用该表,可追踪用户展示码发码方,也可通过码长度、码格式和发码方ID来辨别发码方。如下所示:
表1.2:发码方表示例(最后更新于2020年6月16日)
#获取发码方表
联系我们,以获取发码方表格的最新版本,或者申请将PSP已有的发码规则加入到发码方表格中。
#使用方法
收单机构或ISV在收到用户展示码的值之后,可以确定用户展示码的发码方。请遵循表中的参数顺序(用户展示码的长度、发码方ID和其他条件),逐一判断。用户展示码片段示例如下所示:
copy
import java.util.List;
public class RoutingDemo {
/**
* Given a Routing Table, determine the Code Issuer for a specific Consumer-Presented Code.
* The caller of this method must dertermine a transaction route according to the code issuer returned by this method.
*
* @param code
* @param routingTableItems
* @return
*/
public String getCodeIssuer(String code, List<String[]> routingTableItems) {
for (String[] routingTableItem : routingTableItems) {
//Return the first matching item if any.
if (match(routingTableItem, code)) {
String codeIssuer = routingTableItem[4];
return codeIssuer;
}
}
throw new IllegalArgumentException("No route matches against " + userCode);
}
/**
*
* Whether a routing table item matches the given Consumer-Presented Code.
*
* @param routingTableItem
* @param code
* @return
*/
private boolean match(String[] routingTableItem, String code) {
String regex = routingTableItem[3];
return code.matches(regex);
}
}
注:
发码方的确定过程建议进行参数化处理,以适配发码方表后续的更新。
确定发码方后,您可以选择一条路由转发交易给下一转发目标,最终交由发码方做后续处理。详情请参见用户展示码交易处理。
#Apply for a code issuer ID
如果您计划通过用户展示码发码以开展线下支付业务,请联系我们申请发码方ID。我们会把您登记到发码方表格,以便处理交易的机构能够根据发码方表格来识别码。
如果您已经发码并且与发码方表中的所有发码规则不冲突,也可以联系我们将现有的发码规则注册到路由表。我们将告知您申请所需的信息,并回复申请结果。