/** * test_manual_CancelOrderBuilder_Card_success * * run this manually after you've performed a card transaction and have set * the transaction status to success using the tools in the logg admin. */ function test_manual_CancelOrderBuilder_Card_success() { // Stop here and mark this test as incomplete. $this->markTestIncomplete('skeleton for manual test of cancelOrder for a card order'); // Set the below to match the transaction, then run the test. $customerrefno = "test_1396964349955"; $transactionId = 580658; $request = WebPayAdmin::cancelOrder(Svea\SveaConfig::getDefaultConfig())->setOrderId($transactionId)->setCountryCode("SE")->cancelCardOrder()->doRequest(); $this->assertInstanceOf("Svea\\HostedAdminResponse", $response); $this->assertEquals(1, $response->accepted); $this->assertEquals($customerrefno, $response->customerrefno); }
/** * Builds the base queryOrder object * * @param Mage_Payment_Model_Info $payment * @param $transactionId * @return mixed */ protected function _getCancelOrderRequest(Mage_Payment_Model_Info $payment, $transactionId) { $order = $payment->getOrder(); $paymentMethodConfig = $this->getSveaStoreConfClass($order->getStoreId()); $config = new SveaMageConfigProvider($paymentMethodConfig); $countryId = $order->getBillingAddress()->getCountryId(); $request = WebPayAdmin::cancelOrder($config)->setOrderId($transactionId)->setCountryCode($countryId); return $request; }
function test_missing_required_method_for_cancelOrder_cancelCardOrder_setCountryCode() { $request = WebPayAdmin::cancelOrder(Svea\SveaConfig::getDefaultConfig())->setOrderId("123456789"); $this->setExpectedException('Svea\\ValidationException', '-missing value : CountryCode is required. Use function setCountryCode().'); $request->cancelCardOrder()->prepareRequest(); }