Settlement.

@param \Paysafe\CardPayments\Settlement $settlement
@return \Paysafe\CardPayments\Settlement
@throws PaysafeException
768571
public function settlement(CardPayments\Settlement $settlement)
    {
        $settlement->setRequiredFields(array('authorizationID'));
        $settlement->checkRequiredFields();
        $settlement->setRequiredFields(array('merchantRefNum'));
        $settlement->setOptionalFields(array(
             'amount',
             'dupCheck',
             'splitpay',
        ));

        $request = new Request(array(
             'method' => Request::POST,
             'uri' => $this->prepareURI("/auths/" . $settlement->authorizationID . "/settlements"),
             'body' => $settlement
        ));
        $response = $this->client->processRequest($request);

        return new CardPayments\Settlement($response);
    }
3218
public function getRefund(CardPayments\Refund $refund)
    {
        $refund->setRequiredFields(array('id'));
        $refund->checkRequiredFields();

        $request = new Request(array(
             'method' => Request::GET,
             'uri' => $this->prepareURI("/refunds/" . $refund->id)
        ));

        $response = $this->client->processRequest($request);
        return new CardPayments\Refund($response);
    }
928502
public function buildPayment()
    {
        $return = null;

        // Setter forms request payment from request parameters.
        $requestOrderPayment = $this->prepareRequestOrderPayment();

        // Create order payment from database to check if it match created from request.
        $orderPayment = $this->loadOrderPayment($requestOrderPayment->getTransactionId());

        // Only need validate if there is order in database.
        // If request payment do not have matching payment with order return null.
        if ($orderPayment->getOrderId()) {
            // Validator change request payment by adding information if it is valid.
            $orderPayment = $this->addPaymentValidationInformation($requestOrderPayment, $orderPayment);
            $orderPayment = $this->changePaymentStatusInfo($requestOrderPayment, $orderPayment);
            $orderPayment->save();
            $return = $orderPayment;
        } else {
            //IPN request might be for a transaction that does not yet exist in the shop database.
            $paymentCreator = $this->getPaymentCreator();
            $return = $paymentCreator->handleOrderPayment($requestOrderPayment);
        }

        return $return;
    }
474158
public function product(Product $product): Money
    {
        if ($product->quantity >= $this->quantity) {
            return $this->rate->product($product);
        }

        return new Money(0, $product->price->getCurrency());
    }
892661
public function refundToBuyer($refundAmount, $refundCurrency)
    {
        $refund = new OffAmazonPaymentsService_Model_Price();
        $refund->setCurrencyCode($refundCurrency);
        $refund->setAmount($refundAmount);
        
        $refundRequest = new OffAmazonPaymentsService_Model_RefundRequest();
        $refundRequest->setSellerId($this->_sellerId);
        $refundRequest->setAmazonCaptureId($this->_amazonCaptureId);
        $refundRequest->setRefundReferenceId($this->_refundReferenceId);
        $refundRequest->setRefundAmount($refund);
        
        return $this->_service->refund($refundRequest);
    }
1012106
public static function resolve($value)
    {
        switch (strtolower($value)) {
            case self::NEWEST:
                return self::NEWEST;
            case self::AUTHORIZED:
                return self::AUTHORIZED;
            case self::NOT_AUTHORIZED:
                return self::NOT_AUTHORIZED;
            case self::PAID:
                return self::PAID;
            case 'canceled':
            case self::CANCELLED:
                return self::CANCELLED;
            case self::WAITING:
                return self::WAITING;
        }

        return null;
    }
761170
public function cancelSettlement(CardPayments\Settlement $settlement)
    {
        $settlement->setRequiredFields(array('id'));
        $settlement->checkRequiredFields();

        $tmpSettlement = new CardPayments\Settlement(array(
             'status' => 'CANCELLED'
        ));
        $request = new Request(array(
             'method' => Request::PUT,
             'uri' => $this->prepareURI("/settlements/" . $settlement->id),
             'body' => $tmpSettlement
        ));
        $response = $this->client->processRequest($request);

        return new CardPayments\Settlement($response);
    }
117488
public function settle(IncomingInvoice $invoiceA, IncomingInvoice $invoiceB)
    {
        return $this->connector->settle($invoiceA, $invoiceB);
    }
92461
public function create($amount, $payment, $options = [])
    {
        $params = [
            'type'   => 'charge',
            'amount' => $amount,
            'status' => new Status('pending'),
        ];

        return $this->gateway->commit(null, null, $params);
    }
288847
def settlements(ctx, asset, limit):
    
    from bitshares.asset import Asset

    asset = Asset(asset, full=True)
    if not asset.is_bitasset:
        print_message("{} is not a bitasset.".format(asset["symbol"]), "warning")
        sys.exit(1)
    calls = asset.get_settle_orders(limit)
    t = [["acount", "amount", "date"]]
    for call in calls:
        t.append([str(call["account"]["name"]), str(call["amount"]), str(call["date"])])
    print_table(t)
308230
public function addPaymentTransaction(PaymentTransaction $paymentTransaction)
    {
        if (!$this->hasPaymentTransaction($paymentTransaction))
        {
            $this->paymentTransactions[] = $paymentTransaction;
        }

        if ($paymentTransaction->getPayment() !== $this)
        {
            $paymentTransaction->setPayment($this);
        }

        return $this;
    }
712926
public function setPayment(\HarvestCloud\CoreBundle\Entity\Payment\Payment $payment = null)
    {
        $this->payment = $payment;

        return $this;
    }
968027
def payments
      return @payments if @payments

      @payments = []
      begin
        if dm_hash["Report"]["Pays"]
          pays = dm_hash["Report"]["Pays"]["Pay"]

          if pays
            case pays.class.name
            when "Hash"
              @payments << Payment.new(pays)
            when "Array"
              pays.each { |pay| @payments << Payment.new(pay) }
            end
          end
        end
      rescue Exception => e
        raise MalformedResponseError.new("Error procesando pagos: #{e.message}")
      end
      @payments
    end
1046992
public function refund(CardPayments\Refund $refund)
    {
        $refund->setRequiredFields(array('settlementID'));
        $refund->checkRequiredFields();
        $refund->setRequiredFields(array('merchantRefNum'));
        $refund->setOptionalFields(array(
             'amount',
             'dupCheck',
             'splitpay',
        ));

        $request = new Request(array(
             'method' => Request::POST,
             'uri' => $this->prepareURI("/settlements/" . $refund->settlementID . "/refunds"),
             'body' => $refund
        ));

        $response = $this->client->processRequest($request);

        return new CardPayments\Refund($response);
    }
19029
public function processPayment()
    {
        $gestpayMethod = new GestpayMethod();

        /*
         * At this point, order must be created given a cart, and placed in PaymentBridge.
         *
         * So, $this->paymentBridge->getOrder() must return an object
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderLoad(
                $this->paymentBridge,
                $gestpayMethod
            );

        /*
         * Order Not found Exception must be thrown just here.
         */
        if (!$this->paymentBridge->getOrder()) {
            throw new PaymentOrderNotFoundException();
        }

        /*
         * Order exists right here.
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderCreated(
                $this->paymentBridge,
                $gestpayMethod
            );

        return $this->gestpayEncrypter->encryptedUrl();
    }
935061
protected function createPayment($response)
    {
        $payment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
        $payment->setDate($this->getDate());
        $payment->setTransactionId($response->getTransactionId());
        $payment->setCorrelationId($response->getCorrelationId());
        $payment->setAction('capture');
        $payment->setStatus($response->getPaymentStatus());
        $payment->setAmount($response->getCapturedAmount());
        $payment->setCurrency($response->getCurrency());

        return $payment;
    }
169109
public function processPayment()
    {
        $paymentMethod = $this
            ->methodFactory
            ->create();

        /**
         * At this point, order must be created given a card, and placed in
         * PaymentBridge.
         *
         * So, $this->paymentBridge->getOrder() must return an object
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderLoad(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Order exists right here.
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderCreated(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Payment paid done.
         *
         * Paid process has ended (No matters result)
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderDone(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Payment paid successfully.
         *
         * Paid process has ended successfully
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderSuccess(
                $this->paymentBridge,
                $paymentMethod
            );

        return $this;
    }