Create new invoice using transaction_id from check
@param Twisto $twisto
@param string $transaction_id
@param string $eshop_invoice_id
@return Invoice
971571
public static function create(Twisto $twisto, $transaction_id, $eshop_invoice_id = null)
    {
        $data = array(
            'transaction_id' => $transaction_id
        );

        if ($eshop_invoice_id !== null) {
            $data['eshop_invoice_id'] = $eshop_invoice_id;
        }

        $data = $twisto->requestJson('POST', 'invoice/', $data);
        $invoice = new Invoice($twisto, null);
        $invoice->deserialize($data);
        return $invoice;
    }
227220
public function upcomingInvoice(): ?Invoice
    {
        try {
            $stripeInvoice = StripeInvoice::upcoming(
                ['customer' => $this->stripe_id], ['api_key' => $this->getStripeKey()]
            );

            return new Invoice($this, $stripeInvoice);
        } catch (InvalidRequest $e) {
        }
    }
911480
private J2EETransactionImpl newInternTransaction()
    {
        if (log.isDebugEnabled()) log.debug("obtain new intern odmg-transaction");
        J2EETransactionImpl tx = new J2EETransactionImpl(this);
        try
        {
            getConfigurator().configure(tx);
        }
        catch (ConfigurationException e)
        {
            throw new OJBRuntimeException("Cannot create new intern odmg transaction", e);
        }
        return tx;
    }
1219336
@Override
	@Transactional(enabled = false)
	public CommerceOrder createCommerceOrder(long commerceOrderId) {
		return commerceOrderPersistence.create(commerceOrderId);
	}
1351176
public function create_booking_stripe_payment_post(
      VO\Integer $booking_id = null,
      VO\StringVO $transaction_id = null,
      VO\StringVO $payment_status = null

      )
    {
      $request = new Request(
          new GuzzleClient,
          $this->credentials,
          VO\HTTP\Url::fromNative($this->base_url . '/classroom/agent/book/stripe_payment'),
          new VO\HTTP\Method('POST')
      );

      $request_parameters = array();

      if (!is_null($booking_id)) {
          $request_parameters['booking_id'] = $booking_id->__toInteger();
      }

      if (!is_null($transaction_id)) {
          $request_parameters['transaction_id'] = $transaction_id->__toString();
      }

      if (!is_null($payment_status)) {
          $request_parameters['payment_status'] = $payment_status->__toString();
      }


      $response = $request->send($request_parameters);

      return $response->get_data();
    }
666908
function create($txn = true) {
		if ($txn && !($txn instanceof pq\Transaction)) {
			$txn = $this->table->getConnection()->startTransaction();
		}
		try {
			foreach ($this->rows as $row) {
				$row->create();
			}
		} catch (\Exception $e) {
			if ($txn) {
				$txn->rollback();
			}
			throw $e;
		}
		if ($txn) {
			$txn->commit();
		}
		return $this;
	}
575469
def cancel_invoice(self, invoice_id):
        
        return self._create_put_request(
            resource=INVOICES,
            billomat_id=invoice_id,
            command=CANCEL,
        )
1305375
public function ecommerceAddTransaction(
        $id,
        $affiliation = null,
        $revenue = null,
        $shipping = null,
        $tax = null,
        $currency = null
    )
    {
        // Call to enable ecommerce tracking automatically
        $this->enableEcommerceTracking();

        $parameters = ['id' => $id];

        if (!is_null($affiliation)) {
            $parameters['affiliation'] = $affiliation;
        }

        if (!is_null($revenue)) {
            $parameters['revenue'] = $revenue;
        }

        if (!is_null($shipping)) {
            $parameters['shipping'] = $shipping;
        }

        if (!is_null($tax)) {
            $parameters['tax'] = $tax;
        }

        if (!is_null($currency)) {
            $parameters['currency'] = $currency;
        }

        $jsonParameters = json_encode($parameters);
        $trackingCode = "ga('ecommerce:addTransaction', {$jsonParameters});";

        $this->trackingBag->add($trackingCode);

        return $this;
    }
751711
public RefundQueryResponse queryByTransactionId(String transactionId){
        Map<String, String> queryParams = buildQueryParams(WepayField.TRANSACTION_ID, transactionId);
        Map<String, Object> respData = doPost(QUERY, queryParams);
        return renderQueryResp(respData);
    }
944491
public function checkPayment($transaction_id)
    {
        // Check arguments
        if (null === $transaction_id || !is_string($transaction_id) || strlen(trim($transaction_id)) == 0) {
            throw new \InvalidArgumentException('Transaction ID should be a string.');
        }

        // Params
        $params = array(
            'partnerid' => $this->partnerId,
            'transaction_id' => $transaction_id,
        );

        // Do request
        $response = $this->request('check-status/', $params);

        // Gather data
        if ($response->order === null) {
            throw new MollieException('Unexpected response');
        }
        $transactionId = (string) $response->order->transaction_id;
        $amount = (int) $response->order->amount;
        $paid = ((string) $response->order->paid == 'true');
        $status = (string) $response->order->status;

        // Return TransactionStatus
        return new TransactionStatus($amount, $paid, $transactionId, $status);
    }
673327
public function createFromCart( $order, $cart, $config = [] ) {

		// Init Transaction
		$transaction = Yii::$app->db->beginTransaction();

		// Set Attributes
		$billingAddress		= isset( $config[ 'billingAddress' ] ) ? $config[ 'billingAddress' ] : null;
		$shippingAddress	= isset( $config[ 'shippingAddress' ] ) ? $config[ 'shippingAddress' ] : null;

		// Order
		$order->parentId	= $cart->parentId;
		$order->parentType	= $cart->parentType;
		$order->type		= $cart->type;
		$order->status		= $order->status ?? Order::STATUS_NEW;

		// Generate UID if required
		if( !isset( $order->title ) ) {

			$order->generateTitle();
		}

		// Set Order Totals
		$order->subTotal	= $cart->getCartTotal();
		$order->discount	= 0;
		$order->tax			= 0;
		$order->shipping	= 0;
		$order->total		= $order->subTotal + $order->tax + $order->shipping;
		$order->grandTotal	= $order->total - $order->discount;

		try {

			// Create Order
			$order->save();

			// Create Billing Address
			if( isset( $billingAddress ) ) {

				$this->modelAddressService->createOrUpdateByType( $billingAddress, [ 'parentId' => $order->id, 'parentType' => CartGlobal::TYPE_ORDER, 'type' => Address::TYPE_BILLING ] );
			}

			// Create Shipping Address
			if( !$order->shipToBilling && isset( $shippingAddress ) ) {

				$this->modelAddressService->createOrUpdateByType( $shippingAddress, [ 'parentId' => $order->id, 'parentType' => CartGlobal::TYPE_ORDER, 'type' => Address::TYPE_SHIPPING ] );
			}

			// Create Order Items
			$cartItems	= $cart->activeItems;

			foreach ( $cartItems as $item ) {

				$this->orderItemService->createFromCartItem( $order, $item, $config );
			}

			// Delete Cart & Cart Items
			$this->cartService->delete( $cart );

			// Commit Order
			$transaction->commit();
		}
		catch( Exception $e ) {

			$transaction->rollBack();

			return false;
		}

		// Return Order
		return $order;
	}
377891
public function captureTransaction($location_id, $transaction_id)
    {
        list($response, $statusCode, $httpHeader) = $this->captureTransactionWithHttpInfo ($location_id, $transaction_id);
        return $response; 
    }
851393
def init_cart            
      # Check if the cart ID is defined and that it exists in the database
      create_new_invoice = false
      if session[:cart_id]
        @invoice = Caboose::Invoice.where(:id => session[:cart_id]).first
        create_new_invoice = true if @invoice.nil? || @invoice.status != 'cart'                    
      else                        
        create_new_invoice = true                         
      end

      if create_new_invoice # Create an invoice to associate with the session        
        @invoice = Caboose::Invoice.new        
        @invoice.site_id          = @site ? @site.id : nil
        @invoice.status           = Caboose::Invoice::STATUS_CART
        @invoice.financial_status = Caboose::Invoice::STATUS_PENDING
        @invoice.date_created     = DateTime.now
        @invoice.referring_site   = request.env['HTTP_REFERER']
        @invoice.landing_page     = request.fullpath
        @invoice.landing_page_ref = params[:ref] || nil
        @invoice.payment_terms    = @site.store_config.default_payment_terms
        @invoice.save
        
        InvoiceLog.create(
          :invoice_id     => @invoice.id,          
          :user_id        => logged_in_user.id,
          :date_logged    => DateTime.now.utc,
          :invoice_action => InvoiceLog::ACTION_INVOICE_CREATED                
        )
        
        # Save the cart ID in the session
        session[:cart_id] = @invoice.id
      end                  
    end
397653
public static function create($transactionID, $sum, $params = [])
    {
        $transaction = new self;
        $transaction->setTransactionID($transactionID)
            ->setSum($sum)
            ->setCurrency(PaymentHandlerBase::DEFAULT_CURRENCY)
            ->setLanguage(PaymentHandlerBase::DEFAULT_LANGUAGE);
        foreach ($params as $key => $value)
        {
            $transaction->params[$key] = $value;
        }
        return $transaction;
    }
889327
public function transact($amount, $orderId, $invoiceNumber = null)
    {
        $this->transaction = [
            'amount' => $amount,
            'orderId' => $orderId,
            'invoiceNumber' => $invoiceNumber ?: $orderId,
        ];

        return $this->initiateTransaction();
    }
735462
@Override
	@Transactional(enabled = false)
	public CommerceShipment createCommerceShipment(long commerceShipmentId) {
		return commerceShipmentPersistence.create(commerceShipmentId);
	}
345830
public function phoneDirectCheckout(Icepay_PaymentObject_Interface_Abstract $paymentObj)
    {
        $obj = new StdClass();

        // Must be in specific order for checksum ---------
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $this->getTimeStamp();
        $obj->Amount = $paymentObj->getAmount();
        $obj->Country = $paymentObj->getCountry();
        $obj->Currency = $paymentObj->getCurrency();
        $obj->Description = $paymentObj->getDescription();
        $obj->EndUserIP = $this->getIP();
        $obj->Issuer = $paymentObj->getIssuer();
        $obj->Language = $paymentObj->getLanguage();
        $obj->OrderID = $paymentObj->getOrderID();
        $obj->PaymentMethod = $paymentObj->getPaymentMethod();
        $obj->Reference = $paymentObj->getReference();
        $obj->URLCompleted = $this->getSuccessURL();
        $obj->URLError = $this->getErrorURL();
        $obj->PINCode = $this->getPinCode();

        $obj->Checksum = $this->generateChecksum($obj, $this->getSecretCode());

        $result = $this->client->phoneDirectCheckout(array('request' => $obj));
        $result = $result->PhoneDirectCheckoutResult;

        /* store the checksum momentarily */
        $checksum = $result->Checksum;

        /* Replace the checksum in the data with secretCode to generate a new checksum */
        $result->Checksum = $this->getSecretCode();

        // Reverse Success and Error Description, since order must be specific for Checksum
        $success = $result->Success;
        $errorDescription = $result->ErrorDescription;

        unset($result->Success, $result->ErrorDescription);

        $result->Success = $success;
        $result->ErrorDescription = $errorDescription;

        /* Verify response data */
        if ($checksum != $this->generateChecksum($result))
            throw new Exception("Data could not be verified");

        /* Return mister checksum */
        $result->Checksum = $checksum;

        /* Default return all data */
        return (array) $result;
    }