-
Notifications
You must be signed in to change notification settings - Fork 25
HasProducts Trait
Nikola Gavrić edited this page Oct 23, 2019
·
2 revisions
All methods:
- charge
- hasAttribute
- hasDiscount
- hasTax
- hasProduct
All relationships:
- products
- taxes
- discounts
/**
* Charge an order.
*
* @param float $amount
* @param string $nonce
* @param string $location_id
* @param mixed $merchant
* @param array $options Can contain ['note', 'reference_id']
* What these 2 represent you can read on this url below
* https://github.com/NikolaGavric94/laravel-square/wiki/Square%20Facade#square-facade
* @param mixed $customer
* @param string $currency
*
* @return \Nikolag\Square\Models\Transaction
*/
public function charge(float $amount, string $nonce, string $location_id, $merchant, array $options = [], $customer = null, string $currency = 'USD')
/**
* Check existence of an attribute in model
*
* @param string $attribute
*
* @return bool
*/
public function hasAttribute(string $attribute) {}
/**
* Does an order have a discount
*
* @param mixed $discount
*
* @return bool
*/
public function hasDiscount($discount) {}
/**
* Does an order have a tax
*
* @param mixed $tax
*
* @return bool
*/
public function hasTax($tax) {}
/**
* Does an order have a product
*
* @param mixed $product
*
* @return bool
*/
public function hasProduct($product) {}
/**
* Return a list of products which are included in this order.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function products() {}
/**
* Return a list of taxes which are in included in this order.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany
*/
public function taxes() {}
/**
* Return a list of discounts which are in included in this order.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany
*/
public function discounts() {}