Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "trolley/core",
"type": "library",
"description": "Trolley PHP SDK",
"homepage": "https://github.com/PaymentRails/php-sdk",
"homepage": "https://github.com/Trolley/php-sdk",
"keywords": [
"PaymentRails",
"Trolley"
Expand Down
6 changes: 3 additions & 3 deletions lib/Trolley/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public static function find($batchId)
/**
* Create a batch
*
* @param mixed $params
* @param mixed $batchDescription
* @param mixed $payments
* @return Batch
*/
public static function create($params, $payments = null)
public static function create($batchDescription, $payments = null)
{
return Configuration::gateway()->batch()->create($params, $payments);
return Configuration::gateway()->batch()->create($batchDescription, $payments);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Trolley/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Version
*/
const MAJOR = 3;
const MINOR = 0;
const TINY = 0;
const TINY = 1;

/**
* @ignore
Expand Down
28 changes: 24 additions & 4 deletions tests/integration/BatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private function deleteRecipient($recipientId) {
$this->assertTrue($response);
}

/* public function testErrors(){
public function testErrors(){

//create inactive Recipient to send payment to
$recipient = $this->createRecipient();
Expand Down Expand Up @@ -78,6 +78,23 @@ public function testAll_smokeTest()
{
$all = Trolley\Batch::all();
$this->assertTrue($all->maximumCount() > 0);

$batch = Trolley\Batch::create([
"sourceCurrency" => "USD",
"description" => "Integration Test Create : PHP SDK",
"tags" => ["PHPSDK"]
]);

$searchResult = Trolley\Batch::search([
"search" => "PHPSDK",
"page" => 1,
"pageSize" => 5
]);

$this->assertEquals($searchResult->firstItem()->id, $batch->id);

$response = Trolley\Batch::delete($batch->id);
$this->assertTrue($response);
}

public function testBalances(){
Expand Down Expand Up @@ -151,7 +168,7 @@ public function testUpdate() {
$response = Trolley\Batch::delete($batch->id);

$this->assertTrue($response);
} */
}

public function testCreateWithPayments()
{
Expand Down Expand Up @@ -194,7 +211,7 @@ public function testCreateWithPayments()
$this->deleteRecipient($recipientBeta->id);
}

/* public function testPayments()
public function testPayments()
{
$batch = Trolley\Batch::create([
"sourceCurrency" => "USD",
Expand All @@ -220,6 +237,9 @@ public function testCreateWithPayments()

$this->assertTrue($response);

$response = Trolley\Batch::findPayment($batch->id, $payment->id);
$this->assertEquals($response->id, $payment->id);

$response = Trolley\Batch::deletePayment($batch->id, $payment->id);

$this->assertTrue($response);
Expand Down Expand Up @@ -273,5 +293,5 @@ public function testProcessing()

$this->deleteRecipient($recipientAlpha->id);
$this->deleteRecipient($recipientBeta->id);
} */
}
}
9 changes: 9 additions & 0 deletions tests/integration/RecipientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ public function testLifecycle()
$fetchResult = Trolley\Recipient::find($createResult->id);
$this->assertEquals('Bob', $fetchResult->firstName);

$searchResult = Trolley\Recipient::search(
[
"name" => $createResult->firstName,
"page" => 1,
"pageSize" => 2
]
);
$this->assertEquals($searchResult->firstItem()->firstName, $createResult->firstName);

$deleteResult = Trolley\Recipient::delete($createResult->id);
$this->assertTrue($deleteResult);

Expand Down