src/Resource/Orders.php
public function addReceiver($moipAccount, $type, $fixed = null, $percentual = null, $feePayor = false)
    {
        $receiver = new stdClass();
        $receiver->moipAccount = new stdClass();
        $receiver->moipAccount->id = $moipAccount;
        if (!empty($fixed)) {
            $receiver->amount = new stdClass();
            $receiver->amount->fixed = $fixed;
        }
        if (!empty($percentual)) {
            $receiver->amount = new stdClass();
            $receiver->amount->percentual = $percentual;
        }
        $receiver->feePayor = $feePayor;
        $receiver->type = $type;

        $this->data->receivers[] = $receiver;

        return $this;
    }
public function addReceiver($moipAccount, $type, $fixed = null, $percentual = null, $feePayor = false)
    {
        $receiver = new stdClass();
        $receiver->moipAccount = new stdClass();
        $receiver->moipAccount->id = $moipAccount;
        if (!empty($fixed)) {
            $receiver->amount = new stdClass();
            $receiver->amount->fixed = $fixed;
        }
        if (!empty($percentual)) {
            $receiver->amount = new stdClass();
            $receiver->amount->percentual = $percentual;
        }
        $receiver->feePayor = $feePayor;
        $receiver->type = $type;

        $this->data->receivers[] = $receiver;

        return $this;
    }
public function addReceiver ( $ moipAccount , $ type , $ fixed = null , $ percentual = null , $ feePayor = false ) { $ receiver = new stdClass ( ) ; $ receiver -> moipAccount = new stdClass ( ) ; $ receiver -> moipAccount -> id = $ moipAccount ; if ( ! empty ( $ fixed ) ) { $ receiver -> amount = new stdClass ( ) ; $ receiver -> amount -> fixed = $ fixed ; } if ( ! empty ( $ percentual ) ) { $ receiver -> amount = new stdClass ( ) ; $ receiver -> amount -> percentual = $ percentual ; } $ receiver -> feePayor = $ feePayor ; $ receiver -> type = $ type ; $ this -> data -> receivers [ ] = $ receiver ; return $ this ; }
Adds a new receiver to order.

@param string $moipAccount Id MoIP MoIP account that will receive payment values.
@param string $type        Define qual o tipo de recebedor do pagamento, valores possíveis: PRIMARY, SECONDARY.
@param int    $fixed       Value that the receiver will receive.
@param int    $percentual  Percentual value that the receiver will receive. Possible values: 0 - 100
@param bool   $feePayor    Flag to know if receiver is the payer of Moip tax.

@return $this
Adds a new receiver to order .