• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

PayPal/Stripe/Square轮询收单系统 stripe paymentlink支付模式

武飞扬头像
码农运营
帮助1

stripe paymentlink支付模式,

他的模式是最新的,所有需要下载最新的sdk插件,通过composer安装后就可以按照以下步骤就使用了

  1.  
    function Stripepaymentlink(){
  2.  
    require 'vendor/autoload.php';
  3.  
    $stripe = new \Stripe\StripeClient($privateKey);
  4.  
     
  5.  
    $productid = $stripe->products->create([
  6.  
    'name' => 'product name',
  7.  
    ]);
  8.  
     
  9.  
    $price = $stripe->prices->create(
  10.  
    ['currency' => $currency, 'unit_amount' => $amount*100, 'product' => $productid->id]
  11.  
    );
  12.  
     
  13.  
    $checkout = $stripe->paymentLinks->create(
  14.  
    ['line_items' => [['price' =>$price->id, 'quantity' => 1]],
  15.  
    'after_completion' => [
  16.  
    'type' => 'redirect',
  17.  
    'redirect' => ['url' => $success_uri],
  18.  
    ],
  19.  
     
  20.  
    ]
  21.  
    );
  22.  
     
  23.  
     
  24.  
     
  25.  
     
  26.  
    if(!empty($checkout)){
  27.  
     
  28.  
     
  29.  
    echo "<script>window.location.href='https://blog.csdn.net/u012195456/article/details/127846271".$checkout->url."';</script>";
  30.  
     
  31.  
     
  32.  
    }
  33.  
    }
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgffgcg
系列文章
更多 icon
同类精品
更多 icon
继续加载