doutan2111 2018-06-09 11:48
浏览 6

我们如何在PHP中的条带支付网关中应用未来的定期付款

I am working on subscription, i want to do subscription from future date, i did code for that, but i am not sure is it correct or not, here i have added my code, can anyone please look in this code and tell me i am correct or not, or you can also you give your thoughts on that, here is my subscription code.

$customer = \Stripe\Customer::create(array(
    'source' => $token,
    'description'=> 'Test Customer',
    'email' => 'NIKULTAKA@GMAIL.com',
    'plan' => $plan_id,
));
// Charge the order:
$dateTime = new DateTime('2018-07-10');
$date_timestamp = $dateTime->format('U');
$charge = \Stripe\Subscription::create(array(
    'customer' => $customer->id,
    "items" => array(
        array(
            "plan" => $plan_id,
        ),
    ),
    "billing_cycle_anchor"=> $date_timestamp
));
  • 写回答

1条回答 默认 最新

  • dpy87530 2018-06-09 16:35
    关注

    I'm not sure about your code, but I can give you some tips.

    Implement recurring payment can be harder than you expect.

    You can use other payment gateway, the recurly can make you life easier. Here you can see a client api in PHP for recurly

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?