个人使用微信支付
微信小程序开发交流qq群 173683895
承接微信小程序开发。扫码加微信。
首先在PAYJS申请到商户号和密钥,
然后实现源码如下:
<!DOCTYPE html>
<html lang="zh"><head><meta charset="UTF-8"><title>Title</title><script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.js"></script><style type="text/css">button {width: 150px;height: 50px;bottom: 20px;left: 40px;}</style></head><body><button class="btn_2" id="btn" />支付</button><script type="text/javascript">$("#btn").click(function() {var out_trade_no = new Date().getTime()+'aaaaaaa';$.ajax({type: "GET", dataType: "json", url: "http://www.wenjuanceshi.online/index.php?out_trade_no="+out_trade_no, //url
// url: "http://localhost:8010/index.php", //urlsuccess: function(res) {console.log('1111:',res);},error: function(e) {console.log('2222:',e);var sign =e.responseText.replace(/\s+/g,"");pay(sign,out_trade_no)//密钥}});});//¬ify_url=http://www.wenjuanceshi.online/notify_url.html&callback_url=http://www.wenjuanceshi.online/callback_url.htmlfunction pay(sign,out_trade_no){console.log('sign:',sign)window.location.href="https://payjs.cn/api/cashier?mchid=1515476391&total_fee=10&out_trade_no="+out_trade_no+"&sign="+sign;}</script></body></html>
<?phpheader("Content-Type:text/html;charset=utf8"); header("Access-Control-Allow-Origin: *"); //解决跨域 header('Access-Control-Allow-Methods:GET');// 响应类型 header('Access-Control-Allow-Headers:*'); // 响应头设置 @mysql_query("SET NAMES utf8");//解决中文乱码问题 //error_reporting(0); $out_trade_no = $_GET['out_trade_no'];$mchid = '你的商户号';$key = '你的密钥';$data =['mchid'=>$mchid,'body'=>'我是一个测试订单标题','total_fee'=>1,'out_trade_no'=>$out_trade_no,];$data['sign']=sign($data,$key);$url='https://payjs.cn/api/cashier?'.http_build_query($data);echo $url;function sign($data,$key){array_filter($data);ksort($data);return strtoupper(md5(urldecode(http_build_query($data).'&key='.$key)));}?>
相关文章:

构建node.js基础镜像_我如何使用Node.js构建工作抓取网络应用
构建node.js基础镜像by Oyetoke Tobi Emmanuel由Oyetoke Tobi Emmanuel 我如何使用Node.js构建工作抓取网络应用 (How I built a job scraping web app using Node.js) Scraping jobs from the web has now become easier thanks to Indreed.现在,借助Indreed&…

Robotium测试报告的生成方法(上)
7.1 使用junit-report生成报告 这个是参考网上的:http://www.xuebuyuan.com/2148574.html,经我个人验证是可行的方法,网上写的挺详细的,不过有些不太清楚明白的地方,鉴于网上说的有点迷茫,所以下面我再细化…

Python之向日志输出中添加上下文信息
除了传递给日志记录函数的参数(如msg)外,有时候我们还想在日志输出中包含一些额外的上下文信息。比如,在一个网络应用中,可能希望在日志中记录客户端的特定信息,如:远程客户端的IP地址和用户名。…

小程序点击图片自动播放视频,停止上一个视频播放
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 通过列表的点击事件自动播放列表对应的视频,同时停止上一个视频的播放 源码: <view><view classvv wx:for{{vedio_data}} wx:key><view classblock stylemargin…

hitchhiker部署_Hitchhiker的React Router v4指南:无限远的递归路径!
hitchhiker部署Welcome to the third part of the Hitchhiker’s Guide to React Router v4. In this article we’re going to focus on recursive paths. If you’ve missed the first two parts, you can find part 1 here and part 2 here.欢迎阅读《 Hitchhiker React Rou…

smbpasswd 和 pdbedit 的区别
smbpasswd 和 pdbedit 的区别 以前我们在windows上共享文件的话,只需右击要共享的文件夹然后选择共享相关的选项设置即可。然而如何实现windows和linux的文件共享呢?这就涉及到了samba服务了,这个软件配置起来也不难,使用也非常简…

DB天气app冲刺二阶段第十一天(完结)
今天最后一天冲刺了,明天就不再冲刺了。。已经把所有的技术的问题还有设计的问题都弄好了吧应该说 至少目前来说是的。因为有的实现不了的或者需要耗费时间的已经果断舍弃了,然后需要完善的也都基本完善了。 现在还需要做的就是素材的收集整理。需要抽半…

如何超越console.log并充分利用浏览器的调试控制台
by Gilad Dayagi通过吉拉德达亚吉 The console object is a very useful feature of browsers that has been around for many years. It provides access to the browser’s debugging console.Most web developers know how to print messages to the console using console…

区域设置 ID (LCID) 表, 及获取方法
区域设置 ID (LCID) 表, 及获取方法 中国的区域设置 ID 是 2052, 如果经常打开微软软件的安装目录应该经常见到.获取很简单, 有现成的 API 函数: GetThreadLocale.beginShowMessage(IntToStr(GetThreadLocale)); //2052 end; 区域设置 ID (LCID) 表区域设置描述简写十六进制值十…

E201700525-hm
skeleton n. 骨骼; (建筑物等的) 骨架; 梗概; 骨瘦如柴的人(或动物);adj. 骨骼的; 骨瘦如柴的; 概略的; 基本的; cloud n. 云; 云状物; invoke vt. 乞灵,祈求; 提出或授引…以支持或证明; 召鬼; 借助;render …

php不显示报错
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 error_reporting(E_ALL & ~E_NOTICE);

致谢 开源开发者的贡献_对开源做出的贡献如何使我成为更好的开发人员,以及如何做到这一点...
致谢 开源开发者的贡献by Luciano Strika通过卢西亚诺斯特里卡(Luciano Strika) 对开源做出的贡献如何使我成为更好的开发人员,以及如何做到这一点 (How contributing to open source made me a better developer — and how you can do it, too) So you’ve been …

欲精一行,必先通十行
将前端开发和服务器端开发做一个比较,前端开发没有服务器端开发“深”,服务器端开发没有前端开发“广”。经常听到做前端的同行抱怨需要学的东西太 多,东学一点西学一点,什么都会,但也什么都不精。很直接的结果就是沦为…

LeetCode 228: Summary Ranges
Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. 代码要求对数组中的元素进行分段。 首先给出字符串格式化函数,假设be…

JQ+ajax 提交表单不跳转页面
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 代码 <div class"apply_box"><h1>合作申请</h1><div class"apply_l"><input type"text" maxlength"20" id"name" name&q…

node.js是开源的吗_为开源做贡献并不难:我为Node.js项目做贡献的旅程
node.js是开源的吗As a developer, you should consider contributing to open source software. Many of your potential employers will look favorably on these contributions.作为开发人员,您应该考虑为开源软件做贡献。 您的许多潜在雇主将对这些供款看好。 …

超级简单的jquery轮播图demo
<!DOCTYPE html> <html><head><meta charset"UTF-8"><title>轮播图demo</title><script type"text/javascript" src"js/jquery-3.2.1.slim.js" ></script><link rel"stylesheet" …

Mysql 操作技巧
复制表结构 表数据Mysql> create tables t2 like t1;Mysql> insert into t2 select * from t1; mysql 索引a、Alert Table 用来创建普通索引、Unique 唯一索引 (当前列数值不可重复) 或 Primary Key 主键索引Mysql> alter table table_name add index index_name(col…

JS实现复制到剪切板效果
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 代码: <!DOCTYPE html> <html lang"en"><head><meta http-equiv"Content-Type" content"text/html; charsetutf-8" /><meta cha…

如何管理多个Python版本和虚拟环境
Addition January 2019: If you are coming back to this blog after upgrading to macOS Mojave please see this github issue for a solution to the common pyenv ‘zlib not available’ problem.此外,2019年1月:如果在升级到macOS Mojave之后又回到…

linux 下byte,char,unsigned char的区别
在linux中,对byte的定义为无符号char,而char默认为有符号char。 #ifndef BYTE #define BYTE unsigned char #endif以下ZZ百度知道: 在C中,默认的基础数据类型均为signed,现在我们以char为例,说明(signed) c…

词法作用域和动态作用域
JavaScript采用的是词法作用域 1.词法作用域 即函数定义时,即确定的作用域。js中的作用域链,在函数声明时候,就已经确定了,无论函数在何处调用,其作用域变量的查找都是按照定义是包含关系去查找。 2.动态作用域 变量的…

10-18 JS基础复习笔记
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 1.JS类型 Numbel String Boolean Symbol Null Undefined Object(Funtion,Array,Data,Regexp); 2.字符串转数字类型 "122" //122 var a 1 2; console.log(a) //3 3.null 和 u…

vue.js crud_如何使用VS Code和ADO.NET使用ASP.NET Core执行CRUD操作
vue.js crud介绍 (Introduction) In this article we are going to create a web application using ASP.NET Core MVC with the help of Visual Studio Code and ADO.NET. We will be creating a sample Employee Record Management System and performing CRUD operations on…
redis事物命令示例
命令示例: 1. 事务被正常执行:#在Shell命令行下执行Redis的客户端工具。/> redis-cli#在当前连接上启动一个新的事务。redis 127.0.0.1:6379>multiOK#执行事务中的第一条命令,从该命令的返回结果可以看出,该命令并没有立即执…

JS 函数 函数递归
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 重要:函数也是对象,你可以给它们添加属性或者更改它们的属性。 函数内部对象:arguments 解析:函数实际上是访问了函数体中一个名为 arguments 的内部对象…

swift设置启动图不现实_如何通过装饰房屋来开始在Swift中使用增强现实
swift设置启动图不现实by Ranadhir Dey由Ranadhir Dey 如何通过装饰房屋来开始在Swift中使用增强现实 (How to get started with augmented reality in Swift by decorating your home) If you’ve read my previous post, you already have a beautiful AR floor in your din…

可用于nodejs的SuperAgent(ajax API)
简单示例: import request from superagent;//引用声明 request.post(api).withCredentials()//跨域.end((err, res) > {if (res.ok) {const json JSON.parse(res.text);} else {console.log(获取失败);}}); 1、get 方式 当使用get请求传递查询字符串的时候&…

Java第四次实验
一、实验内容: 结对编程。运行TCP代码,结对进行,一人服务器,一人客户端;利用加解密代码包,编译运行代码,一人加密,一人解密; 集成代码,密后通过TCP发送。 二、…

JS 面向对象编程之原型(prototype)
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 function Person(first, last) {this.first first;this.last last; } Person.prototype.fullName function() {return this.first this.last; } Person.prototype.fullNameReversed function() {…