File: /www/wwwroot/zhifu.ws.umchkw.com/mindex.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>build your link</title>
<style>
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
body,html{
height: 100%;
width:100%;
background:url("static/image/bg-2.jpg");
background-size: cover
}
.app-container {
border: 1px solid #eee;
padding: 65px 80px 30px;
box-shadow: 10px 10px 10px rgba(0,0,0,0.1);
background: #fff
}
div#app {
padding-top: 100px;
display: flex;
align-items: center;
justify-content: center;
padding-bottom:50px;
}
.title {
font-size: 16px;
font-weight: 600;
text-align: center;
margin-bottom: 20px;
}
.input-message-item {
margin-bottom: 10px;
}
label {
display: block;
font-size: 13px;
margin-bottom: 5px;
}
input {
height: 36px;
font-size: 14px;
padding: 8px 12px;
border: 1px solid #eee;
width: 100%;
border-radius: 5px;
}
div#submit {
background: rgb(61, 66, 78);
height: 40px;
line-height: 40px;
text-align: center;
border-radius: 5px;
color: #fff;
font-size: 14px;
margin-bottom: 20px;
margin-top: 20px;
cursor: pointer;
}
.text {
font-size: 12px;
text-align: center;
}
.img-container {
text-align: center;
position: relative;
top: -7px;
}
div#link {
max-width: 300px;
font-size: 12px;
word-break: break-all;
margin-bottom: 50px;
}
.link-title {
font-size: 15px;
font-weight: 600;
margin-bottom: 10px;
}
select#currency,select#language,select#PayCycle {
height: 36px;
font-size: 14px;
padding: 8px 12px;
border: 1px solid #eee;
width: 300px;
border-radius: 5px;
}
span#meidao {
display: block;
transform: translateX(-10px) scale(0.8) translateY(4px);
color: #666;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
word-break: keep-all;
}
.input-group {
display: flex;
margin-bottom: 25px;
}
input#link {
border-radius: 0;
}
button.btn {
height: 100%;
padding: 0 15px;
cursor: pointer;
word-break: keep-all;
}
.pay-type-container {
position: relative;
display: flex;
width: 100%;
justify-content: space-between;
padding: 20px 0 25px;
border: 1px solid #eee;
border-radius: 10px;
margin-bottom: 37px;
}
.pay-type-item {
display: flex;
flex: 1;
align-items: center;
justify-content: center;
}
input.radio_type {
height: 20px;
width: 20px;
color: red;
appearance: none;
border: none;
position: relative;
}
.pay-type-item label {
margin-bottom: 0;
margin-left: 5px;
}
input.radio_type:before {content: "";width: 20px;height: 20px;border: 1px solid #bebebe;position: absolute;left: 0;top: 0;border-radius: 50%;box-sizing: border-box;}
input.radio_type:checked:before {
background: url('static/image/gou.png');
background-size: 100% 100%;
border: 0;
}
.input-message-item.installment {
display: none;
}
.input-message-item.installmentQb {
display: none;
}
.input-message-item.otherparam {
display: flex;
}
label {
color: #1f242e;
}
input {
color: #5a5e66;
padding:8px 14px;
flex:1;
}
.input-message-item{
display:flex;
align-items: center;
margin-top: 20px;
}
label{
width:90px
}
input.radio_type {
flex: initial;
}
.radio_payment_type {
}
select#currency, select#language, select#PayCycle {
color: #5a5e66;
appearance: none;
background: #fff;
}
div#currency-container,#paycycle-container,#language-container {
position: relative;
}
div#currency-container:after,#paycycle-container:after,#language-container:after{
content: '';
display: block;
position: absolute;
height: 10px;
width: 10px;
right: 10px;
top: 9px;
transform: rotate(
-135deg
);
border-left: 1px solid #c9cfd6;
border-top: 1px solid #c9cfd6
}
div#currency-container{
opacity: 0;
}
.pay-type-item label {
width: auto;
}
.pay-type-container:after {content: '选择付款方式';position: absolute;bottom: 0;font-size: 12px;left: calc(50% - 40px);bottom: -8px;background: #fff;padding: 0 5px;}
input::-webkit-input-placeholder {
/* WebKit browsers */
color: #a7b0b9;
}
input:-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
color: #a7b0b9;
}
input::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #a7b0b9;
}
input:-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #a7b0b9;
}
@media(max-width:768px){
div#app{
margin-top: 80px;
padding-top:0
}
.app-container {
border: none;
padding: 0;
box-shadow: none;
width: 100%;
box-sizing: border-box;
padding: 0 15px;
}
body,html{
height: 100%;
width:100%;
background:none
}
div#currency-container{
flex:1;
}
select#currency, select#language, select#PayCycle{
flex:1;
width: 100%;
}
}
</style>
</head>
<body>
<form method="post" accept-charset="utf-8">
<div id="app">
<div class="app-container">
<div class="img-container"><img src="./LOGO.png" alt="" width="160"></div>
<div class="title">名言测试---生成付款链接</div>
<div class="pay-type-container">
<div class="pay-type-item">
<input class="radio_type" type="radio" name="payType" id="payFullBtn" value="0" checked="">
<label for="payFullBtn">信用卡付款</label>
</div>
<div class="pay-type-item">
<input class="radio_type" type="radio" name="payType" id="payQbBtn" value="2" disabled="true" alt="暂不支持">
<label for="payQbBtn">钱包付款 </label>
</div>
</div>
<div class="input-message-item installmentQb">
<label for="paymentMethod">付款方式 </label>
<input class="radio_payment_type" type="radio" id="paymentMethod_ALIPAY_HK" name="paymentMethod" value="ALIPAY_HK">
<label for="paymentMethod_ALIPAY_HK" class="borders" data-walletbrand="ALIPAY_HK">
<img src="/image/AlipayHK.svg" style="margin:0 auto;width:80px" alt="">
</label>
<input class="radio_payment_type" type="radio" id="paymentMethod_DANA" name="paymentMethod" value="DANA">
<label for="paymentMethod_DANA" class="borders " data-walletbrand="DANA">
<img src="/image/DANA.svg" style="margin:0 auto;width:80px" alt="">
</label>
<input class="radio_payment_type" type="radio" id="paymentMethod_GCASH" name="paymentMethod" value="GCASH">
<label for="paymentMethod_GCASH" class="borders " data-walletbrand="GCASH">
<img src="/image/GCash.svg" style="margin:0 auto;width:80px" alt="">
</label>
<input class="radio_payment_type" type="radio" id="paymentMethod_KAKAOPAY" name="paymentMethod" value="KAKAOPAY">
<label for="paymentMethod_KAKAOPAY" class="borders " data-walletbrand="KAKAOPAY">
<img src="/image/KakaoPay.svg" style="margin:0 auto;width:80px" alt="">
</label>
<input class="radio_payment_type" type="radio" id="paymentMethod_TNG" name="paymentMethod" value="TNG">
<label for="paymentMethod_TNG" class="borders " data-walletbrand="TNG">
<img src="/image/TNG.svg" style="margin:0 auto;width:80px" alt="">
</label>
<input class="radio_payment_type" type="radio" id="paymentMethod_ALIPAY_CN" name="paymentMethod" value="ALIPAY_CN">
<label for="paymentMethod_ALIPAY_CN" class="borders " data-walletbrand="ALIPAY_CN">
<img src="/image/ALIPAY_CN.svg" style="margin:0 auto;width:80px" alt="">
</label>
<input class="radio_payment_type" type="radio" id="paymentMethod_RABBIT_LINE_PAY" name="paymentMethod" value="RABBIT_LINE_PAY">
<label for="paymentMethod_RABBIT_LINE_PAY" class="borders " data-walletbrand="RABBIT_LINE_PAY">
<img src="/image/RABBIT_LINE_PAY.svg" style="margin:0 auto;width:80px" alt="">
</label>
</div>
<div class="input-message-item">
<label for="name">产品名称</label>
<input id="name" type="text" name="name" placeholder="请输入产品名称" value="<?php echo $name;?>" required>
</div>
<div class="input-message-item">
<label for="price">货币</label>
<div id="currency-container" style="opacity: 1;">
<select id="currency" name="currency"><option value="TWD">新台币 - TWD </option><option value="USD">美元 - USD </option><option value="CAD">加拿大元 - CAD </option><option value="GBP">英镑 - GBP </option><option value="EUR">欧元 - EUR </option><option value="NGN">尼日利亚奈拉 - NGN </option><option value="KRW">韩元 - KRW </option><option value="IDR">印尼盾 - IDR </option><option value="NZD">新西兰币 - NZD </option><option value="AUD">澳大利亚币 - AUD </option><option value="JPY">日元 - JPY </option><option value="MOP">澳门元 - MOP </option><option value="PHP">菲律宾比索 - PHP </option><option value="VND">越南盾 - VND </option><option value="THB">泰铢 - THB </option><option value="SGD">新加坡元 - SGD </option><option value="HKD">港元 - HKD </option><option value="MYR">马来西亚林吉特 - MYR </option><option value="CNY">人民币 - CNY </option></select></div>
</div>
<div class="input-message-item">
<label for="price"><span class="total-value">总价</span><span id="meidao"></span></label>
<input id="price" type="number" placeholder="请输入总价" name="unit_amount" required>
</div>
<!--<div class="input-message-item">-->
<!--<label for="name">公司名</label>-->
<!--<input readonly="readonly" id="companyName" type="text" placeholder="请输入公司名称">-->
<!--</div>-->
<!--<div class="input-message-item">-->
<!--<label for="orderCode">订单号</label>-->
<!--<input id="orderCode" type="text" placeholder="请输入订单号">-->
<!--</div>-->
<div class="input-message-item otherparam" id="language-container">
<label for="language">支付界面语言</label>
<select name="locale" id="language">
<option value="zh-TW">繁体中文</option>
<option value="zh">简体中文</option>
<option value="en">English</option>
<option value="ja">日文</option>
</select>
</div>
<div class="input-message-item">
<label for="callbackUrl">回调网址</label>
<input id="callbackUrl" type="text" name="success_url" placeholder="请输入回调网址" value="http://www.dfhgrf.top/">
</div>
<input type="submit" name="" id="submit" value="生成付款链接" style="background:#5a5e66;color:#fff;margin-bottom:8px"/>
<div class="link-title">付款链接</div>
</form>
<?php
if($_POST){
$locale=$_POST['locale'];
$name=$_POST['name'];
$currency=$_POST['currency'];
$unit_amount=$_POST['unit_amount'];
$success_url=$_POST['success_url'];
require 'vendor/autoload.php';
// $stripe = new \Stripe\StripeClient('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');
$stripe = new \Stripe\StripeClient('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');
$checkout_session = $stripe->checkout->sessions->create([
// 'shipping_address_collection' => ['allowed_countries' => ['US', 'CA']],//指定配送地区美国澳大利亚
'shipping_address_collection' => ['allowed_countries' => ['AC','AD','AE','AF','AG','AI','AL','AM','AO','AQ','AR','AT','AU','AW','AX','AZ','BA','BB','BD','BE','BF','BG','BH','BI','BJ','BL','BM','BN','BO','BQ','BR','BS','BT','BV','BW','BY','BZ','CA','CD','CF','CG','CH','CI','CK','CL','CM','CN','CO','CR','CV','CW','CY','CZ','DE','DJ','DK','DM','DO','DZ','EC','EE','EG','EH','ER','ES','ET','FI','FJ','FK','FO','FR','GA','GB','GD','GE','GF','GG','GH','GI','GL','GM','GN','GP','GQ','GR','GS','GT','GU','GW','GY','HK','HN','HR','HT','HU','ID','IE','IL','IM','IN','IO','IQ','IS','IT','JE','JM','JO','JP','KE','KG','KH','KI','KM','KN','KR','KW','KY','KZ','LA','LB','LC','LI','LK','LR','LS','LT','LU','LV','LY','MA','MC','MD','ME','MF','MG','MK','ML','MM','MN','MO','MQ','MR','MS','MT','MU','MV','MW','MX','MY','MZ','NA','NC','NE','NG','NI','NL','NO','NP','NR','NU','NZ','OM','PA','PE','PF','PG','PH','PK','PL','PM','PN','PR','PS','PT','PY','QA','RE','RO','RS','RU','RW','SA','SB','SC','SE','SG','SH','SI','SJ','SK','SL','SM','SN','SO','SR','SS','ST','SV','SX','SZ','TA','TC','TD','TF','TG','TH','TJ','TK','TL','TM','TN','TO','TR','TT','TV','TW','TZ','UA','UG','US','UY','UZ','VA','VC','VE','VG','VN','VU','WF','WS','XK','YE']],
'locale' => $locale,//语言 https://stripe.com/docs/api/checkout/sessions/object
/***
'custom_text' => [
'shipping_address' => [
'message' => '111111111111',//地址说明
],
'submit' => ['message' => '222222'],//支付按钮上面提示文字
],
***/
'line_items' => [[
'price_data' => [
'currency' => $currency,
// 'currency' => 'cad',
'product_data' => [
'name' => $name,
],
'unit_amount' => $unit_amount*100,//价格800代表8刀
],
'quantity' => 1,
]],
'mode' => 'payment',
/*** 收集手机号码***/
'phone_number_collection' => [
'enabled' => true,
],
'allow_promotion_codes' => true, //促销码
'success_url' => $success_url,
'cancel_url' => 'http://ws.umchkw.com/cancel',
]);
// header("HTTP/1.1 303 See Other");
// header("Location: " . $checkout_session->url);//跳转支付链接
echo '
<div class="input-group">
<input id="text-wx" type="text" value="'.$checkout_session->url.'" readonly="">
<span class="input-group-button">
<button class="btn" type="button" data-clipboard-demo="" data-clipboard-target="#link" onclick="copyArticle()">copy</button>
</span>
</div>
';
}
?>
<div class="text">Powered by mingyan</div>
</div>
</div>
</body>
</html>
<div class="lll" id="animationTipBox">
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
body,img,p,h1.dl,ul,li{padding:0px;margin:0px;}
body{max-width:640px;margin:0 auto}
.img img{width:100%}
a{text-decoration:none}
.ddd{background-color:#f13f40;height:35px;line-height:35px;text-align:center;color:#fff;font-size:16px;border-radius:50px;width:80%;margin-left:10%;margin-bottom:20px;margin-top:10px}
.dddd{background-color:#1aad19;height:35px;line-height:35px;text-align:center;color:#fff;font-size:16px;border-radius:50px;width:80%;margin-left:10%;margin-bottom:25px;}
.www{width:50%;margin-left:25%;margin-top:0px}
.www img{width:100%}
.zzz{font-size:18px;font-weight:700;color:#333;text-align:center;line-height:28px}
#MIP-LLIGTBOX-MASK {
background: rgba(0,0,0,.4);
}
#MIP-LLIGTBOX-MASK {
position: fixed !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
background-image: none !important;
background: rgba(0,0,0,0.5);
z-index: 10000 !important;
display: block;
}
.tc{width:90%;left:5%;background:#fff;border-radius:10px;position:fixed;z-index:9999999;top:20%;text-align:center}
.tca{width:50px;height:50px;margin:20px auto 12px;}
.tca img{width:100%}
.title {
color: #333;
font-size: 18px;
font-weight: 700;
line-height:18px;
}
.title2{color:#333;font-size:15px;text-align:center;line-height:22px;margin-top:16px}
.button {
background-color: #1aad19;
border-radius: .25rem;
width: 9rem;
height: 2.75rem;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-top: .9375rem;
color:#fff;margin:20px auto;
}
.lll{display:none}
</style>
<div id="MIP-LLIGTBOX-MASK"></div>
<div class="tc"><br>
<!--<div class="tca"><img src="images/g.png"></div>-->
<div class="title">复制成功</div>
<div on="click:wechat-lightbox42195679.close" class="button qd"><span>知道了</span></div>
</div>
</div>
<span id="text-wx" style="opacity:0">fctgg789</span>
<script>
function copyArticle(event) {
var range = document.createRange();
range.selectNode(document.getElementById('text-wx'));
var selection = window.getSelection();
if (selection.rangeCount > 0) selection.removeAllRanges();
selection.addRange(range);
document.execCommand('copy');
$('#animationTipBox').show();
fbq('track', 'Contact');
}
$('.qd').on("click", function() {
$('#animationTipBox').hide();
})
</script>