public function testUpdateCharge() { $createRequest = new CreateChargeRequest(350, "usd"); $createRequest->setCard(new CreateCardRequest(self::VISA_1, 1, 2020, 123)); $createResponse = $this->charges->createCharge($createRequest); $this->assertInstanceOf(Charges::CHARGE_RESPONSE_CLASS, $createResponse); $description = "updated"; $metadata = array("foo" => "bar"); $updateResponse = $this->charges->updateCharge($createResponse->getId(), $description, $metadata); $this->assertInstanceOf(Charges::CHARGE_RESPONSE_CLASS, $updateResponse); $this->assertEquals($description, $updateResponse->getDescription()); $this->assertEquals($metadata, $updateResponse->getMetadata()); }