Add a Merchant Payment to the given application. Amount should be supplied in pence.

@author SL
@param string $application
@param \DateTime $effectiveDate
@param int $amount
@param string $token
@return array
504303
public function addMerchantPayment($application, \DateTime $effectiveDate, $amount, $token)
    {
        return $this->postDocument(
            '/v4/applications/' . $application . '/merchant-payments',
            [
                'amount' => $amount,
                'effective_date' => $effectiveDate->format('Y-m-d'),
            ],
            $token,
            'Add Merchant Payment'
        );
    }
166182
public function addCredits($customerId, $amount)
    {
        $requestData = new AddCredits\RequestData($customerId, $amount);
        $request = new AddCredits\Request($requestData);

        return $this->sendRequest($request, AddCredits\ApiResponse::class);
    }
748809
public function getCreditCardUiWithData(
        $transaction,
        $paymentAction,
        $language = 'en'
    ) {
        $config = $this->config->get($transaction::NAME);
        $merchantAccountId = $config->getMerchantAccountId();
        $secret = $config->getSecret();
        $isThreeD = false;
        $amount = $transaction->getAmount();

        if ($transaction instanceof CreditCardTransaction) {
            $isThreeD = is_null($config->getMerchantAccountId()) || ($config->getThreeDMerchantAccountId() &&
                ($transaction->isFallback() || $transaction->getThreeD())) ? true : false;
            $merchantAccountId = $isThreeD ? $config->getThreeDMerchantAccountId() : $config->getMerchantAccountId();
            $secret = $isThreeD ? $config->getThreeDSecret() : $config->getSecret();
        }

        $transactionType = 'tokenize';

        if (!is_null($amount) && $amount->getValue() > 0) {
            $transactionType = $paymentAction;
        }

        $requestData = array(
            'request_time_stamp' => gmdate('YmdHis'),
            self::REQUEST_ID => call_user_func($this->requestIdGenerator, 64),
            'transaction_type' => $transactionType,
            'merchant_account_id' => $merchantAccountId,
            'requested_amount' => is_null($amount) ? 0 : $amount->getValue(),
            'requested_amount_currency' => is_null($amount) ? 'EUR' : $amount->getCurrency(),
            'locale' => $language,
            'payment_method' => 'creditcard',
            'attempt_three_d' => $isThreeD ? true : false,
        );

        $requestData = $this->requestMapper->mapSeamlessRequest($transaction, $requestData);

        $requestData['request_signature'] = $this->toSha256($requestData, $secret);

        $this->getLogger()->debug('Seamless request body: ' . json_encode($requestData));

        return json_encode($requestData);
    }
76783
protected function addPayment($params, $amount, $payment, $options)
    {
        return array_merge($params, [
            'payment' => [
                'external' => [
                    'transaction'     => Arr::get($options, 'reference'),
                    'application_key' => $this->gateway->getApplicationKey(),
                ],
                'reference' => [
                    'number'      => Arr::get($options, 'reference'),
                    'description' => Arr::get($options, 'description'),
                ],
                'total' => [
                    'amount'   => $this->gateway->amount($amount),
                    'currency' => Arr::get($options, 'currency', $this->gateway->getCurrency()),
                ],
                'origin'    => [
                    'ip'       => Arr::get($options, 'ip', ''),
                    'location' => [
                        'latitude'  => Arr::get($options, 'latitude', '0.00000'),
                        'longitude' => Arr::get($options, 'longitude', '0.00000'),
                    ],
                ],
            ],
            'recurrent' => $payment,
            'total'     => [
                'amount' => $this->gateway->amount($amount),
            ],
        ]);
    }
1361504
public function checkWebPayment($token, $transactionId)
    {
        $requestPayment = new Structure\RequestPaymentDetails($token, $transactionId);

        $this->response = parent::checkWebPayment($this->entity, $requestPayment);

        /**
         * Checks the state of the platform integration.
         */
        if (Exception\IntegrationState::check($this->response->requestState)) {
            throw new Exception\IntegrationState($this->response->requestState);
        }

        if ($this->response->requestState->state == 0) {
            throw new Exception\IntegrationResponse(
                $this->response->requestState->message,
                $this->response->requestState->code
            );
        }

        return $this->response;
    }
249609
public function authorize($amount = null)
    {
        return (new AuthorizationBuilder(TransactionType::AUTH, $this))
                        ->withAmount($amount)
                        ->withOneTimePayment(true);
    }
71796
public function void($paymentId, $amount){
        $uri = Braspag::$apiBase . "sales/{$paymentId}/void"; 
        
        if($amount != null){
            $uri = $uri . "?amount={$amount}";
        }
        
        $response = Request::put($uri)
            ->sendsJson()
            ->addHeaders($this->headers)
            ->send();
        
        if($response->code == HttpStatus::Ok){    
            
            $voidResponse = new VoidResponse();
            $voidResponse->status = $response->body->Status;
            $voidResponse->reasonCode = $response->body->ReasonCode;
            $voidResponse->reasonMessage = $response->body->ReasonMessage;
            
            $voidResponse->links = $this->parseLinks($response->body->Links);
            
            return $voidResponse;
            
        }elseif($response->code == HttpStatus::BadRequest){            
            Utils::handleApiError($response);            
        }   
        
        return $response->code;
    }
138968
function DoExpressCheckoutPayment($token, $payerId, $options = array()) {
    $values = array_merge($options, array('TOKEN'   => $token,
                                          'PAYERID' => $payerId));
    if (PAYPAL_DEV_MODE == 'true') $this->log('DoExpressCheckout - breakpoint 1 - ['.$token  . ' ' . $payerId . ' ' . "]\n\n[" . print_r($values, true) .']', $token);

    if ($this->_mode == 'payflow') {
      $values['ACTION'] = 'D'; /* ACTION=D denotes DoExpressCheckoutPayment via Payflow */
      $values['TENDER'] = 'P';
      $values['TRXTYPE'] = $this->_trxtype;
      $values['NOTIFYURL'] = zen_href_link('ipn_main_handler.php', '', 'SSL',false,false,true);
    } elseif ($this->_mode == 'nvp') {
      if (!isset($values['PAYMENTACTION']) || $this->checkHasApiCredentials() === FALSE) $values['PAYMENTACTION'] = ($this->_trxtype == 'S' || ($this->checkHasApiCredentials() === FALSE) ? 'Sale' : 'Authorization');
      $values['NOTIFYURL'] = urlencode(zen_href_link('ipn_main_handler.php', '', 'SSL',false,false,true));
    }
    $this->values = $values;
    $this->notify('NOTIFY_PAYPAL_DOEXPRESSCHECKOUTPAYMENT');
    if (PAYPAL_DEV_MODE == 'true') $this->log('DoExpressCheckout - breakpoint 2 '.print_r($this->values, true), $token);
    return $this->_request($this->values, 'DoExpressCheckoutPayment');
  }
797706
public function ordersPaymentEdit(array $payment, $by = 'id', $site = null)
    {
        if (!count($payment)) {
            throw new \InvalidArgumentException(
                'Parameter `payment` must contains a data'
            );
        }

        $this->checkIdParameter($by);

        if (!array_key_exists($by, $payment)) {
            throw new \InvalidArgumentException(
                sprintf('Order array must contain the "%s" parameter.', $by)
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            sprintf('/orders/payments/%s/edit', $payment[$by]),
            "POST",
            $this->fillSite(
                $site,
                ['payment' => json_encode($payment), 'by' => $by]
            )
        );
    }
1161395
public boolean add(Token token,
                       Transaction transaction)
                    throws ObjectManagerException
    {
        List.Entry entry = addEntry(token, transaction);
        return (entry != null);
    }
1318440
public function void($paymentId, $amount)
    {

        $this->debugData[] = __METHOD__;

        $method = 'PUT';
        $uri = $this->config['apiUri'] . \sprintf('/sales/%s/void', $paymentId);
        $options = [
            'headers' => $this->headers
        ];

        if ($amount) {
            $uri .= sprintf('?amount=%s', (float)$amount);
        }

        $this->debugData[][__LINE__]['method'] = $method;
        $this->debugData[][__LINE__]['uri'] = $uri;
        $this->debugData[][__LINE__]['options'] = $uri;

        try {

            $response = $this->http()->request($method, $uri, $options);

            $this->debugData[][__LINE__]['response'] = $response;

            $result = \json_decode($response->getBody()->getContents(), true);

            $this->debugData[][__LINE__]['result'] = $result;

        } catch (RequestException $e) {

            $result = array(
                'code'=>$e->getCode(),
                'message'=>$e->getMessage()
                );

            $this->debugData[][__LINE__]['exception'] = $e->getMessage();

        }

        return $result;
    }
1247221
public function doReferenceTransaction($transaction, $action, $amount = 0.00)
    {
        $this->setRequestData([
            'REFERENCEID'   => $transaction,
            'PAYMENTACTION' => $action,
            'AMT'           => $amount,
        ]);

        return $this->doPayPalRequest('DoReferenceTransaction');
    }
156687
public function add(string $recipientId, int $amount): self
    {
        $this->transaction->asset['payments'][] = compact('recipientId', 'amount');

        return $this;
    }
1125014
public function writeOff($amount,$userId)
    {
        if (!$this->canPay($amount, $userId)) {
            return false;

        }

        return $this->repository->create([
            'user_id' => $userId,
            'value' => $amount,
            'accepted' => 1,
            'hash' => uniqid('transaction_', true),
            'type' => BalanceTransaction::CONST_TYPE_PAYMENT,
        ]);

    }
419233
public function getBeaconsTotal($token, $event, array $dates)
    {
        $total = 0;

        foreach ($dates as $date) {
            $key = $this->generateEntryKey(
                $token,
                $event,
                $date
            );

            $total += $this->doRedisQuery(function () use ($key) {
                $this
                    ->redis
                    ->get($key . '_total');
            }, 0);
        }

        return $total;
    }
1264907
public function create($amount, $payment, $options = [])
    {
        $params = [];

        $params = $this->addPayment($params, $amount, $payment, $options);

        $params = Encryption::encryptParametersWithString($params);
        $params = $this->addMetadata($params, $amount, $options);

        return $this->gateway->commit('post', $this->gateway->buildUrlFromString('payment/card'), $params);
    }
170014
public function paymentButton(Environment $environment, $text = null, $amount = null, $currency = null, $style = 'btn btn-lg btn-primary')
    {
        return $environment->render('@c975LPayment/fragments/paymentButton.html.twig', array(
                'text' => $text,
                'amount' => $amount,
                'currency' => strtolower($currency),
                'style' => $style,
            ));
    }