cloneTransaction() public static method

static methods redirecting to gateway
public static cloneTransaction ( $transactionId, $attribs )
コード例 #1
0
 public function testCloneTransaction_RaisesErrorOnInvalidProperty()
 {
     $this->setExpectedException('InvalidArgumentException');
     Braintree\Transaction::cloneTransaction('an id', ['amount' => '123.45', 'invalidProperty' => 'foo']);
 }
コード例 #2
0
 /**
  * Clone original transaction
  * @param string $transactionId
  * @param array $attributes
  * @return mixed
  */
 public function cloneTransaction($transactionId, array $attributes)
 {
     return Transaction::cloneTransaction($transactionId, $attributes);
 }
コード例 #3
0
 public function testCloneWithValidations()
 {
     $result = Braintree\Transaction::credit(['amount' => '100.00', 'creditCard' => ['number' => '5105105105105100', 'expirationDate' => '05/2011']]);
     $this->assertTrue($result->success);
     $transaction = $result->transaction;
     $cloneResult = Braintree\Transaction::cloneTransaction($transaction->id, ['amount' => '123.45']);
     $this->assertFalse($cloneResult->success);
     $baseErrors = $cloneResult->errors->forKey('transaction')->onAttribute('base');
     $this->assertEquals(Braintree\Error\Codes::TRANSACTION_CANNOT_CLONE_CREDIT, $baseErrors[0]->code);
 }