Skip to content

Instantly share code, notes, and snippets.

@payjscn
payjscn / payjs_check_demo.php
Created July 3, 2019 10:16
PAYJS 订单查询接口 PHP DEMO
<?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 July 15, 2021 10:05
PAYJS 小程序支付 DEMO 片段
// 本代码为演示碎片代码
// 需与文档中小程序章节结合使用 https://help.payjs.cn
// 跳转
// 为小程序的支付按钮绑定事件
bindPay: function() {
// 待传入的
wx.request({
url: '商户侧后端请求支付参数的网址',
@payjscn
payjscn / payjs_refund_demo_php.php
Last active April 9, 2019 19:20
PAYJS 退款接口 PHP DEMO
<?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 September 5, 2018 15:01
PAYJS 扫码支付接口 JAVA DEMO
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 September 5, 2018 14:54
PAYJS 扫码支付接口 Object C DEMO
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 July 12, 2024 01:12
PAYJS 扫码支付接口 C# DEMO
//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 September 5, 2018 14:47
PAYJS 扫码支付 DEMO Python
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 September 5, 2018 14:38
PAYJS 扫码 API DEMO CURL
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 April 8, 2019 04:09
PAYJS收银台模式DEMOO
<?php
$mchid = '**************'; // PAYJS 商户号
$key = '**************'; // 通信密钥
// 构造订单参数
$data = [
'mchid' => $mchid,
'body' => '我是一个测试订单标题',
'total_fee' => 1,
@payjscn
payjscn / index.html
Last active December 14, 2023 14:30
payjs前端发起jsapi支付的demo
<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>