PHP Класс OrderProcessor, silvershop-core

Placing, Emailing Reciepts, Status Updates, Printing, Payments - things you do with a completed order.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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