PHP 클래스 OrderProcessor, silvershop-core

Placing, Emailing Reciepts, Status Updates, Printing, Payments - things you do with a completed order.
파일 보기 프로젝트 열기: burnbright/silverstripe-shop 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$error string
$notifier OrderEmailNotifier
$order Order

공개 메소드들

메소드 설명
__construct ( Order $order ) Assign the order to a local variable
canPlace ( Order $order ) Determine if an order can be placed.
completePayment ( ) Complete payment processing - send receipt - update order status accordingling - fire event hooks
config ( )
create ( Order $order ) Static way to create the order processor.
createPayment ( $gateway ) Create a new payment for an order
getError ( )
getOrder ( ) : Order
getReturnUrl ( ) : String URL to display success message to the user.
makePayment ( string $gateway, array $gatewaydata = [], string $successUrl = null, string $cancelUrl = null ) : SilverStripe\Omnipay\Service\ServiceResponse | null Create a payment model, and provide link to redirect to external gateway, or redirect to order link.
placeOrder ( ) : boolean Takes an order from being a cart to awaiting payment.

보호된 메소드들

메소드 설명
error ( $message )
getGatewayData ( array $customData ) : array Map shop data to omnipay fields

메소드 상세

__construct() 공개 메소드

Assign the order to a local variable
public __construct ( Order $order )
$order Order

canPlace() 공개 메소드

Determine if an order can be placed.
public canPlace ( Order $order )
$order Order

completePayment() 공개 메소드

Complete payment processing - send receipt - update order status accordingling - fire event hooks
public completePayment ( )

config() 공개 정적인 메소드

public static config ( )

create() 공개 정적인 메소드

Makes creating a processor easier.
public static create ( Order $order )
$order Order

createPayment() 공개 메소드

Create a new payment for an order
public createPayment ( $gateway )

error() 보호된 메소드

protected error ( $message )

getError() 공개 메소드

public getError ( )

getGatewayData() 보호된 메소드

Map shop data to omnipay fields
protected getGatewayData ( array $customData ) : array
$customData array Usually user submitted data.
리턴 array

getOrder() 공개 메소드

public getOrder ( ) : Order
리턴 Order

getReturnUrl() 공개 메소드

Happens after any potential offsite gateway redirects.
public getReturnUrl ( ) : String
리턴 String Relative URL

makePayment() 공개 메소드

Create a payment model, and provide link to redirect to external gateway, or redirect to order link.
public makePayment ( string $gateway, array $gatewaydata = [], string $successUrl = null, string $cancelUrl = null ) : SilverStripe\Omnipay\Service\ServiceResponse | null
$gateway string the gateway to use
$gatewaydata array the data that should be passed to the gateway
$successUrl string (optional) return URL for successful payments. If left blank, the default return URL will be used @see getReturnUrl
$cancelUrl string (optional) return URL for cancelled/failed payments
리턴 SilverStripe\Omnipay\Service\ServiceResponse | null

placeOrder() 공개 메소드

Takes an order from being a cart to awaiting payment.
public placeOrder ( ) : boolean
리턴 boolean - success/failure

프로퍼티 상세

$error 보호되어 있는 프로퍼티

protected string $error
리턴 string

$notifier 보호되어 있는 프로퍼티

protected OrderEmailNotifier $notifier
리턴 OrderEmailNotifier

$order 보호되어 있는 프로퍼티

protected Order $order
리턴 Order