HEX
Server: Apache
System: Linux efa57bbe-abb1-400d-2985-3b056fbc2701.secureserver.net 6.1.147-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 24 12:33:32 EDT 2025 x86_64
User: root (0)
PHP: 8.0.30.4
Disabled: NONE
Upload Files
File: //var/www/wp-content/mu-plugins/vendor/godaddy/mwc-core/src/Payments/Providers/PoyntProvider.php
<?php

namespace GoDaddy\WordPress\MWC\Core\Payments\Providers;

use Exception;
use GoDaddy\WordPress\MWC\Core\Features\Worldpay\Worldpay;
use GoDaddy\WordPress\MWC\Core\Payments\Poynt\Gateways\ApplePayGateway;
use GoDaddy\WordPress\MWC\Core\Payments\Poynt\Gateways\PaymentMethodsGateway;
use GoDaddy\WordPress\MWC\Core\Payments\Poynt\Gateways\TransactionsGateway;
use GoDaddy\WordPress\MWC\Payments\Gateways\AbstractGateway;
use GoDaddy\WordPress\MWC\Payments\Providers\AbstractProvider;
use GoDaddy\WordPress\MWC\Payments\Traits\HasPaymentMethodsTrait;
use GoDaddy\WordPress\MWC\Payments\Traits\HasTransactionsTrait;

/**
 * Poynt payment method provider.
 *
 * @since 2.10.0
 */
class PoyntProvider extends AbstractProvider
{
    use HasPaymentMethodsTrait;
    use HasTransactionsTrait;

    /** @var ApplePayGateway */
    private $applePayGateway;

    /** @var string provider label */
    protected $label;

    /** @var string provider name */
    protected $name = 'poynt';

    /**
     * @throws Exception
     */
    public function __construct()
    {
        // @TODO Apple Pay is not handled by a trait, but follows the pattern set by the other gateway traits here, should we update the handling to a trait of its own in the future {unfulvio 2021-11-23}
        $this->applePayGateway = ApplePayGateway::class;
        $this->paymentMethodsGateway = PaymentMethodsGateway::class;
        $this->transactionsGateway = TransactionsGateway::class;

        $this->label = Worldpay::shouldLoad() ? 'Credit / Debit' : 'GoDaddy Payments';
    }

    /**
     * Gets a new instance of the Apple Pay gateway.
     *
     * @return ApplePayGateway
     */
    public function applePay() : AbstractGateway
    {
        return new $this->applePayGateway();
    }
}