Exemplo n.º 1
0
 public function testList()
 {
     $createFee = PromisePay::Fee()->create($this->feeData);
     $getList = PromisePay::Fee()->getList(200);
     //var_dump($createFee, $getList);
     $this->markTestSkipped(__METHOD__ . ' skipped ' . PHP_EOL);
 }
Exemplo n.º 2
0
 /**
  * @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);
 }
Exemplo n.º 3
0
 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));
     };
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 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']));
 }
Exemplo n.º 6
0
 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);
 }