/**
  * test_manual_recurring_payment_step_2 
  * 
  * run this test manually after you've performed a card transaction with 
  * subscriptiontype set and have gotten the transaction details needed
  */
 function test_manual_recurring_payment_step_2()
 {
     // Stop here and mark this test as incomplete.
     $this->markTestIncomplete('skeleton for manual test of recur transaction amount');
     // 1. enter the below values from the transaction log from test_manual_recurring_payment_step_1
     // 2. run the test and check the output for the subscriptionid and transactionid of the recur request
     // Set the below to match the original transaction, then run the test.
     $paymentmethod = "KORTCERT";
     $merchantid = 1130;
     $currency = "SEK";
     $cardtype = "VISA";
     $maskedcardno = "444433xxxxxx1100";
     $expirymonth = 02;
     $expiryyear = 16;
     $subscriptionid = 2960;
     // insert
     // the below applies to the recur request, and may differ from the original transaction
     $new_amount = "2500";
     // in minor currency
     $new_customerrefno = "test_manual_recurring_payment_step_1 " . date('c');
     // below is actual test, shouldn't need to change it
     $request = new Svea\HostedService\RecurTransaction(Svea\SveaConfig::getDefaultConfig());
     $request->countryCode = "SE";
     $request->subscriptionId = $subscriptionid;
     $request->currency = $currency;
     $request->customerRefNo = $new_customerrefno;
     $request->amount = $new_amount;
     $response = $request->doRequest();
     // check that request was accepted
     $this->assertEquals(1, $response->accepted);
     // print the subscription id that succeeded to use to confirm the transaction
     //print_r( " test_manual_recurring_payment_step_2() recur succeded using subscriptionid: " . $response->subscriptionid ." " );
     //print_r( " test_manual_recurring_payment_step_2() for more info, check logs for transaction: " . $response->transactionid ." " );
 }
 function test_manual_query_recur_card_recur_transaction()
 {
     // Stop here and mark this test as incomplete.
     $this->markTestIncomplete('test_manual_query_recur_card_initial_transaction');
     // 1. enter the below values from the transaction log from test_manual_recurring_payment_step_1
     // 2. run the test and check the output for the subscriptionId and transactionid of the recur request
     // Set the below to match the original transaction, then run the test.
     $paymentmethod = "KORTCERT";
     $merchantid = 1130;
     $currency = "SEK";
     $cardType = "VISA";
     $maskedCardNumber = "444433xxxxxx1100";
     $expiryMonth = 01;
     $expiryYear = 15;
     $subscriptionId = 3050;
     // insert
     // the below applies to the recur request, and may differ from the original transaction
     $new_amount = "2500";
     // in minor currency
     $new_customerrefno = "test_manual_recurring_payment_step_1 " . date('c');
     // below is actual test, shouldn't need to change it
     $request = new Svea\HostedService\RecurTransaction(Svea\SveaConfig::getDefaultConfig());
     $request->countryCode = "SE";
     $request->subscriptionId = $subscriptionId;
     $request->currency = $currency;
     $request->customerRefNo = $new_customerrefno;
     $request->amount = $new_amount;
     $response = $request->doRequest();
     // check that request was accepted
     $this->assertEquals(1, $response->accepted);
     ////print_r("Recur card transaction response: "); //print_r( $response );
     //
     //Recur card transaction response: Svea\HostedService\RecurTransactionResponse Object
     //(
     //    [transactionid] => 586165
     //    [customerrefno] => test_manual_recurring_payment_step_1 2014-09-12T11:38:30+02:00
     //    [paymentmethod] => CARD
     //    [merchantid] => 1130
     //    [amount] => 2500
     //    [currency] => SEK
     //    [cardType] => VISA
     //    [maskedCardNumber] => 444433xxxxxx1100
     //    [expiryMonth] => 01
     //    [expiryYear] => 15
     //    [authCode] => 153124
     //    [subscriptionid] => 3050
     //    [accepted] => 1
     //    [resultcode] => 0
     //    [errormessage] =>
     //)
     // Set the below to match the transaction, then run the test.
     $transactionId = $response->transactionId;
     //SimpleXMLElement Object
     //(
     //    [transaction] => SimpleXMLElement Object
     //        (
     //            [@attributes] => Array
     //                (
     //                    [id] => 586165
     //                )
     //
     //            [customerrefno] => test_manual_recurring_payment_step_1 2014-09-12T11:38:30+02:00
     //            [merchantid] => 1130
     //            [status] => AUTHORIZED
     //            [amount] => 2500
     //            [currency] => SEK
     //            [vat] => SimpleXMLElement Object
     //                (
     //                )
     //
     //            [capturedamount] => SimpleXMLElement Object
     //                (
     //                )
     //
     //            [authorizedamount] => 2500
     //            [created] => 2014-09-12 11:38:32.557
     //            [creditstatus] => CREDNONE
     //            [creditedamount] => 0
     //            [merchantresponsecode] => 0
     //            [paymentmethod] => CARD
     //            [callbackurl] => SimpleXMLElement Object
     //                (
     //                )
     //
     //            [capturedate] => SimpleXMLElement Object
     //                (
     //                )
     //
     //            [subscriptionid] => 3050
     //            [subscriptiontype] => RECURRINGCAPTURE
     //        )
     //
     //    [statuscode] => 0
     //)
     $request = new Svea\HostedService\QueryTransaction(Svea\SveaConfig::getDefaultConfig());
     $request->transactionId = $transactionId;
     $request->countryCode = "SE";
     $queryResponse = $request->doRequest();
     $this->assertInstanceOf("Svea\\HostedService\\QueryTransactionResponse", $queryResponse);
     ////print_r($queryResponse);
     //
     //Svea\HostedService\QueryTransactionResponse Object
     //(
     //    [transactionId] => 587424
     //    [clientOrderNumber] => test_manual_recurring_payment_step_1 2014-10-06T15:53:45+02:00
     //    [merchantId] => 1130
     //    [status] => AUTHORIZED
     //    [amount] => 2500
     //    [currency] => SEK
     //    [vat] =>
     //    [capturedamount] =>
     //    [authorizedamount] => 2500
     //    [created] => 2014-10-06 15:53:45.367
     //    [creditstatus] => CREDNONE
     //    [creditedamount] => 0
     //    [merchantresponsecode] => 0
     //    [paymentMethod] => CARD
     //    [numberedOrderRows] =>
     //    [callbackurl] =>
     //    [capturedate] =>
     //    [subscriptionId] => 3050
     //    [subscriptiontype] => RECURRINGCAPTURE
     //    [cardType] =>
     //    [maskedCardNumber] =>
     //    [eci] =>
     //    [mdstatus] =>
     //    [expiryYear] =>
     //    [expiryMonth] =>
     //    [chname] =>
     //    [authCode] =>
     //    [accepted] => 1
     //    [resultcode] => 0
     //    [errormessage] =>
     //)
     $this->assertEquals(1, $response->accepted);
 }