public function setup()
 {
     $this->paypalRequest = Bootstrap::getServiceManager()->get('SpeckPaypal\\Service\\Request');
     $payment = new DoDirectPayment(array('paymentDetails' => new \SpeckPaypal\Element\PaymentDetails(array('amt' => '10.00'))));
     $payment->setCardNumber('4744151425799438');
     $payment->setExpirationDate('112017');
     $payment->setFirstName('John');
     $payment->setLastName('Canyon');
     $payment->setEmail('*****@*****.**');
     $payment->setIpAddress('255.255.255.255');
     $payment->setReturnFmfDetails(1);
     $payment->setCreditCardType('Visa');
     $payment->setStartDate('122012');
     $payment->setCvv2('345');
     $payment->setIssueNumber('12');
     $address = new Address();
     $address->setStreet('27 nowhere');
     $address->setState('California');
     $address->setCity('Ventura');
     $address->setZip(92656);
     $address->setCountry('US');
     $address->setPhoneNum('999-999-9999');
     $payment->setAddress($address);
     $payment->setShipAddress(clone $address);
     $this->payment = $payment;
 }
 public function testCanGetValidPaypalRequestFromSM()
 {
     $sm = Bootstrap::getServiceManager();
     $config = $sm->get('application')->getConfig();
     $this->assertTrue(isset($config['speck-paypal-api']));
     $config = $config['speck-paypal-api'];
     $this->assertTrue(array_key_exists('username', $config));
     $this->assertTrue(array_key_exists('password', $config));
     $this->assertTrue(array_key_exists('endpoint', $config));
     $this->assertTrue(array_key_exists('signature', $config));
 }
 public function setup()
 {
     $this->paypalRequest = Bootstrap::getServiceManager()->get('SpeckPaypal\\Service\\Request');
     $express = new SetExpressCheckout(array('paymentDetails' => new PaymentDetails(array('amt' => '10.00'))));
     $express->setMaxAmt('10.00');
     $express->setReturnUrl('http://return.url');
     $express->setCancelUrl('http://cancel.url');
     $express->setCallback('http://callback.url');
     $express->setCallbackTimeout('10');
     $express->setReqConfirmShipping(true);
     $express->setNoShipping(true);
     $express->setAllowNote(true);
     $express->setAddrOverride(true);
     $express->setCallbackVersion('10');
     $express->setLocaleCode('en_GB');
     $express->setPageStyle('page_style');
     $express->setHdrImg('http://hdrimg.url');
     $express->setHdrBorderColor('FFFFFF');
     $express->setPayflowColor('FFFFFF');
     $express->setEmail('*****@*****.**');
     $express->setSolutionType(SetExpressCheckout::SOLUTION_MARK);
     $express->setLandingPage(SetExpressCheckout::LANDINGPAGE_BILLING);
     $express->setChannelType(SetExpressCheckout::CHANNELTYPE_MERCHANT);
     $express->setGiroPaySuccessUrl('http://giropaysuccess.url');
     $express->setGiroPayCancelUrl('http://giropaycancel.url');
     $express->setBankTxPendingUrl('http://banktxpending.url');
     $express->setBrandName('ACME inc.');
     $express->setCustomerServiceNumber('888-555-4444');
     $express->setGiftMessageEnable(true);
     $express->setGiftReceiptEnable(true);
     $express->setGiftWrapEnable(true);
     $express->setGiftWrapName('Box with ribbon');
     $express->setGiftWrapAmount('1.00');
     $express->setBuyerEmailOptInEnable(true);
     $express->setSurveyQuestion('What color is the sky?');
     $express->setSurveyEnable(true);
     $express->setBuyerId('test');
     $express->setBuyerUsername('buyer_username');
     $express->setBuyerRegistrationDate('2011-06-24T05:38:48Z');
     $express->setAllowPushFunding(true);
     $express->setTaxIdType(SetExpressCheckout::TAXIDTYPE_INDIVIDUAL);
     $express->setTaxId('12345678912');
     $this->express = $express;
 }
Example #4
0
        $vendorPath = static::findParentPath('vendor');
        if (is_readable($vendorPath . '/autoload.php')) {
            $loader = (include $vendorPath . '/autoload.php');
        }
        $zf2Path = getenv('ZF2_PATH') ?: (defined('ZF2_PATH') ? ZF2_PATH : (is_dir($vendorPath . '/ZF2/library') ? $vendorPath . '/ZF2/library' : false));
        if (!$zf2Path) {
            throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.');
        }
        if (isset($loader)) {
            $loader->add('Zend', $zf2Path . '/Zend');
        } else {
            include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
            AutoloaderFactory::factory(array('Zend\\Loader\\StandardAutoloader' => array('autoregister_zf' => true, 'namespaces' => array(__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__))));
        }
    }
    protected static function findParentPath($path)
    {
        $dir = __DIR__;
        $previousDir = '.';
        while (!is_dir($dir . '/' . $path)) {
            $dir = dirname($dir);
            if ($previousDir === $dir) {
                return false;
            }
            $previousDir = $dir;
        }
        return $dir . '/' . $path;
    }
}
Bootstrap::init();
Example #5
0
 public function __construct()
 {
     $this->request = Bootstrap::getServiceManager()->get('SpeckPaypal\\Service\\Request');
 }