/** * @test */ public function shouldSetZeroPaymentActionAsSell() { $action = new CaptureAction(); $action->setPayment($this->createPaymentMock()); $action->execute($request = new CaptureRequest(array())); $model = $request->getModel(); $this->assertArrayHasKey('PAYMENTREQUEST_0_PAYMENTACTION', $model); $this->assertEquals(Api::PAYMENTACTION_SALE, $model['PAYMENTREQUEST_0_PAYMENTACTION']); }
/** * @test */ public function createBillingAgrement() { //@testo:start //@testo:source //@testo:uncomment:use Payum\Core\Request\CaptureRequest; //@testo:uncomment:use Payum\Paypal\ExpressCheckout\Nvp\Api; $captureBillingAgreement = new CaptureRequest(array('PAYMENTREQUEST_0_AMT' => 0, 'RETURNURL' => 'http://foo.com/finishPayment', 'CANCELURL' => 'http://foo.com/finishPayment', 'L_BILLINGTYPE0' => Api::BILLINGTYPE_RECURRING_PAYMENTS, 'L_BILLINGAGREEMENTDESCRIPTION0' => 'Subsribe for weather forecast')); // ... //@testo:end $billingAgreementDetails = $captureBillingAgreement->getModel(); $billingAgreementDetails['TOKEN'] = 'aToken'; $billingAgreementDetails['EMAIL'] = '*****@*****.**'; $captureBillingAgreement->setModel($billingAgreementDetails); return $captureBillingAgreement; }