12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- /**
- * PaywayConst.php UTF-8
- * 支付方式常量
- *
- * @date : 2018/4/28 16:28
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : wuyonghong <wyh@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace huolib\constant;
- class PaywayConst {
- CONST PAYWAY_ALIPAY = 'alipay'; //官方支付宝
- CONST PAYWAY_WXPAY = 'wxpay'; //微信支付
- CONST PAYWAY_SHENGPAY = 'shengpay'; //盛付通支付
- CONST PAYWAY_PTBPAY = 'ptbpay'; //平台币支付
- CONST PAYWAY_GAMEPAY = 'gamepay'; //游戏币支付
- CONST PAYWAY_WXPAYQR = 'wxpayqr'; //微信扫码支付
- CONST PAYWAY_WXPAYH5 = 'wxpayh5'; //微信H5
- CONST PAYWAY_WXPAYJS = 'wxpayjs'; //微信内支付
- CONST PAYWAY_WXPAYMP = 'wxpaymp'; //微信小程序支付
- CONST PAYWAY_ALIPAYQR = 'alipayqr'; //支付宝扫码
- CONST PAYWAY_ALIPAYH5 = 'alipayh5'; //支付宝H5
- CONST PAYWAY_BALANCE = 'balance'; //钱包余额支付
- CONST PAYWAY_APPLE = 'applepay'; /* 苹果支付 */
- CONST PAYWAY_APPLE_TEST = 'applepaytest'; /* 苹果沙盒支付 */
- CONST PAYWAY_BANK = 'bank'; /* 银行卡转账 */
- CONST PAYWAY_MPAY = 'mpay'; /* 米大师支付 */
- CONST PAYWAY_MPAY_TEST = 'mpaytest'; /* 米大师沙盒支付 */
- CONST PAYWAY_ALIPAYXY = 'alipayxy'; //支付宝协议支付
- /**
- * @param $type
- * @param bool $all
- *
- * @return array|bool|mixed
- */
- public static function getMsg($type, $all = false) {
- $_msg = array(
- self::PAYWAY_ALIPAY => '支付宝',
- self::PAYWAY_WXPAY => '微信',
- self::PAYWAY_SHENGPAY => '盛付通',
- self::PAYWAY_PTBPAY => '平台币',
- self::PAYWAY_GAMEPAY => '游戏币',
- self::PAYWAY_WXPAYQR => '微信扫码',
- self::PAYWAY_WXPAYH5 => '微信H5',
- self::PAYWAY_WXPAYJS => '微信内支付',
- self::PAYWAY_ALIPAYQR => '支付宝扫码',
- self::PAYWAY_ALIPAYH5 => '支付宝H5',
- self::PAYWAY_BALANCE => '余额支付',
- self::PAYWAY_APPLE => '苹果支付',
- self::PAYWAY_APPLE_TEST => '苹果沙盒支付',
- );
- if (true == $all) {
- return $_msg;
- }
- if (!isset($_msg[$type])) {
- return false;
- }
- return $_msg[$type];
- }
- /**
- * 获取所有支付
- *
- * @param bool $inc
- *
- * @return array
- */
- public static function getPayways($inc = false) {
- $_types = self::getMsg(null, true);
- if (true == $inc) {
- $_default = ["0" => "选择类型"];
- $_types = $_default + $_types;
- }
- return $_types;
- }
- }
|