PHP 클래스 Braintree\Transaction

At minimum, an amount, credit card number, and credit card expiration date are required. Minimalistic example: Transaction::saleNoValidate(array( 'amount' => '100.00', 'creditCard' => array( 'number' => '5105105105105100', 'expirationDate' => '05/12', ), )); Full example: Transaction::saleNoValidate(array( 'amount' => '100.00', 'orderId' => '123', 'channel' => 'MyShoppingCardProvider', 'creditCard' => array( if token is omitted, the gateway will generate a token 'token' => 'credit_card_123', 'number' => '5105105105105100', 'expirationDate' => '05/2011', 'cvv' => '123', ), 'customer' => array( if id is omitted, the gateway will generate an id 'id' => 'customer_123', 'firstName' => 'Dan', 'lastName' => 'Smith', 'company' => 'Braintree', 'email' => '[email protected]', 'phone' => '419-555-1234', 'fax' => '419-555-1235', 'website' => 'http://braintreepayments.com' ), 'billing' => array( 'firstName' => 'Carl', 'lastName' => 'Jones', 'company' => 'Braintree', 'streetAddress' => '123 E Main St', 'extendedAddress' => 'Suite 403', 'locality' => 'Chicago', 'region' => 'IL', 'postalCode' => '60622', 'countryName' => 'United States of America' ), 'shipping' => array( 'firstName' => 'Andrew', 'lastName' => 'Mason', 'company' => 'Braintree', 'streetAddress' => '456 W Main St', 'extendedAddress' => 'Apt 2F', 'locality' => 'Bartlett', 'region' => 'IL', 'postalCode' => '60103', 'countryName' => 'United States of America' ), 'customFields' => array( 'birthdate' => '11/13/1954' ) ) == Storing in the Vault == The customer and credit card information used for a transaction can be stored in the vault by setting transaction[options][storeInVault] to true. $transaction = Transaction::saleNoValidate(array( 'customer' => array( 'firstName' => 'Adam', 'lastName' => 'Williams' ), 'creditCard' => array( 'number' => '5105105105105100', 'expirationDate' => '05/2012' ), 'options' => array( 'storeInVault' => true ) )); echo $transaction->customerDetails->id '865534' echo $transaction->creditCardDetails->token '6b6m' To also store the billing address in the vault, pass the addBillingAddressToPaymentMethod option. Transaction.saleNoValidate(array( ... 'options' => array( 'storeInVault' => true 'addBillingAddressToPaymentMethod' => true ) )); == Submitting for Settlement== This can only be done when the transction's status is authorized. If amount is not specified, the full authorized amount will be settled. If you would like to settle less than the full authorized amount, pass the desired amount. You cannot settle more than the authorized amount. A transaction can be submitted for settlement when created by setting $transaction[options][submitForSettlement] to true. $transaction = Transaction::saleNoValidate(array( 'amount' => '100.00', 'creditCard' => array( 'number' => '5105105105105100', 'expirationDate' => '05/2012' ), 'options' => array( 'submitForSettlement' => true ) )); == More information == For more detailed information on Transactions, see {@link http://www.braintreepayments.com/gateway/transaction-api http://www.braintreepaymentsolutions.com/gateway/transaction-api}
상속: extends braintree\Base
파일 보기 프로젝트 열기: braintree/braintree_php 1 사용 예제들

공개 메소드들

메소드 설명
__toString ( ) : string returns a string representation of the transaction
cancelRelease ( $transactionId )
cloneTransaction ( $transactionId, $attribs ) static methods redirecting to gateway
createFromTransparentRedirect ( $queryString )
createTransactionUrl ( )
credit ( $attribs )
creditNoValidate ( $attribs )
factory ( $attributes ) : Transaction factory method: returns an instance of Transaction to the requesting method, with populated properties
fetch ( $query, $ids )
find ( $id )
holdInEscrow ( $transactionId )
isDisbursed ( ) : boolean
isEqual ( $otherTx )
refund ( $transactionId, $amount = null )
releaseFromEscrow ( $transactionId )
sale ( $attribs )
saleNoValidate ( $attribs )
search ( $query )
submitForPartialSettlement ( $transactionId, $amount, $attribs = [] )
submitForSettlement ( $transactionId, $amount = null, $attribs = [] )
submitForSettlementNoValidate ( $transactionId, $amount = null, $attribs = [] )
updateDetails ( $transactionId, $attribs = [] )
vaultCreditCard ( )
vaultCustomer ( ) : void | Braintree\Customer
void ( $transactionId )
voidNoValidate ( $transactionId )

보호된 메소드들

메소드 설명
_initialize ( array $transactionAttribs ) : void sets instance properties from an array of values

메소드 상세

__toString() 공개 메소드

returns a string representation of the transaction
public __toString ( ) : string
리턴 string

_initialize() 보호된 메소드

sets instance properties from an array of values
protected _initialize ( array $transactionAttribs ) : void
$transactionAttribs array array of transaction data
리턴 void

cancelRelease() 공개 정적인 메소드

public static cancelRelease ( $transactionId )

cloneTransaction() 공개 정적인 메소드

static methods redirecting to gateway
public static cloneTransaction ( $transactionId, $attribs )

createFromTransparentRedirect() 공개 정적인 메소드

public static createFromTransparentRedirect ( $queryString )

createTransactionUrl() 공개 정적인 메소드

public static createTransactionUrl ( )

credit() 공개 정적인 메소드

public static credit ( $attribs )

creditNoValidate() 공개 정적인 메소드

public static creditNoValidate ( $attribs )

factory() 공개 정적인 메소드

factory method: returns an instance of Transaction to the requesting method, with populated properties
public static factory ( $attributes ) : Transaction
리턴 Transaction

fetch() 공개 정적인 메소드

public static fetch ( $query, $ids )

find() 공개 정적인 메소드

public static find ( $id )

holdInEscrow() 공개 정적인 메소드

public static holdInEscrow ( $transactionId )

isDisbursed() 공개 메소드

public isDisbursed ( ) : boolean
리턴 boolean

isEqual() 공개 메소드

public isEqual ( $otherTx )

refund() 공개 정적인 메소드

public static refund ( $transactionId, $amount = null )

releaseFromEscrow() 공개 정적인 메소드

public static releaseFromEscrow ( $transactionId )

sale() 공개 정적인 메소드

public static sale ( $attribs )

saleNoValidate() 공개 정적인 메소드

public static saleNoValidate ( $attribs )

submitForPartialSettlement() 공개 정적인 메소드

public static submitForPartialSettlement ( $transactionId, $amount, $attribs = [] )

submitForSettlement() 공개 정적인 메소드

public static submitForSettlement ( $transactionId, $amount = null, $attribs = [] )

submitForSettlementNoValidate() 공개 정적인 메소드

public static submitForSettlementNoValidate ( $transactionId, $amount = null, $attribs = [] )

updateDetails() 공개 정적인 메소드

public static updateDetails ( $transactionId, $attribs = [] )

vaultCreditCard() 공개 메소드

public vaultCreditCard ( )

vaultCustomer() 공개 메소드

public vaultCustomer ( ) : void | Braintree\Customer
리턴 void | Braintree\Customer

void() 공개 정적인 메소드

public static void ( $transactionId )

voidNoValidate() 공개 정적인 메소드

public static voidNoValidate ( $transactionId )