public function testHeaderImageUrl() { $this->assertSame($this->request, $this->request->setHeaderImageUrl('https://www.example.com/header.jpg')); $this->assertSame('https://www.example.com/header.jpg', $this->request->getHeaderImageUrl()); $data = $this->request->getData(); $this->assertEquals('https://www.example.com/header.jpg', $data['HDRIMG']); }
public function testMaxAmount() { $this->request->setMaxAmount(321.54); $this->assertSame(321.54, $this->request->getMaxAmount()); $data = $this->request->getData(); $this->assertSame(321.54, $data['MAXAMT']); }
/** * Add support for recurring payments by setting the required variables if the is_recurring flag is true. * * @return array */ public function getData() { $data = parent::getData(); $data['L_BILLINGTYPE0'] = 'RecurringPayments'; $data['L_BILLINGAGREEMENTDESCRIPTION0'] = $this->getDescription(); // Set cost to 0. $data['PAYMENTREQUEST_0_AMT'] = 0; return $data; }
public function testBadCallbackConfiguration() { $baseData = array('amount' => '10.00', 'currency' => 'AUD', 'transactionId' => '111', 'description' => 'Order Description', 'returnUrl' => 'https://www.example.com/return', 'cancelUrl' => 'https://www.example.com/cancel', 'subject' => '*****@*****.**', 'headerImageUrl' => 'https://www.example.com/header.jpg', 'allowNote' => 0, 'addressOverride' => 0, 'brandName' => 'Dunder Mifflin Paper Company, Incy.'); $this->request->initialize(array_merge($baseData, array('callback' => 'https://www.example.com/calculate-shipping'))); // from the docblock on this exception - // Thrown when a request is invalid or missing required fields. // callback has been set but no shipping options so expect one of these: $this->setExpectedException('\\Omnipay\\Common\\Exception\\InvalidRequestException'); $this->request->getData(); }