本文整理汇总了PHP中Braintree_Transaction::saleNoValidate方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_Transaction::saleNoValidate方法的具体用法?PHP Braintree_Transaction::saleNoValidate怎么用?PHP Braintree_Transaction::saleNoValidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Braintree_Transaction
的用法示例。
在下文中一共展示了Braintree_Transaction::saleNoValidate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGenerate_canBeGroupedByACustomField
function testGenerate_canBeGroupedByACustomField()
{
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => '5105105105105100', 'expirationDate' => '05/12'), 'customFields' => array('store_me' => 'custom value'), 'options' => array('submitForSettlement' => true)));
Braintree_TestHelper::settle($transaction->id);
$today = new Datetime();
$result = Braintree_SettlementBatchSummary::generate(Braintree_TestHelper::nowInEastern(), 'store_me');
$this->assertTrue($result->success);
$this->assertTrue(count($result->settlementBatchSummary->records) > 0);
$this->assertArrayHasKey('store_me', $result->settlementBatchSummary->records[0]);
}
示例2: test_rangeNode_voidedAt
function test_rangeNode_voidedAt()
{
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '1000.00', 'creditCard' => array('number' => '4111111111111111', 'expirationDate' => '05/12')));
$transaction = Braintree_Transaction::void($transaction->id)->transaction;
$twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC"));
$ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC"));
$ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC"));
$collection = Braintree_Transaction::search(array(Braintree_TransactionSearch::id()->is($transaction->id), Braintree_TransactionSearch::voidedAt()->between($twenty_min_ago, $ten_min_ago)));
$this->assertEquals(0, $collection->maximumCount());
$collection = Braintree_Transaction::search(array(Braintree_TransactionSearch::id()->is($transaction->id), Braintree_TransactionSearch::voidedAt()->between($ten_min_ago, $ten_min_from_now)));
$this->assertEquals(1, $collection->maximumCount());
$this->assertEquals($transaction->id, $collection->firstItem()->id);
}
示例3: testCardTypeIndicators
function testCardTypeIndicators()
{
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => Braintree_CreditCardNumbers_CardTypeIndicators::PREPAID, 'expirationDate' => '05/12')));
$this->assertEquals(Braintree_CreditCard::PREPAID_YES, $transaction->creditCardDetails->prepaid);
$prepaid_card_transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => Braintree_CreditCardNumbers_CardTypeIndicators::COMMERCIAL, 'expirationDate' => '05/12')));
$this->assertEquals(Braintree_CreditCard::COMMERCIAL_YES, $prepaid_card_transaction->creditCardDetails->commercial);
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => Braintree_CreditCardNumbers_CardTypeIndicators::PAYROLL, 'expirationDate' => '05/12')));
$this->assertEquals(Braintree_CreditCard::PAYROLL_YES, $transaction->creditCardDetails->payroll);
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => Braintree_CreditCardNumbers_CardTypeIndicators::HEALTHCARE, 'expirationDate' => '05/12')));
$this->assertEquals(Braintree_CreditCard::HEALTHCARE_YES, $transaction->creditCardDetails->healthcare);
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => Braintree_CreditCardNumbers_CardTypeIndicators::DURBIN_REGULATED, 'expirationDate' => '05/12')));
$this->assertEquals(Braintree_CreditCard::DURBIN_REGULATED_YES, $transaction->creditCardDetails->durbinRegulated);
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => Braintree_CreditCardNumbers_CardTypeIndicators::DEBIT, 'expirationDate' => '05/12')));
$this->assertEquals(Braintree_CreditCard::DEBIT_YES, $transaction->creditCardDetails->debit);
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => Braintree_CreditCardNumbers_CardTypeIndicators::ISSUING_BANK, 'expirationDate' => '05/12')));
$this->assertEquals("NETWORK ONLY", $transaction->creditCardDetails->issuingBank);
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => Braintree_CreditCardNumbers_CardTypeIndicators::COUNTRY_OF_ISSUANCE, 'expirationDate' => '05/12')));
$this->assertEquals("USA", $transaction->creditCardDetails->countryOfIssuance);
}
示例4: testSettlementPending
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);
}
示例5: createTransactionToRefund
function createTransactionToRefund()
{
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '100.00', 'creditCard' => array('number' => '5105105105105100', 'expirationDate' => '05/12'), 'options' => array('submitForSettlement' => true)));
Braintree_TestHelper::settle($transaction->id);
return $transaction;
}