小编Dre*_*ell的帖子

将SSL cURL请求从SSLv3更新为TLS ..?

由于最近在SSLv3中发现了漏洞,许多Web服务提供商(即PayPal,Facebook,Google)正在禁用该漏洞并希望我们使用TLS.我在弄清楚如何做到这一点时遇到了一些麻烦.

我目前正在使用以下函数来处理我的cURL请求.

function CURLRequest($Request = "", $APIName = "", $APIOperation = "", $PrintHeaders = false)
{
    $curl = curl_init();
            curl_setopt($curl, CURLOPT_VERBOSE, 1);
            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
            curl_setopt($curl, CURLOPT_TIMEOUT, 30);
            curl_setopt($curl, CURLOPT_URL, $this->EndPointURL);
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $Request);

    if($this->APIMode == 'Certificate')
    {
        curl_setopt($curl, CURLOPT_SSLCERT, $this->PathToCertKeyPEM);
    }

    $Response = curl_exec($curl);

    /*
     * If a cURL error occurs, output it for review.
     */
    if($this->Sandbox)
    {
        if(curl_error($curl))
        {
            echo curl_error($curl).'<br /><br />';  
        }
    }

    curl_close($curl);
    return $Response;   
}
Run Code Online (Sandbox Code Playgroud)

当我尝试点击PayPal的沙箱时,他们已经禁用了这个,我最终得到了一个cURL错误: 错误:14077410:SSL例程:SSL23_GET_SERVER_HELLO:sslv3警报握手失败 …

php ssl curl paypal

8
推荐指数
1
解决办法
3万
查看次数

如何修复 Git 子模块导致 404 未找到..?

我有一个PayPal PHP 类库的 GitHub 存储库,并且有一个使用该库构建的[一组演示套件的单独 GitHub 存储库][2]。

演示套件存储库添加了类库作为 Git 子模块,并且还添加了 Bootstrap 作为子模块。这是我的 .gitmodules 文件...

[submodule "vendor/angelleye/paypal-php-library"]
    path = vendor/angelleye/paypal-php-library
    url = https://github.com/angelleye/paypal-php-library.git
[submodule "vendor/twbs/bootstrap"]
    path = vendor/twbs/bootstrap
    url = https://github.com/twbs/bootstrap.git
Run Code Online (Sandbox Code Playgroud)

由于某种原因,PayPal 库子模块不再工作。当我查看演示套件存储库并浏览子模块时,它显示了指向特定提交的链接......

在此输入图像描述

不过,该提交似乎不再存在于存储库中,当我们单击该链接时,它会显示 GitHub 404 Not Found 页面。

目前不知道如何解决这个问题..?? 当我们运行时,git submodule update它会很好地引入 Bootstrap,但 PayPal 库由于链接/子模块损坏而失败。

不过,PayPal 库存储库仍然没问题,而且我本地的内容都与 GitHub 的内容相匹配,所以我不确定此时该怎么办。

任何有关如何修复子模块的信息将不胜感激。谢谢!

git github git-submodules

5
推荐指数
1
解决办法
3945
查看次数

添加动作链接到WordPress插件的问题?

我正在尝试添加一些动作链接到WordPress插件.我从以下开始.

class Angelleye_PayPal_WooCommerce
{
    public function __construct()
    {
        add_filter('plugin_action_links', array($this,'plugin_action_links'));
    }

    public function plugin_action_links($actions)
    {
        $custom_actions = array(
            'configure' => sprintf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=wc-settings&tab=checkout' ), __( 'Configure', 'paypal-for-woocommerce' ) ),
            'docs'      => sprintf( '<a href="%s" target="_blank">%s</a>', 'http://docs.angelleye.com/paypal-for-woocommerce/', __( 'Docs', 'paypal-for-woocommerce' ) ),
            'support'   => sprintf( '<a href="%s" target="_blank">%s</a>', 'http://www.angelleye.com/contact-us/', __( 'Support', 'paypal-for-woocommerce' ) ),
            'review'    => sprintf( '<a href="%s" target="_blank">%s</a>', 'http://wordpress.org/support/view/plugin-reviews/paypal-for-woocommerce', __( 'Write a Review', 'paypal-for-woocommerce' ) ),
        );

        // add the links to the front of the actions …
Run Code Online (Sandbox Code Playgroud)

wordpress plugins

4
推荐指数
1
解决办法
2262
查看次数

如何找到哪一个提交添加了一行代码..?

我真的不确定如何从这开始,但它似乎应该是可用的东西.

在一个项目中,我们有一行特定的代码:

if(!current_user_can('administrator'))
Run Code Online (Sandbox Code Playgroud)

我试图弄清楚如何添加该行以及它所属的问题/提交,但我似乎无法找到一种方法来做到这一点?

git github

4
推荐指数
1
解决办法
95
查看次数

更改WooCommerce购物车商品名称

目标是在商品名称传递到我们的付款网关时更改其名称,但将其保持原样显示在我们的产品页面上。

我已经在我的functions.php中尝试过此操作:

function change_item_name( $item_name, $item ) {
    $item_name = 'mydesiredproductname';
    return $item_name;
}
add_filter( 'woocommerce_order_item_name', 'change_item_name', 10, 1 );
Run Code Online (Sandbox Code Playgroud)

但这似乎对我没有用。我觉得我应该传递一个实际的商品ID或其他东西……我有点迷失了。

我在这里做错了什么的任何信息,将不胜感激。

php wordpress checkout cart woocommerce

3
推荐指数
1
解决办法
5921
查看次数

标签 统计

git ×2

github ×2

php ×2

wordpress ×2

cart ×1

checkout ×1

curl ×1

git-submodules ×1

paypal ×1

plugins ×1

ssl ×1

woocommerce ×1