Get data for details

@param $order
@param $payment
@return string
177524
protected function details($order, $payment, $options = null)
    {
        unset($options);
        return $this->_crypt->encrypt('!QAWRRR$HU%W34tyh59yh544%',
            json_encode([
                'order_id'         => $order->getId(),
                'pagseguro_status' => $payment->getStatus(),
                'pagseguro_id'     => $payment->getCode()
            ])
        );
    }
283681
public function getFor(Payment $payment, $captureId, array $parameters = [])
    {
        return $this->getForId($payment->id, $captureId, $parameters);
    }
664849
public function isPaymentModuleFor(Order $order)
    {
        $model = $this->getModuleModel();

        return $order->getPaymentModuleId() == $model->getId();
    }
978525
protected function getCustomerId($payment) {
		if (!is_string($payment) and $payment instanceof Payment) {
			$payment = $payment->customerId;
		}
		if (is_array($payment) and isset($payment["customerId"])) {
			$payment = $payment["customerId"];
		}
		if (!is_string($payment)) {
			throw new Exception("Given Customer ID is not valid.");
		}
		return $payment;
	}
777859
public OvhOrderDetail order_orderId_details_orderDetailId_GET(Long orderId, Long orderDetailId) throws IOException {
		String qPath = "/me/order/{orderId}/details/{orderDetailId}";
		StringBuilder sb = path(qPath, orderId, orderDetailId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhOrderDetail.class);
	}
1284273
protected function getPaymentIntent($payment)
    {
        $intent = null;

        switch ($payment->Status) {
            // We have to check for both states here, since the notification might come in before the gateway returns
            // if that's the case, the status of the payment will already be set to 'Authorized'
            case 'PendingAuthorization':
            case 'Authorized':
                $intent = ServiceFactory::INTENT_AUTHORIZE;
                break;
            case 'PendingCreateCard':
            case 'CardCreated':
                $intent = ServiceFactory::INTENT_CREATECARD;
                break;
            case 'PendingCapture':
                $intent = ServiceFactory::INTENT_CAPTURE;
                break;
            // Both states have to be checked (see explanation with 'Authorized')
            case 'PendingPurchase':
            case 'Captured':
                $intent = ServiceFactory::INTENT_PURCHASE;
                break;
            case 'PendingRefund':
                $intent = ServiceFactory::INTENT_REFUND;
                break;
            case 'PendingVoid':
            case 'Void':
                $intent = ServiceFactory::INTENT_VOID;
                break;
        }

        return $intent;
    }
1303310
public function fetchTransactionInfo(InfoInterface $payment, $transactionId)
    {
        try {

            $transaction = $this->transactionRepository->getByTransactionId(
                $transactionId,
                $payment->getId(),
                $payment->getOrder()->getId()
            );

            $transactionDetails = $transaction->getAdditionalInformation(Transaction::RAW_DETAILS);
            $transactionReference = $transactionDetails['Reference'];

            if (!empty($transactionReference)) {
                $order = $payment->getOrder();
                $this->orderHelper->updateOrderPayment($order, null, $transactionReference);
            }

        } catch (\Exception $e) {
            $this->bugsnag->notifyException($e);
        } finally {
            return [];
        }
    }
1079513
public function getPaymentMethodTemplate($template, array $order, $payment_model)
    {
        if (empty($order['payment'])) {
            return '';
        }

        $method = $payment_model->get($order['payment']);
        return $this->getMethodTemplate($template, $order, $method);
    }
572916
public function processPayment(Payment $payment)
    {
        $response = $this->postRequest('/api-payment/create', $payment->toJson());

        if ( ! in_array('application/json', $response->getHeader('Content-Type'))) {
            throw new PaymentFailed('Server returned a non-JSON result.');
        }

        $body = json_decode((string)$response->getBody());

        if ($response->getStatusCode() !== 201) {
            throw new PaymentFailed(
                sprintf('Paytrail request failed: %s (%d)', $body->errorMessage, $body->errorCode)
            );
        }

        $result = new Result;
        $result->configure(
            array(
                'orderNumber' => $body->orderNumber,
                'token'       => $body->token,
                'url'         => $body->url,
            )
        );

        return $result;
    }
40020
public function parseOrderDetails()
    {
        // remove previous OrderDetails and OrderOptions so we don't end up with duplicates
        foreach ($this->Details() as $detail) {
            /** @var OrderOption $orderOption */
            foreach ($detail->OrderOptions() as $orderOption) {
                $orderOption->delete();
            }
            $detail->delete();
        }

        $transaction = $this->getTransaction()->getTransaction();

        // Associate ProductPages, Options, Quantity with Order
        foreach ($transaction->transaction_details->transaction_detail as $detail) {
            $OrderDetail = OrderDetail::create();

            $OrderDetail->Quantity = (int)$detail->product_quantity;
            $OrderDetail->ProductName = (string)$detail->product_name;
            $OrderDetail->ProductCode = (string)$detail->product_code;
            $OrderDetail->ProductImage = (string)$detail->image;
            $OrderDetail->ProductCategory = (string)$detail->category_code;
            $priceModifier = 0;

            // parse OrderOptions
            foreach ($detail->transaction_detail_options->transaction_detail_option as $option) {
                // Find product via product_id custom variable
                if ($option->product_option_name == 'product_id') {
                    // if product is found, set relation to OrderDetail
                    $OrderProduct = ProductPage::get()->byID((int)$option->product_option_value);
                    if ($OrderProduct) {
                        $OrderDetail->ProductID = $OrderProduct->ID;
                    }
                } else {
                    $OrderOption = OrderOption::create();
                    $OrderOption->Name = (string)$option->product_option_name;
                    $OrderOption->Value = (string)$option->product_option_value;
                    $OrderOption->write();
                    $OrderDetail->OrderOptions()->add($OrderOption);

                    $priceModifier += $option->price_mod;
                }
            }

            $OrderDetail->Price = (float)$detail->product_price + (float)$priceModifier;

            // extend OrderDetail parsing, allowing for recording custom fields from FoxyCart
            $this->extend('handleOrderItem', $order, $response, $OrderDetail);

            // write
            $OrderDetail->write();

            // associate with this order
            $this->Details()->add($OrderDetail);
        }
    }
575839
public OvhPayment order_orderId_payment_GET(Long orderId) throws IOException {
		String qPath = "/me/order/{orderId}/payment";
		StringBuilder sb = path(qPath, orderId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhPayment.class);
	}
1333383
protected function getTemplateDataFromOrder(\TdbShopOrder $order)
    {
        $data = $order->GetSQLWithTablePrefix($order->table);
        $shop = $order->GetFieldShop();
        $shopData = $shop->GetSQLWithTablePrefix($shop->table);
        $data = array_merge($data, $shopData);

        return $data;
    }
771020
public function PaymentOrderDetail($paymentOrderId, array $addElements = array())
    {
        $request = new Request();
        $request->setMethod('GET');

        if (null == $paymentOrderId) {
            throw new InvalidArgumentException('paymentOrderId');
        }

        $qs = array('Id' => $paymentOrderId);

        if ($addElements) {
            $qs['AddElements'] = implode(',', $addElements);
        }

        return $this->doRequest('PaymentOrder/Detail', $request, $qs)->getContentJson();
    }
29263
public function getPaymentAmountInfo($index = 0)
    {
        $orderStatuses = $this->getOrderStatuses();
        return array_key_exists('paymentAmountInfo', $orderStatuses[$index])
            ? $orderStatuses[$index]['paymentAmountInfo'] : [];
    }
394708
public function updatePaymentDetail(PaymentDetailTransfer $paymentData, $idOrder)
    {
        $this->getFactory()->createPaymentManager()->updatePaymentDetail($paymentData, $idOrder);
    }
661253
public function payGetOrder($order_id)
    {
        $url = "https://api.weixin.qq.com/card/pay/getorder?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['order_id' => $order_id]);
    }
1133647
protected function getPayment(OrderTransfer $orderTransfer)
    {
        $payment = $this->queryContainer->createPaymentByOrderId($orderTransfer->getIdSalesOrder())->findOne();
        $paymentDetail = $payment->getSpyPaymentPayoneDetail();

        $paymentDetailTransfer = new PaymentDetailTransfer();
        $paymentDetailTransfer->fromArray($paymentDetail->toArray(), true);

        $paymentTransfer = new PayonePaymentTransfer();
        $paymentTransfer->fromArray($payment->toArray(), true);
        $paymentTransfer->setPaymentDetail($paymentDetailTransfer);

        return $paymentTransfer;
    }