public function testGenerate_canBeGroupedByACustomField() { $transaction = Braintree\Transaction::saleNoValidate(['amount' => '100.00', 'creditCard' => ['number' => '5105105105105100', 'expirationDate' => '05/12'], 'customFields' => ['store_me' => 'custom value'], 'options' => ['submitForSettlement' => true]]); Braintree\Test\Transaction::settle($transaction->id); $today = new Datetime(); $result = Braintree\SettlementBatchSummary::generate(Test\Helper::nowInEastern(), 'store_me'); $this->assertTrue($result->success); $this->assertTrue(count($result->settlementBatchSummary->records) > 0); $this->assertArrayHasKey('store_me', $result->settlementBatchSummary->records[0]); }
public function testSettlementPending() { $transaction = Braintree\Transaction::saleNoValidate(['amount' => '100.00', 'creditCard' => ['number' => '5105105105105100', 'expirationDate' => '05/12'], 'options' => ['submitForSettlement' => true]]); $transaction = Braintree\Test\Transaction::settlementPending($transaction->id); $this->assertEquals('settlement_pending', $transaction->status); }
public function testIncludeProcessorSettlementResponseForSettlementPendingTransaction() { $result = Braintree\Transaction::sale(["paymentMethodNonce" => Braintree\Test\Nonces::$paypalFuturePayment, "amount" => "100", "options" => ["submitForSettlement" => true]]); $this->assertTrue($result->success); $transaction = $result->transaction; Braintree\Test\Transaction::settlementPending($transaction->id); $inline_transaction = Braintree\Transaction::find($transaction->id); $this->assertEquals($inline_transaction->status, Braintree\Transaction::SETTLEMENT_PENDING); $this->assertEquals($inline_transaction->processorSettlementResponseCode, "4002"); $this->assertEquals($inline_transaction->processorSettlementResponseText, "Settlement Pending"); }