duanfengshang1088 2019-04-27 23:23
浏览 73

我想检查Git-Hub代码中'Checkout \ Session :: create()方法'的'success_url'参数的处理

The following PHP code works fine.

   $checkoutSession = \Stripe\Checkout\Session::create([
    'customer_email' => 'customer@example.com',
    'success_url' => 'https://xxxx/thanks.php',

The description is also described in the document.

The URL the customer will be directed to after the payment or subscription creation is successful.


But I want to see in PHP code how the process to be redirected to 'success_url' is implemented.

stripe-php/lib/Checkout/Session.php

<?php
namespace Stripe\Checkout;
/**
 * Class Session
 *
 * Omission
 *
 * @property string $success_url
 *
 * @package Stripe
 */
class Session extends \Stripe\ApiResource
{
    const OBJECT_NAME = "checkout.session";
    use \Stripe\ApiOperations\Create;
    use \Stripe\ApiOperations\Retrieve;
}

stripe-php/lib/ApiOperations/Create.php

trait Create
{
    /**
     * @param array|null $params
     * @param array|string|null $options
     *
     * @return \Stripe\ApiResource The created resource.
     */
    public static function create($params = null, $options = null)
    {
        self::_validateParams($params);
        $url = static::classUrl();
        list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
        $obj->setLastResponse($response);
        return $obj;
    }
}

Where is the process for 'success_url' implemented?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 关于#python#的问题:自动化测试