PayplansOrder object allows you to perform lots of actions without writing a single query on Order entity.
Get Buyer of an Order-
function getBuyer($instance=false)
return user who subscribe this order. If $instance is false then return only Buyer Id, else return the instance of the Buyer.
Get Order Status-
function getStatus()
return status of the Order.
Get Plan for which that order is created-
function getPlans($requireInstance = false)
return Plan for which that order is created. If $requireInstance is false then it returns Plan-Id, else returns Plan's Instance.
Get date on which Order is created-
function getCreatedDate()
return date on which Order was created.
Get Discount applied on the Order-
function getDiscount()
return the amount of discount applied on the order.
Get Tax applied on the Order-
function getTaxAmount()
return amount of tax applied on the Order.
Get Tax Rate applied on the Order-
function getTaxRate()
return Tax Rate applied on the Order.
Get Total Order Cost-
function getTotal()
return Total Order Cost after applying tax and discount.
Add Subscription to the Order-
function addSubscription(PayplansIfaceOrderable $subscription)
$subscription = Instance of PayPlansSubscription
This function is used to add Subscription to the Order.
Add Payment to the Order-
function addPayment(PayplansPayment $item)
$item = Instance of PayPlansPayment
This function is used to add Payment to the Order.
Create Payment for the Order-
function createPayment($appId, $checkFirstPayment=false)
$appId = Id of the Payment App
$checkFirstPayment = It is true if the Payment is first Recurring Payment, else false.
Create Payment for the Order and return an Instance of the Order.
Confirm the Order-
function confirm($appId)
$appId = Id of Payment Gateway App
This function create payment for the Order and change the Status of Order to Order-Confirmed.
Complete the Order-
function complete()
This function completes the Order and change its Status to Order-Complete.