vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php

(开头部分) 2KB

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

<?php

namespace Braintree;

/**
 * Braintree PaymentMethodNonceGateway module
 */
class PaymentMethodNonceGateway
{
    private $_gateway;
    private $_config;
    private $_http;

    // phpcs:ignore PEAR.Commenting.FunctionComment.Missing
    public function __construct($gateway)
    {
        $this->_gateway = $gateway;
        $this->_config = $gateway->config;
        $this->_http = new Http($gateway->config);
    }

    /**
     * Create a payment method nonce from an existing payment method's token
     *
     * @param string     $token  the identifier of the payment method
     * @param mixed|null $params additional parameters to be included in the request
     *
     * @return PaymentMethodNonce|Error
     */
    public function create($token, $params = [])
    {
        $subPath = '/payment_methods/' . $token . '/nonces';
        $fullPath = $this->_config->merchantPath() . $subPath;
        $schema = [[
            'paymentMethodNonce' => [
                'merchantAccountId',
                'authenticationInsight',
            ['authenticationInsightOptions' => [
                    'amount',
                    'recurringCustomerConsent',
                    'recurringMaxAmount'
                ]
                ]]
        ]];
        Util::verifyKeys($schema, $params);
        $response = $this->_http->post($fullPath, $params);

        return new Result\Successful(
            PaymentMethodNonce::factory($response['paymentMethodNonce']),
            "paymentMethodNonce"
        );
    }

    /**
     * Find a Payment Method Nonce given the string value
     *
     * @param string $nonce to be found
     *
     * @throws NotFound
     *
后面还有 15 行代码,购买后查看完整代码

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

AI 解读

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

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