Deposit

@throws WirecardCEE_Stdlib_Client_Exception_InvalidResponseException
@return WirecardCEE_QPay_Response_Toolkit_Deposit
507420
public function deposit($iOrderNumber, $iAmount, $sCurrency, $basket=null)
    {
        $this->_requestData[self::COMMAND] = self::$COMMAND_DEPOSIT;

        $this->_setField(self::ORDER_NUMBER, $iOrderNumber);
        $this->_setField(self::AMOUNT, $iAmount);
        $this->_setField(self::CURRENCY, strtoupper($sCurrency));
        $this->_setBasket($basket);

        $this->_fingerprintOrder->setOrder(Array(
            self::CUSTOMER_ID,
            self::SHOP_ID,
            self::TOOLKIT_PASSWORD,
            self::SECRET,
            self::COMMAND,
            self::LANGUAGE,
            self::ORDER_NUMBER,
            self::AMOUNT,
            self::CURRENCY
        ));
        $this->_appendBasketFingerprintOrder($basket);

        return new WirecardCEE_QPay_Response_Toolkit_Deposit($this->_send());
    }
153393
protected function userPayment()
    {
        $refId = Input::get('au');

        if ($this->refId() != $refId) {
            $this->transactionFailed();
            $this->newLog(-30, JahanPayException::$errors[-30]);
            throw new JahanPayException(-30);
        }

        return true;
    }
806078
public function isPaymentValid()
    {
        $isValid = $this->isPaymentActive();

        if ($isValid && !is_null($this->getPrice())) {
            $isValid = $this->checkPriceRange() && $this->checkMinOrderPrice();
        }

        $user = $this->getUser();
        if ($isValid && $user && $user->hasAccount()) {
            $isValid = $this->checkUserGroup();
        }

        if ($isValid && $user && $this->getCheckCountry()) {
            $isValid = $this->checkUserCountry();
        }

        return $isValid;
    }
364821
protected function userPayment()
    {
        $this->refId = Input::get('RefNum');
        $this->trackingCode = Input::get('‫‪TRACENO‬‬');
        $this->cardNumber = Input::get('‫‪SecurePan‬‬');
        $payRequestRes = Input::get('State');
        $payRequestResCode = Input::get('StateCode');

        if ($payRequestRes == 'OK') {
            return true;
        }

        $this->transactionFailed();
        $this->newLog($payRequestResCode, @SamanException::$errors[$payRequestRes]);
        throw new SamanException($payRequestRes);
    }
939529
protected function validate()
    {
        $result = $this->request($action = 'CheckCredits');
        if ((int) $result <= 0) {
            throw new Exception($this->config['codes']['-100']);
        }
        return $result;
    }
1140392
@RequestMapping(value = "/qrpay")
    public void qrPay(
            @RequestParam("orderNumber") String orderNumber,
            HttpServletResponse response){
        try {
            String qrUrl = wepaySupport.qrPay(orderNumber);
            response.sendRedirect(qrUrl);
        } catch (IOException e) {
            log.error("failed to qr pay(orderNumber={}), cause: {}",
                    orderNumber, e.getMessage());
        }
    }
1186866
protected function _getPaymentId()
    {
        /** @var OxpsPaymorrowOxBasket|oxBasket $this */

        $sId = (string) $this->getPaymentId();

        if ( !empty( $sId ) ) {
            $sId = $this->_toUtf( $sId );
        } else {
            $sId = 'PaymentId';
        }

        return $sId;
    }
1343624
public function request()
    {
        //load payments by date
        $this->getPagSeguroAbandoned();

        if ($this->_PagSeguroPaymentList->getTransactions()) {
            foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
                date_default_timezone_set('UTC');
                $order = \UOL\PagSeguro\Helper\Data::getReferenceDecryptOrderID($payment->getReference());
                $order = $this->_order->load($order);
                if ($this->getStoreReference() == \UOL\PagSeguro\Helper\Data::getReferenceDecrypt(
                        $payment->getReference())
                ) {
                    if (!is_null($this->_session->getData('store_id'))) {
                        array_push($this->_arrayPayments, $this->build($payment, $order));
                    }
                    if ($order) {
                        array_push($this->_arrayPayments, $this->build($payment, $order));
                    }
                }
            }
        }
        date_default_timezone_set($this->_timezone->getConfigTimezone());

        return $this->_arrayPayments;
    }
600395
protected function verifyPayment()
    {
        try {
            $soap = new SoapClient($this->serverUrl);
            $response = $soap->verification(
                $this->config->get('gateway.jahanpay.api'),
                $this->amount,
                $this->refId
            );

        } catch(\SoapFault $e) {
            $this->transactionFailed();
            $this->newLog('SoapFault', $e->getMessage());
            throw $e;
        }

        if (intval($response) == 1) {
            $this->transactionSucceed();
            $this->newLog($response, Enum::TRANSACTION_SUCCEED_TEXT);
            return true;
        }

        $this->transactionFailed();
        $this->newLog($response, JahanPayException::$errors[$response]);
        throw new JahanPayException($response);
    }
287953
public function doExpressCheckoutPayment()
    {
        $success = false;
        $order = $this->getPayPalOrder();

        try {
            // updating order state
            if ($order) {
                $order->oePayPalUpdateOrderNumber();
                $session = $this->getSession();
                $basket = $session->getBasket();

                $transactionMode = $this->getTransactionMode($basket);

                $builder = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\DoExpressCheckoutPaymentRequestBuilder::class);
                $builder->setPayPalConfig($this->getPayPalConfig());
                $builder->setSession($session);
                $builder->setBasket($basket);
                $builder->setTransactionMode($transactionMode);
                $builder->setUser($this->getPayPalUser());
                $builder->setOrder($order);

                $request = $builder->buildRequest();

                $payPalService = $this->getPayPalCheckoutService();
                $result = $payPalService->doExpressCheckoutPayment($request);

                $order->finalizePayPalOrder(
                    $result,
                    $session->getBasket(),
                    $transactionMode
                );

                $success = true;
            } else {
                /**
                 * @var $exception \OxidEsales\Eshop\Core\Exception\StandardException
                 */
                $exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'OEPAYPAL_ORDER_ERROR');
                throw $exception;
            }
        } catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) {
            // deleting order on error
            if ($order) {
                $order->deletePayPalOrder();
            }

            $this->_iLastErrorNo = \OxidEsales\Eshop\Application\Model\Order::ORDER_STATE_PAYMENTERROR;
            $utilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();
            $utilsView->addErrorToDisplay($exception);
        }

        return $success;
    }
6402
def authorize_and_capture
      
      resp = StdClass.new                        
      if self.financial_status == Invoice::FINANCIAL_STATUS_CAPTURED
        resp.error = "Funds for this invoice have already been captured."
      else
                        
        sc = self.site.store_config                
        case sc.pp_name                                    
          when StoreConfig::PAYMENT_PROCESSOR_STRIPE
                                                                              
            Stripe.api_key = sc.stripe_secret_key.strip
            bt = nil
            begin
              c = Stripe::Charge.create(
                :amount => (self.total * 100).to_i,
                :currency => 'usd',
                :customer => self.customer.stripe_customer_id,
                :capture => true,
                :metadata => { :invoice_id => self.id },
                :statement_descriptor => "#{self.site.description.truncate(22)}"
              )                        
            rescue Exception => ex
              resp.error = "Error during capture process\n#{ex.message}"                
            end            
            if resp.error.nil?
              InvoiceTransaction.create(
                :invoice_id => self.id,
                :transaction_id => c.id,
                :transaction_type => InvoiceTransaction::TYPE_AUTHCAP,
                :payment_processor => sc.pp_name,
                :amount => c.amount / 100.0,
                :captured => true,
                :date_processed => DateTime.now.utc,
                :success => c.status == 'succeeded'
              )
              if c.status == 'succeeded'
                self.financial_status = Invoice::FINANCIAL_STATUS_CAPTURED
                self.save
                resp.success = true
              else
                resp.error = "Error capturing funds."
              end
            end
                      
        end        
      end      
      return resp
    end
1098657
public Wepay init(){
        pays = new Pays(this);
        orders = new Orders(this);
        refunds = new Refunds(this);
        notifies = new Notifies(this);
        bills = new Bills(this);
        if (certs != null && !Strings.isNullOrEmpty(certPasswd)){
            sslSocketFactory = initSSLSocketFactory();
        }
        return this;
    }
669686
protected function submitPayment()
    {
        if ($this->controller->isPosted('pay')) {

            $gateway = $this->getGateway();
            $gateway->setDemoMode((bool) $this->getModuleSetting('test'));
            $gateway->setCurrency($this->data_order['currency']);
            $gateway->setSecretWord($this->getModuleSetting('secretWord'));
            $gateway->setAccountNumber($this->getModuleSetting('accountNumber'));

            $cart = array(array(
                'quantity' => 1,
                'type' => 'product',
                'price' => $this->data_order['total_formatted_number'],
                'name' => $this->controller->text('Order #@num', array('@num' => $this->data_order['order_id']))
            ));

            $gateway->setCart($cart);

            $this->response = $gateway->purchase($this->getPurchaseParams())->send();

            if ($this->response->isRedirect()) {
                $this->response->redirect();
            } else if (!$this->response->isSuccessful()) {
                $this->redirectError();
            }
        }
    }
50065
def get_deposits(self, account_id, **params):
        """"""
        response = self._get('v2', 'accounts', account_id, 'deposits', params=params)
        return self._make_api_object(response, Deposit)
1238571
function DoDirectPayment($cc, $cvv2 = '', $exp, $fname = null, $lname = null, $cc_type, $options = array(), $nvp = array() ) {
    $values = $options;
    $values['ACCT'] = $cc;
    if ($cvv2 != '') $values['CVV2'] = $cvv2;
    $values['FIRSTNAME'] = $fname;
    $values['LASTNAME'] = $lname;
    if (isset($values['NAME'])) unset ($values['NAME']);

    if ($this->_mode == 'payflow') {
      $values['EXPDATE'] = $exp;
      $values['TENDER'] = 'C';
      $values['TRXTYPE'] = $this->_trxtype;
      $values['VERBOSITY'] = 'MEDIUM';
      $values['NOTIFYURL'] = zen_href_link('ipn_main_handler.php', '', 'SSL',false,false,true);
    } elseif ($this->_mode == 'nvp') {
      $values = array_merge($values, $nvp);
      if (isset($values['ECI'])) {
        $values['ECI3DS'] = $values['ECI'];
        unset($values['ECI']);
      }
      $values['CREDITCARDTYPE'] = ($cc_type == 'American Express') ? 'Amex' : $cc_type;
      $values['NOTIFYURL'] = urlencode(zen_href_link('ipn_main_handler.php', '', 'SSL',false,false,true));
      if (!isset($values['PAYMENTACTION'])) $values['PAYMENTACTION'] = ($this->_trxtype == 'S' ? 'Sale' : 'Authorization');

      if (isset($values['COUNTRY'])) unset ($values['COUNTRY']);
      if (isset($values['COMMENT1'])) unset ($values['COMMENT1']);
      if (isset($values['COMMENT2'])) unset ($values['COMMENT2']);
      if (isset($values['CUSTREF'])) unset ($values['CUSTREF']);
    }
    $this->values = $values;
    $this->notify('NOTIFY_PAYPAL_DODIRECTPAYMENT');
    ksort($this->values);
    return $this->_request($this->values, 'DoDirectPayment');
  }
148487
protected function verifyPayment()
    {
        try {

            /** Get the payment ID before session clear **/
            $payment_id = \Session::get('paypal_payment_id');
            /** clear the session payment ID **/
            \Session::forget('paypal_payment_id');
            if (!$this->refId() || !$this->trackingCode()) {
                return false;
            }
            $payment = Payment::get($payment_id, $this->_api_context);
            /** PaymentExecution object includes information necessary **/
            /** to execute a PayPal account payment. **/
            /** The payer_id is added to the request query parameters **/
            /** when the user is redirected from paypal back to your site **/
            $execution = new PaymentExecution();
            $execution->setPayerId($this->refId);
            /**Execute the payment **/
            $result = $payment->execute($execution, $this->_api_context);
            /** dd($result);exit; /** DEBUG RESULT, remove it later **/
            if ($result->getState() == 'approved') {

                /** it's all right **/
                /** Here Write your database logic like that insert record or value in database if you want **/

//            \Session::put('success','Payment success');
                return true;
            }

            return false;
        } catch (\Exception $e) {
            $this->transactionFailed();
            $this->newLog('PaypalException', $e->getMessage());
            throw $e;
        }
    }
1174947
protected function verifyPayment()
	{

		$fields = array(
			'MerchantID' => $this->config->get('gateway.zarinpal.merchant-id'),
			'Authority' => $this->refId,
			'Amount' => $this->amount,
		);

		try {
			$soap = new SoapClient($this->serverUrl, ['encoding' => 'UTF-8']);
			$response = $soap->PaymentVerification($fields);

		} catch (\SoapFault $e) {
			$this->transactionFailed();
			$this->newLog('SoapFault', $e->getMessage());
			throw $e;
		}

		if ($response->Status != 100 && $response->Status != 101) {
			$this->transactionFailed();
			$this->newLog($response->Status, ZarinpalException::$errors[$response->Status]);
			throw new ZarinpalException($response->Status);
		}

		$this->trackingCode = $response->RefID;
		$this->transactionSucceed();
		$this->newLog($response->Status, Enum::TRANSACTION_SUCCEED_TEXT);
		return true;
	}