public function testRefundModification()
 {
     // create a payment
     require_once __DIR__ . '/CreatePaymentRequestTest.php';
     $test = new CreatePaymentRequestTest();
     $result = $test->testCreatePaymentSuccess();
     $pspReference = $result['pspReference'];
     // create modification
     $client = $this->createClient();
     // initialize service
     $service = new Service\Modification($client);
     $modificationAmount = array('currency' => 'EUR', 'value' => '750');
     $params = array("merchantAccount" => $this->_merchantAccount, "modificationAmount" => $modificationAmount, "reference" => $pspReference . '_refund', "originalReference" => $pspReference);
     $result = $service->refund($params);
     $this->assertEquals('[refund-received]', $result['response']);
 }
 public function testListRecurringContracts()
 {
     // create a payment with a recurring contract
     require_once __DIR__ . '/CreatePaymentRequestTest.php';
     $test = new CreatePaymentRequestTest();
     $result = $test->testCreatePaymentWithRecurringSuccess();
     // initialize client
     $client = $this->createClient();
     // initialize service
     $service = new Service\Recurring($client);
     $recurring = array('contract' => \Adyen\Contract::RECURRING);
     $params = array('merchantAccount' => $this->getMerchantAccount(), 'recurring' => $recurring, 'shopperReference' => '1');
     $result = $service->listRecurringDetails($params);
     // last email is the one used in the request
     $this->assertEquals($result['lastKnownShopperEmail'], "*****@*****.**");
     $cardInResults = false;
     foreach ($result['details'] as $detail) {
         if (isset($detail['RecurringDetail']['card']['number']) && $detail['RecurringDetail']['card']['number'] == '1111') {
             $cardInResults = true;
         }
     }
     $this->assertTrue($cardInResults);
 }