system/library/paypal/paypal.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * paypal.php
 *
 * @copyright 2019 damicms.com - All Rights Reserved
 * @link https://www.guangdawangluo.com
 * @author stiffer.chen <chenlin@damicms.com>
 * @created 2019-12-2019-12-02 11:17
 * @modified 2019-12-2019-12-02 11:17
 */

namespace Paypal;

class Paypal
{
    private static $singleton;
    private $registry;

    public function __construct()
    {
        $this->registry = \Registry::getSingleton();
    }

    public static function getSingleton()
    {
        if (!(self::$singleton instanceof self)) {
            self::$singleton = new self();
        }
        return self::$singleton;
    }

    public function __set($key, $value)
    {
        // TODO: Implement __set() method.
        $this->registry->set($key, $value);
    }

    public function __get($key)
    {
        // TODO: Implement __get() method.
        return $this->registry->get($key);
    }

    public function confirmExpress()
    {
        if ((!$this->cart->hasProducts() && empty($this->session->data['vouchers'])) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) {
            return [
                'redirect' => $redirect = $this->url->link('checkout/cart')
            ];
        }

        $order_info = model('checkout/order')->getOrder($this->session->data['order_id']);

        $max_amount = $this->cart->getTotal() * 1.5;
        $max_amount = $this->currency->format($max_amount, config('payment_pp_express_currency'), '', false);
        if ($this->cart->hasShipping()) {
            $shipping = 0;

            // PayPal requires some countries to use zone code (not name) to be sent in SHIPTOSTATE
            $ship_to_state_codes = array(
后面还有 73 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。