PHP 7.4.33
Preview: VisaCheckoutCard.php Size: 5.00 KB
/home/godevadmin/www/admin/braintree/final/braintree/lib/Braintree/VisaCheckoutCard.php

<?php
namespace Braintree;

/**
 * Braintree VisaCheckoutCard module
 * Creates and manages Braintree VisaCheckoutCards
 *
 * <b>== More information ==</b>
 *
 * For more detailed information on CreditCard verifications, see {@link http://www.braintreepayments.com/gateway/credit-card-verification-api http://www.braintreepaymentsolutions.com/gateway/credit-card-verification-api}
 *
 * @package    Braintree
 * @category   Resources
 *
 * @property-read string $billingAddress
 * @property-read string $bin
 * @property-read string $callId
 * @property-read string $cardType
 * @property-read string $cardholderName
 * @property-read string $commercial
 * @property-read string $countryOfIssuance
 * @property-read string $createdAt
 * @property-read string $customerId
 * @property-read string $customerLocation
 * @property-read string $debit
 * @property-read string $default
 * @property-read string $durbinRegulated
 * @property-read string $expirationDate
 * @property-read string $expirationMonth
 * @property-read string $expirationYear
 * @property-read string $expired
 * @property-read string $healthcare
 * @property-read string $imageUrl
 * @property-read string $issuingBank
 * @property-read string $last4
 * @property-read string $maskedNumber
 * @property-read string $payroll
 * @property-read string $prepaid
 * @property-read string $productId
 * @property-read string $subscriptions
 * @property-read string $token
 * @property-read string $uniqueNumberIdentifier
 * @property-read string $updatedAt
 */
class VisaCheckoutCard extends Base
{
    /* instance methods */
    /**
     * returns false if default is null or false
     *
     * @return boolean
     */
    public function isDefault()
    {
        return $this->default;
    }

    /**
     * checks whether the card is expired based on the current date
     *
     * @return boolean
     */
    public function isExpired()
    {
        return $this->expired;
    }

    /**
     * sets instance properties from an array of values
     *
     * @access protected
     * @param array $creditCardAttribs array of creditcard data
     * @return void
     */
    protected function _initialize($creditCardAttribs)
    {
        // set the attributes
        $this->_attributes = $creditCardAttribs;

        // map each address into its own object
        $billingAddress = isset($creditCardAttribs['billingAddress']) ?
            Address::factory($creditCardAttribs['billingAddress']) :
            null;

        $subscriptionArray = [];
        if (isset($creditCardAttribs['subscriptions'])) {
            foreach ($creditCardAttribs['subscriptions'] AS $subscription) {
                $subscriptionArray[] = Subscription::factory($subscription);
            }
        }

        $this->_set('subscriptions', $subscriptionArray);
        $this->_set('billingAddress', $billingAddress);
        $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear);
        $this->_set('maskedNumber', $this->bin . '******' . $this->last4);

        if(isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) {
            $verifications = $creditCardAttribs['verifications'];
            usort($verifications, [$this, '_compareCreatedAtOnVerifications']);

            $this->_set('verification', CreditCardVerification::factory($verifications[0]));
        }
    }

    private function _compareCreatedAtOnVerifications($verificationAttrib1, $verificationAttrib2)
    {
        return ($verificationAttrib2['createdAt'] < $verificationAttrib1['createdAt']) ? -1 : 1;
    }

    /**
     * returns false if comparing object is not a VisaCheckoutCard,
     * or is a VisaCheckoutCard with a different id
     *
     * @param object $otherVisaCheckoutCard customer to compare against
     * @return boolean
     */
    public function isEqual($otherVisaCheckoutCard)
    {
        return !($otherVisaCheckoutCard instanceof self) ? false : $this->token === $otherVisaCheckoutCard->token;
    }

    /**
     * create a printable representation of the object as:
     * ClassName[property=value, property=value]
     * @return string
     */
    public function  __toString()
    {
        return __CLASS__ . '[' .
                Util::attributesToString($this->_attributes) .']';
    }

    /**
     *  factory method: returns an instance of VisaCheckoutCard
     *  to the requesting method, with populated properties
     *
     * @ignore
     * @return VisaCheckoutCard
     */
    public static function factory($attributes)
    {
        $defaultAttributes = [
            'bin' => '',
            'expirationMonth'    => '',
            'expirationYear'    => '',
            'last4'  => '',
        ];

        $instance = new self();
        $instance->_initialize(array_merge($defaultAttributes, $attributes));
        return $instance;
    }
}
class_alias('Braintree\VisaCheckoutCard', 'Braintree_VisaCheckoutCard');

Directory Contents

Dirs: 9 × Files: 97

Name Size Perms Modified Actions
Dispute DIR
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
Error DIR
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
Exception DIR
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
Result DIR
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
Test DIR
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
Xml DIR
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.06 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.37 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
579 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1005 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
4.04 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
9.17 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.28 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.59 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.73 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.63 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.17 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
3.38 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.77 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
3.40 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
16.01 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
818 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
813 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
4.28 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
9.71 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
15.33 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.34 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.32 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.52 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
12.78 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
20.17 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.64 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
134 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.62 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.45 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
693 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
462 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
775 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.53 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
259 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.72 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
244 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
696 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
3.93 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
6.66 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.44 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.40 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.93 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.84 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
431 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
432 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
4.36 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
988 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.17 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
5.80 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.34 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
553 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
946 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.01 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
776 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
3.95 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
755 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.59 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
691 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
430 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
950 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
671 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.00 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
11.90 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.30 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.58 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.70 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
5.22 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.33 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
854 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
822 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
3.49 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
655 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.11 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.88 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
486 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
4.00 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
7.14 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.60 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.46 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
269 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
690 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
20.21 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
17.71 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
7.79 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
3.08 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
9.06 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.59 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.46 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.94 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
14.89 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
1.95 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
625 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
5.00 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
4.34 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
2.27 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
14.69 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
697 B lrwxrwxr-x 2023-11-07 19:59:44
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).