Skip to content

Instantly share code, notes, and snippets.

$input = array(
"access_token" => 'token',
"message" => '文字',
'url' => '圖片網址,
'method' => 'photos'
);
<?php
$key = pack('H*', '5E8B6E1998F421204C6576544FE1A26B44FC775982D8CE2E'); //驗證參數
$iv = 'FOCASAPIFOCASAPI'; //iv=FOCASAPIFOCASAPI
$qrcodedata = 'TWQRP%3A%2F%2F%E6%98%9F%E4%B9%9D%E5%AE%A2%E5%92%96%E5%95%A1%2F158%2F01%2FV1%3FD1%3D12500%26D3%3DAVnVbcN9xxRv%26D10%3D901%26D11%3D00%2C00600611122233344400000001%3B01%2C00600611122233344400000001%3B04%2C00800899887766554400000001%26D12%3D20170630130000%26OprodNumber%3D%E6%8B%BF%E9%90%B5'; //url encode過的qrcode內容
$qrcodedatahex = bin2hex($qrcodedata);
$datalen = strlen($qrcodedata);
$datalenhex = str_pad(dechex($datalen), 4, '0', STR_PAD_LEFT); //qrcode加密資料長度2 bytes,所以 表示要補到4碼
//echo $datalenhex."\n";
$inputdatahex = $datalenhex . $qrcodedatahex;
array(8) {
["acqBank"]=>
string(3) "017"
["terminalId"]=>
string(8) "00010001"
["merchantId"]=>
string(15) "017849426450001"
["txnType"]=>
string(2) "01"
["orderNumber"]=>
<?php
namespace App\Service\Pay;
/**
* TaiwanPay
*/
class TaiwanPay
{
/**
<?php
namespace App\Schedule;
use \Medoo\Medoo as Medoo;
use Httpspace\Medoos as Medoos;
use Httpspace\Fastimage as FastImage;
use App\Model\Imgur;
class Wow
安裝 Google 代碼管理工具
請將以下程式碼複製並貼入您網站的每個網頁中。
請將這段程式碼放在網頁最上方的 <head> 中:
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-T34GB2L');</script>
<!-- End Google Tag Manager -->
using System;
using System.Text;
using System.Security.Cryptography;
using System.Web;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
<?php
$path = 'WebToAppReq';
//qrcode名稱
$qr_code_name = '公司名稱';
//交易金額
$d1 = '500000';
//訂單編號
$d2 = strtotime('now');
@httpspace
httpspace / 權限處理的方法
Created September 29, 2019 15:58
權限舉例
//角色權限表
$user_role = [
'1' => [
'name' => '管理員',
'permission' => [
'user_list', //可以看使用者列表
'user_edit', //可以編輯使用者
'user_delete', //可以刪除使用者
@httpspace
httpspace / install.sh
Created May 21, 2018 16:27 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`