Skip to content

Instantly share code, notes, and snippets.

@payjscn
payjscn / payjs_check_demo.php
Created Jul 3, 2019
PAYJS 订单查询接口 PHP DEMO
View payjs_check_demo.php
<?php
class Payjs
{
private $url = 'https://payjs.cn/api/check';
private $key = ''; // 填写通信密钥
private $mchid = ''; // 特写商户号
public function __construct($payjs_order_id=null) {
$this->payjs_order_id = $payjs_order_id;
}
@payjscn
payjscn / payjs_wxa_demo.js
Last active Jun 5, 2020
PAYJS 小程序支付 DEMO 片段
View payjs_wxa_demo.js
// 本代码为演示碎片代码
// 需与文档中小程序章节结合使用 https://help.payjs.cn
// 跳转
// 为小程序的支付按钮绑定事件
bindPay: function() {
// 待传入的
wx.request({
url: '商户侧后端请求支付参数的网址',
@payjscn
payjscn / payjs_refund_demo_php.php
Last active Apr 9, 2019
PAYJS 退款接口 PHP DEMO
View payjs_refund_demo_php.php
<?php
class Payjs
{
private $url = 'https://payjs.cn/api/refund';
private $key = ''; // 填写通信密钥
private $mchid = ''; // 特写商户号
public function __construct($payjs_order_id=null) {
$this->payjs_order_id = $payjs_order_id;
}
@payjscn
payjscn / payjs_native_demo_java.java
Created Sep 5, 2018
PAYJS 扫码支付接口 JAVA DEMO
View payjs_native_demo_java.java
public static void main(String[] args) {
String host = "https://payjs.cn";
String path = "/api/native";
String method = "POST";
Map<String, String> headers = new HashMap<String, String>();
Map<String, String> querys = new HashMap<String, String>();
Map<String, String> bodys = new HashMap<String, String>();
bodys.put("mchid", "********");
bodys.put("total_fee", "********");
@payjscn
payjscn / payjs_native_demo_objectc.m
Created Sep 5, 2018
PAYJS 扫码支付接口 Object C DEMO
View payjs_native_demo_objectc.m
NSString *host = @"https://payjs.cn";
NSString *path = @"/api/native";
NSString *method = @"POST";
NSString *querys = @"";
NSString *url = [NSString stringWithFormat:@"%@%@%@", host, path , querys];
NSString *bodys = @"mchid=****&total_fee=12&out_trade_no=2134099892932&sign=******************";
//或者base64
//NSString *bodys = @"image=data:image/jpeg;base64,/9j/4A......";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString: url] cachePolicy:1 timeoutInterval: 5];
request.HTTPMethod = method;
@payjscn
payjscn / payjs_native_demo_c#.cs
Last active Apr 8, 2019
PAYJS 扫码支付接口 C# DEMO
View payjs_native_demo_c#.cs
//using System.IO;
//using System.Text;
//using System.Net;
//using System.Net.Security;
//using System.Security.Cryptography.X509Certificates;
private const String host = "https://payjs.cn";
private const String path = "/api/native";
private const String method = "POST";
@payjscn
payjscn / payjs_native_demo_python.py
Created Sep 5, 2018
PAYJS 扫码支付 DEMO Python
View payjs_native_demo_python.py
import urllib, urllib2, sys
import ssl
host = 'https://payjs.cn'
path = '/api/native'
method = 'POST'
bodys = {}
url = host + path
@payjscn
payjscn / payjs_native_demo_curl.sh
Created Sep 5, 2018
PAYJS 扫码 API DEMO CURL
View payjs_native_demo_curl.sh
curl https://api.stripe.com/v1/charges \
-d mchid=***** \
-d total_fee=999 \
-d out_trade_no=123412342134 \
-d body="订单标题" \
-d notify_url="https://www.baidu.com" \
-d sign=************
@payjscn
payjscn / payjs_jspay_demo.php
Last active Apr 8, 2019
PAYJS收银台模式DEMOO
View payjs_jspay_demo.php
<?php
$mchid = '**************'; // PAYJS 商户号
$key = '**************'; // 通信密钥
// 构造订单参数
$data = [
'mchid' => $mchid,
'body' => '我是一个测试订单标题',
'total_fee' => 1,
@payjscn
payjscn / index.html
Last active Apr 8, 2019
payjs前端发起jsapi支付的demo
View index.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="email=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
You can’t perform that action at this time.