invoiceninja/app/Ninja/PaymentDrivers/DwollaPaymentDriver.php

27 lines
736 B
PHP
Raw Normal View History

2017-01-30 21:40:43 +02:00
<?php
namespace App\Ninja\PaymentDrivers;
2016-06-20 17:14:43 +03:00
class DwollaPaymentDriver extends BasePaymentDriver
{
2016-06-22 21:42:09 +03:00
public function gatewayTypes()
2016-06-20 17:14:43 +03:00
{
return [GATEWAY_TYPE_DWOLLA];
}
protected function gateway()
{
$gateway = parent::gateway();
if ($gateway->getSandbox() && isset($_ENV['DWOLLA_SANDBOX_KEY']) && isset($_ENV['DWOLLA_SANSBOX_SECRET'])) {
$gateway->setKey($_ENV['DWOLLA_SANDBOX_KEY']);
$gateway->setSecret($_ENV['DWOLLA_SANSBOX_SECRET']);
} elseif (isset($_ENV['DWOLLA_KEY']) && isset($_ENV['DWOLLA_SECRET'])) {
$gateway->setKey($_ENV['DWOLLA_KEY']);
$gateway->setSecret($_ENV['DWOLLA_SECRET']);
}
return $gateway;
}
}