public function testList() { $createFee = PromisePay::Fee()->create($this->feeData); $getList = PromisePay::Fee()->getList(200); //var_dump($createFee, $getList); $this->markTestSkipped(__METHOD__ . ' skipped ' . PHP_EOL); }
/** * @group errors-handling */ public function testAsyncRequestsWithErrors() { PromisePay::AsyncClient(function () { // try a fetch a fee using ID that doesn't exist $randomId = GUID(); PromisePay::Fee()->get($randomId); })->done($response); }
protected function setUp() { $this->feesListFn = function ($limit, $offset) { return PromisePay::Fee()->getList(array('limit' => $limit, 'offset' => $offset)); }; $this->batchTransactionsFunction = function ($limit, $offset) { PromisePay::BatchTransactions()->listTransactions(array('limit' => $limit, 'offset' => $offset)); }; }
public function testList() { $createFee = PromisePay::Fee()->create($this->feeData); $limit = 200; $offset = 0; while (true) { $getList = PromisePay::Fee()->getList(array('limit' => $limit, 'offset' => $offset)); foreach ($getList as $fee) { if ($fee['id'] == $createFee['id']) { $feeFound = true; break 2; } } $getListCount = count($getList); if ($getListCount < $limit) { break; } $offset += $getListCount; } $this->assertTrue($feeFound); }
public function testListFeesForItem() { // Create a fee $createFee = PromisePay::Fee()->create($this->feeData); // Sandbox the item data, since we're gonna be changing it $itemData = $this->itemData; $itemData['fee_ids'] = $createFee['id']; // Create an item containing the fee created above $createItem = PromisePay::Item()->create($itemData); $this->assertEquals($this->GUID, $createItem['id']); // Get list of fees $itemListOfFees = PromisePay::Item()->getListOfFees($createItem['id']); $this->assertNotEmpty($itemListOfFees[0]['fee_list']); $this->assertTrue(in_array($createFee['id'], $itemListOfFees[0]['fee_list'])); }
public function testListFeesForItem() { // Create a fee $createFee = PromisePay::Fee()->create($this->feeData); // Sandbox the item data, since we're gonna be changing it $itemData = $this->itemData; $itemData['fee_ids'] = $createFee['id']; // Create an item containing the fee created above $createItem = PromisePay::Item()->create($itemData); $this->assertEquals($this->GUID, $createItem['id']); // Get list of fees $itemListOfFees = PromisePay::Item()->getListOfFees($createItem['id']); //var_dump($itemListOfFees, $createItem); $this->markTestSkipped(__METHOD__ . ' skipped ' . PHP_EOL); }