Refund
+ Inheritance diagram for Refund:

Description

A refund.

Immutable:
Refunds can only be created.
See also
https://help.shopify.com/en/api/reference/orders/refund

Public Properties

const DIR = 'refunds'
 
const MAP
 
const REASON_CUSTOMER = 'customer'
 
const REASON_DAMAGE = 'damage'
 
const REASON_OTHER = 'other'
 
const REASON_RESTOCK = 'restock'
 
const TYPE = 'refund'
 
- Public Properties inherited from AbstractEntity
const DIR = ''
 All subclasses must redeclare this to match their REST directory (without container). More...
 
const TYPE = ''
 All subclasses must redeclare this to match their types. More...
 
- Public Properties inherited from Data
const MAP = []
 
const PATCH = []
 

Protected Properties

Order $order
 
- Protected Properties inherited from Data
Api $api
 
Pool $pool
 

Public Methods

 __construct (Order $order, array $data=[])
 
magic string getCreatedAt ()
 
magic string getId ()
 
magic string getNote ()
 
Order getOrder ()
 
magic Adjustment[] getOrderAdjustments ()
 
magic string getProcessedAt ()
 
magic RefundItem[] getRefundLineItems ()
 
magic Transaction[] getTransactions ()
 
magic string getUserId ()
 
magic bool hasOrderAdjustments ()
 
magic bool hasRefundLineItems ()
 
magic bool hasTransactions ()
 
RefundItem newItem ()
 
Transaction newTransaction ()
 
magic $this setCurrency (string $currency)
 
magic $this setDiscrepancyReason (string $reason)
 
$this setFullShipping ()
 
magic $this setNote (string $note)
 
magic $this setNotify (bool $notify)
 
magic $this setProcessedAt (string $iso8601)
 
magic $this setRefundLineItems (RefundItem[] $items)
 
$this setShippingAmount (string $amount)
 
magic $this setTransactions (Transaction[] $transactions)
 
magic $this setUserId (string $id)
 
- Public Methods inherited from AbstractEntity
string __toString ()
 
string[] getPoolKeys ()
 
bool hasId ()
 
$this reload ()
 Fully reloads the entity from Shopify. More...
 
- Public Methods inherited from Data
mixed __call (string $method, array $args)
 
 __construct ($caller, array $data=[])
 
string serialize ()
 Dehydrated JSON encode. More...
 
array toArray ()
 
void unserialize ($serialized)
 
- Public Methods inherited from CreateTrait
$this create ()
 

Protected Methods

 _container ()
 The container/owner object, if any. More...
 
- Protected Methods inherited from AbstractEntity
mixed _get (string $field)
 Lazy-loads missing fields. More...
 
void _onDelete ()
 
void _onSave ()
 
void _reload (string $field)
 
- Protected Methods inherited from Data
mixed _hydrate (string $class, $item)
 A factory that also hydrates / caches entities. More...
 
array _select ($subject, callable $filter,... $args)
 Magic method: selectField(callable $filter) More...
 
$this _setData (array $data)
 Clears all diffs and sets all data, hydrating mapped fields. More...
 
$this _setField (string $field, $value)
 Sets a value, hydrating if mapped, and clears the diff. More...
 
- Protected Methods inherited from CreateTrait
string _dir ()
 The POST directory. More...
 

Additional Inherited Members

- Public Static Methods inherited from AbstractEntity
static null self load ($caller, string $id, array $query=[])
 
static self[] loadAll ($caller, string $path, array $query=[])
 

Properties

◆ MAP

const MAP
Initial value:
= [
'order_adjustments' => [Adjustment::class],
'refund_line_items' => [RefundItem::class],
'transactions' => [Transaction::class]
]

Methods

◆ _container()

_container ( )
protected

The container/owner object, if any.

Returns
null|AbstractEntity

Reimplemented from AbstractEntity.

◆ getCreatedAt()

magic string getCreatedAt ( )
Returns
string

◆ getId()

magic string getId ( )
Returns
string

Reimplemented from AbstractEntity.

◆ getNote()

magic string getNote ( )
Returns
string

◆ getOrder()

Order getOrder ( )
Returns
Order

◆ getOrderAdjustments()

magic Adjustment [] getOrderAdjustments ( )
Returns
Adjustment[]

◆ getProcessedAt()

magic string getProcessedAt ( )
Returns
string

◆ getRefundLineItems()

magic RefundItem [] getRefundLineItems ( )
Returns
RefundItem[]

◆ getTransactions()

magic Transaction [] getTransactions ( )
Returns
Transaction[]

◆ getUserId()

magic string getUserId ( )
Returns
string

◆ hasOrderAdjustments()

magic bool hasOrderAdjustments ( )
Returns
bool

◆ hasRefundLineItems()

magic bool hasRefundLineItems ( )
Returns
bool

◆ hasTransactions()

magic bool hasTransactions ( )
Returns
bool

◆ newItem()

RefundItem newItem ( )
Returns
RefundItem

◆ newTransaction()

Transaction newTransaction ( )
Returns
Transaction

◆ setCurrency()

magic $this setCurrency ( string  $currency)
Depends:
create-only
Returns
$this

◆ setDiscrepancyReason()

magic $this setDiscrepancyReason ( string  $reason)
Depends:
create-only
Returns
$this

◆ setFullShipping()

$this setFullShipping ( )
Depends:
create-only
Returns
$this

◆ setNote()

magic $this setNote ( string  $note)
Depends:
create-only
Returns
$this

◆ setNotify()

magic $this setNotify ( bool  $notify)
Depends:
create-only
Returns
$this

◆ setProcessedAt()

magic $this setProcessedAt ( string  $iso8601)
Depends:
create-only
Returns
$this

◆ setRefundLineItems()

magic $this setRefundLineItems ( RefundItem[]  $items)
Depends:
create-only
Returns
$this

◆ setShippingAmount()

$this setShippingAmount ( string  $amount)
Depends:
create-only
Parameters
string$amount
Returns
$this

◆ setTransactions()

magic $this setTransactions ( Transaction[]  $transactions)
Depends:
create-only
Returns
$this

◆ setUserId()

magic $this setUserId ( string  $id)
Depends:
create-only
Returns
$this