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

(开头部分) 2KB

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

<?php

namespace Braintree;

use InvalidArgumentException;

/**
 * Braintree UsBankAccountGateway module
 *
 * Manages Braintree UsBankAccounts
 */
class UsBankAccountGateway
{
    private $_gateway;
    private $_config;
    private $_http;

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


    /**
     * find a usBankAccount by token
     *
     * @param string $token paypal accountunique id
     *
     * @throws Exception\NotFound
     *
     * @return UsBankAccount
     */
    public function find($token)
    {
        try {
            $path = $this->_config->merchantPath() . '/payment_methods/us_bank_account/' . $token;
            $response = $this->_http->get($path);
            return UsBankAccount::factory($response['usBankAccount']);
        } catch (Exception\NotFound $e) {
            throw new Exception\NotFound(
                'US bank account with token ' . $token . ' not found'
            );
        }
    }

    /**
     * create a new sale for the current UsBank account
     *
     * @param string $token              payment method identifier
     * @param array  $transactionAttribs request parameters
     *
     * @see Transaction::sale()
     *
     * @return Result\Successful|Result\Error
     */
    public function sale($token, $transactionAttribs)
后面还有 39 行代码,购买后查看完整代码

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

AI 解读

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

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