function testRequestSaleJson()
 {
     $json = \Hypercharge\JsonSchemaFixture::request('sale.json');
     $this->assertJson($json);
     $data = json_decode($json);
     $this->assertIsA($data, 'stdClass');
     $this->assertEqual('sale', $data->payment_transaction->transaction_type);
 }
Пример #2
0
 function getRequestFixture($fileName, $asArray = true)
 {
     return json_decode(\Hypercharge\JsonSchemaFixture::request($fileName), $asArray);
 }
Пример #3
0
 function request($requestFixture)
 {
     return json_decode(JsonSchemaFixture::request($requestFixture));
 }
Пример #4
0
 /**
  * @param string $fileName e.g. "sale.json" for /vendor/hypercharge/hypercharge-schema/test/fixtures/sale.json
  * @return mixed array for *.json, string for other
  */
 function schemaRequest($fileName)
 {
     return self::parseIfJson(JsonSchemaFixture::request($fileName) . "\n", $fileName);
 }
 function testCreateThrowsIfTransactionHasScheduler()
 {
     $trxData = $this->transactionFixture('init_recurring_authorize.json');
     $this->setStartAndEndDate($trxData['recurring_schedule']);
     $trx = Transaction::init_recurring_authorize($this->channel_token, $trxData);
     $this->assertTrue($trx->isApproved());
     $this->assertIsA($trx->recurring_schedule, 'Hypercharge\\Scheduler');
     $schedulerData = json_decode(JsonSchemaFixture::request('scheduler_create.json'), true);
     $schedulerData['payment_transaction_unique_id'] = $trx->unique_id;
     $this->setStartAndEndDate($schedulerData);
     $this->expectException('Hypercharge\\Errors\\WorkflowError');
     $this->mockV2Url('scheduler');
     Scheduler::create($schedulerData);
 }