cn.beecloud
类 BCPay

java.lang.Object
  继承者 cn.beecloud.BCPay

public class BCPay
extends Object

This is the core class of BC payment for external invocation consist of start payment, start refund, start query bill start refund query and check wechat refund status functionality.

从以下版本开始:
2015/7/11
作者:
Ray

构造方法摘要
BCPay()
           
 
方法摘要
static BCPayResult startBCPay(BCEumeration.PAY_CHANNEL channel, int total_fee, String bill_no, String title, Map<String,String> optional, String return_url, String openid, String show_url, BCEumeration.QR_PAY_MODE qr_pay_mode)
           
static BCPayResult startBCRefund(BCEumeration.PAY_CHANNEL channel, String refund_no, String bill_no, int refund_fee, Map optional)
           
static BCQueryResult startQueryBill(BCEumeration.PAY_CHANNEL channel, String bill_no, Long start_time, Long end_time, Integer skip, Integer limit)
           
static BCQueryResult startQueryRefund(BCEumeration.PAY_CHANNEL channel, String bill_no, String refund_no, Long start_time, Long end_time, Integer skip, Integer limit)
           
static BCQueryStatusResult startWeChatRefundStatusQuery(String refund_no)
           
static boolean verifySign(String sign, String timestamp)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

BCPay

public BCPay()
方法详细信息

startBCPay

public static BCPayResult startBCPay(BCEumeration.PAY_CHANNEL channel,
                                     int total_fee,
                                     String bill_no,
                                     String title,
                                     Map<String,String> optional,
                                     String return_url,
                                     String openid,
                                     String show_url,
                                     BCEumeration.QR_PAY_MODE qr_pay_mode)
参数:
channel - (必填)渠道类型, 根据不同场景选择不同的支付方式,包含: s * WX_NATIVE 微信公众号二维码支付 WX_JSAPI 微信公众号支付 ALI_WEB 支付宝网页支付 ALI_QRCODE 支付宝内嵌二维码支付 ALI_WAP: 支付宝移动网页支付 UN_WEB 银联网页支付
total_fee - (必填)订单总金额, 只能为整数,单位为分,例如 1
bill_no - (必填)商户订单号, 32个字符内,数字和/或字母组合,确保在商户系统中唯一, 例如(201506101035040000001)
title - (必填)订单标题, 32个字节内,最长支持16个汉字
optional - (选填)附加数据, 用户自定义的参数,将会在webhook通知中原样返回,该字段主要用于商户携带订单的自定义数据
return_url - (选填)同步返回页面 , 支付渠道处理完请求后,当前页面自动跳转到商户网站里指定页面的http路径。当 channel 参数为 ALI_WEB 或 ALI_QRCODE 或 UN_WEB时为必填
openid - (选填) 微信公众号支付(WX_JSAPI)必填
show_url - (选填)商品展示地址,需以http://开头的完整路径,例如:http://www.商户网址.com/myorder.
qr_pay_mode - (选填)二维码类型,二维码类型含义 MODE_BRIEF_FRONT: 订单码-简约前置模式, 对应 iframe 宽度不能小于 600px, 高度不能小于 300px MODE_FRONT: 订单码-前置模式, 对应 iframe 宽度不能小于 300px, 高度不能小于 600px MODE_MINI_FRONT: 订单码-迷你前置模式, 对应 iframe 宽度不能小于 75px, 高度不能小于 75px
返回:
BCPayResult

startBCRefund

public static BCPayResult startBCRefund(BCEumeration.PAY_CHANNEL channel,
                                        String refund_no,
                                        String bill_no,
                                        int refund_fee,
                                        Map optional)
参数:
channel - (必填)渠道类型, 根据不同场景选择不同的支付方式,包含: WX 微信 ALI 支付宝 UN 银联
refund_no - (必填)商户退款单号 , 格式为:退款日期(8位) + 流水号(3~24 位)。不可重复,且退款日期必须是当天日期。流水号可以接受数字或英文字符,建议使用数字,但不可接受“000”。 例如:201506101035040000001
bill_no - (必填)商户订单号, 32个字符内,数字和/或字母组合,确保在商户系统中唯一
refund_fee - (必填)退款金额, 只能为整数,单位为分,例如1
optional - (选填)附加数据 用户自定义的参数,将会在webhook通知中原样返回,该字段主要用于商户携带订单的自定义数据,例如{"key1":"value1","key2":"value2",...}
返回:
BCPayResult

startQueryBill

public static BCQueryResult startQueryBill(BCEumeration.PAY_CHANNEL channel,
                                           String bill_no,
                                           Long start_time,
                                           Long end_time,
                                           Integer skip,
                                           Integer limit)
参数:
channel - (必填)渠道类型, 根据不同场景选择不同的支付方式,包含: WX WX_APP 微信手机APP支付 WX_NATIVE 微信公众号二维码支付 WX_JSAPI 微信公众号支付 ALI ALI_APP 支付宝APP支付 ALI_WEB 支付宝网页支付 ALI_WAP: 支付宝移动网页支付 ALI_QRCODE 支付宝内嵌二维码支付 UN UN_APP 银联APP支付 UN_WEB 银联网页支付
bill_no - (选填) 商户订单号, 32个字符内,数字和/或字母组合,确保在商户系统中唯一
start_time - (选填) 起始时间, 毫秒时间戳, 13位
end_time - (选填) 结束时间, 毫秒时间戳, 13位
skip - (选填) 查询起始位置 默认为0。设置为10,表示忽略满足条件的前10条数据
limit - (选填) 查询的条数, 默认为10,最大为50。设置为10,表示只查询满足条件的10条数据
返回:
BCQueryResult

startQueryRefund

public static BCQueryResult startQueryRefund(BCEumeration.PAY_CHANNEL channel,
                                             String bill_no,
                                             String refund_no,
                                             Long start_time,
                                             Long end_time,
                                             Integer skip,
                                             Integer limit)
参数:
channel - (必填)渠道类型, 根据不同场景选择不同的支付方式,包含: WX WX_APP 微信手机APP支付 WX_NATIVE 微信公众号二维码支付 WX_JSAPI 微信公众号支付 ALI ALI_APP 支付宝APP支付 ALI_WEB 支付宝网页支付 ALI_WAP: 支付宝移动网页支付 ALI_QRCODE 支付宝内嵌二维码支付 UN UN_APP 银联APP支付 UN_WEB 银联网页支付
refund_no - (DIRECT_REFUND和PRE_REFUND时必填)退款金额, 只能为整数,单位为分,例如1
buyer_id - (必填)消费者ID, 消费者在商户系统内的唯一标识, 32个字节以内
start_time - (选填) 起始时间, 毫秒时间戳, 13位
end_time - (选填) 结束时间, 毫秒时间戳, 13位
skip - (选填) 查询起始位置 默认为0。设置为10,表示忽略满足条件的前10条数据
limit - (选填) 查询的条数, 默认为10,最大为50。设置为10,表示只查询满足条件的10条数据
返回:
BCQueryResult

startWeChatRefundStatusQuery

public static BCQueryStatusResult startWeChatRefundStatusQuery(String refund_no)
参数:
refund_no - (必填)商户退款单号, 格式为:退款日期(8位) + 流水号(3~24 位)。不可重复,且退款日期必须是当天日期。流水号可以接受数字或英文字符,建议使用数字,但不可接受“000”。
返回:
BCQueryStatusResult

verifySign

public static boolean verifySign(String sign,
                                 String timestamp)
参数:
sign - Webhook提供的签名
timestamp - Webhook提供的timestamp,注意是String格式
返回:
签名是否正确


Copyright © 2015. All rights reserved.