@param array $callbackData

@return \Kerox\Messenger\Model\Callback\Payment\PaymentCredential
976760
public static function create(array $callbackData): self
    {
        $tokenizedCard = $callbackData['tokenized_card'] ?? null;
        $tokenizedCvv = $callbackData['tokenized_cvv'] ?? null;
        $tokenExpiryMonth = $callbackData['token_expiry_month'] ?? null;
        $tokenExpiryYear = $callbackData['token_expiry_year'] ?? null;

        return new self(
            $callbackData['provider_type'],
            $callbackData['charge_id'],
            $tokenizedCard,
            $tokenizedCvv,
            $tokenExpiryMonth,
            $tokenExpiryYear,
            $callbackData['fb_payment_id']
        );
    }
666609
public static function create(array $callbackData): self
    {
        $requestedUserInfo = RequestedUserInfo::create($callbackData['requested_user_info']);

        return new self($callbackData['payload'], $requestedUserInfo, $callbackData['amount']);
    }
1297889
public function createSessionToken(array $data = [])
    {
        $token = new SessionToken();

        if (array_key_exists('session_id', $data)) {
            $token->setToken($data['session_id']);
        }

        if (array_key_exists('success', $data)) {
            $token->setSuccess($data['success']);
        }

        return $token;
    }
447992
protected function updatePaymentTransaction(PaymentTransaction $paymentTransaction, CallbackResponse $callbackResponse)
    {
        $paymentTransaction->setStatus($callbackResponse->getStatus());
        $paymentTransaction->getPayment()->setPaynetId($callbackResponse->getPaymentPaynetId());

        if ($callbackResponse->isError() || $callbackResponse->isDeclined())
        {
            $paymentTransaction->addError($callbackResponse->getError());
        }
    }
463162
public function creditCardCheck(PayoneCreditCardTransfer $creditCardData)
    {
        /** @var \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\CreditCardPseudo $paymentMethodMapper */
        $paymentMethodMapper = $this->getRegisteredPaymentMethodMapper($creditCardData->getPayment()->getPaymentMethod());
        $requestContainer = $paymentMethodMapper->mapCreditCardCheck($creditCardData);

        $this->setStandardParameter($requestContainer);

        $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
        $responseContainer = new CreditCardCheckResponseContainer($rawResponse);

        $responseMapper = new CreditCardCheckResponseMapper();
        $responseTransfer = $responseMapper->getCreditCardCheckResponseTransfer($responseContainer);

        return $responseTransfer;
    }
958785
public function errorAction(array $errorData)
    {
        $this->pool->reset();

        // Get the main part.
        $main = $this->pool->render->renderFatalMain(
            $errorData[static::TRACE_TYPE],
            $errorData[static::TRACE_ERROR_STRING],
            $errorData[static::TRACE_ERROR_FILE],
            $errorData[static::TRACE_ERROR_LINE]
        );

        // Get the backtrace.
        $backtrace = $this->pool
            ->createClass('Brainworxx\\Krexx\\Analyse\\Routing\\Process\\ProcessBacktrace')
            ->process($errorData[static::TRACE_BACKTRACE]);

        if ($this->pool->emergencyHandler->checkEmergencyBreak() === true) {
            return $this;
        }

        // Detect the encoding on the start-chunk-string of the analysis
        // for a complete encoding picture.
        $this->pool->chunks->detectEncoding($main . $backtrace);

        // Get the header, footer and messages
        $footer = $this->outputFooter(array());
        $header = $this->pool->render->renderFatalHeader($this->outputCssAndJs());
        $messages = $this->pool->messages->outputMessages();

        // Add the caller as metadata to the chunks class. It will be saved as
        // additional info, in case we are logging to a file.
        $this->pool->chunks->addMetadata(
            array(
                static::TRACE_FILE => $errorData[static::TRACE_ERROR_FILE],
                static::TRACE_LINE => $errorData[static::TRACE_ERROR_LINE] + 1,
                static::TRACE_VARNAME => ' Fatal Error',
            )
        );

        $this->outputService->addChunkString($header)
            ->addChunkString($messages)
            ->addChunkString($main)
            ->addChunkString($backtrace)
            ->addChunkString($footer)
            ->finalize();

        return $this;
    }
191618
public function onCallbackSuccess($order, $data = null)
    {
        $paymentId  = is_array($data) ? $data['paymentId'] : $data->paymentId;

        $payerId    = is_array($data) ? $data['PayerID'] : $data->PayerID;

        $this->statusCode = 'failed';

        $this->detail = sprintf('Payment failed. Ref: %s', $paymentId);

        // Begin paypal
        try {

            $this->setContext();

            $payment = Payment::get($paymentId, $this->apiContext);
            
            $execution = new PaymentExecution();

            $execution->setPayerId($payerId);

            $payment->execute($execution, $this->apiContext);

            $payment = Payment::get($paymentId, $this->apiContext);

            $this->statusCode = 'completed';

            $this->transactionId = $payment->id;

            $this->detail = 'Success';

        } catch (PayPalConnectionException $e) {

            $response = json_decode($e->getData());

            throw new GatewayException(
                sprintf(
                    '%s: %s',
                    $response->name,
                    isset($response->message) ? $response->message : 'Paypal payment Failed.'
                ),
                1001,
                $e
            );

        } catch (\Exception $e) {

            throw new GatewayException(
                $e->getMessage(),
                1000,
                $e
            );

        }
    }
936025
public static function createTransaction(array $data = [])
    {
        $entity = null;
        switch ($data['type']) {
            case 'broadcast':
                $entity = self::create('BroadcastTransaction', $data);
                break;
            case 'account_created':
            case 'change_account_key':
            case 'change_node_key':
                $entity = self::create('KeyTransaction', $data);
                break;
            case 'connection':
                $entity = self::create('ConnectionTransaction', $data);
                break;
            case 'create_account':
            case 'create_node':
            case 'retrieve_funds':
                $entity = self::create('NetworkTransaction', $data);
                break;
            case 'log_account':
                $entity = self::create('LogAccountTransaction', $data);
                break;
            case 'send_many':
                $entity = self::create('SendManyTransaction', $data);
                break;
            case 'send_one':
                $entity = self::create('SendOneTransaction', $data);
                break;
            case 'set_account_status':
            case 'set_node_status':
            case 'unset_account_status':
            case 'unset_node_status':
                $entity = self::create('StatusTransaction', $data);
                break;
            case 'empty':
                $entity = self::create('EmptyTransaction', $data);
                break;
            default:
                throw new AdsException(sprintf('Unsupported transaction type "%s".', $data['type']));
        }

        return $entity;
    }
881267
public function getChargeback($chargebackId, array $parameters = [])
    {
        return $this->client->paymentChargebacks->getFor(
            $this,
            $chargebackId,
            $parameters
        );
    }
34695
public function sendData($data)
    {
        $response = $this->gocardless->payments()->retry($data['paymentId']);

        return $this->response = new PaymentResponse($this, $response);
    }
626378
public static function convertLockAlias(array $lockData)
    {
        if (isset($lockData['aliases'])) {
            $aliases = array();

            foreach ($lockData['aliases'] as $i => $config) {
                $aliases[$config['package']][$config['version']] = array(
                    'alias' => $config['alias'],
                    'alias_normalized' => $config['alias_normalized'],
                );
            }

            $lockData['aliases'] = $aliases;
        }

        return $lockData;
    }
431933
public function callback($callback)
    {
        $t = $this;
        $args = array_slice(func_get_args(),1);

        // use an event handler to dispatch to the callback
        $this->_events->register('startTransaction', function($event, $connection) use ($t, $callback, $args) {
            $t->results []= call_user_func_array($callback, $args);
        });

        return $this;
    }
242066
private function createToken($jsonData)
    {
        $content = json_decode($jsonData, true);

        if (!is_array($content)) {
            throw new TokenException(sprintf('Could not decode JSON string: "%s"', $jsonData));
        }

        return Token::create($content);
    }
374415
public function sendData($data)
    {
        if (array_get($data, 'result')) {
            $request = new LegacyVerifyAppPayReturnRequest($this->httpClient, $this->httpRequest);
            $request->initialize($this->parameters->all());
            $request->setResult($data['result']);
            $request->setAlipayPublicKey($this->getAlipayPublicKey());
            $data = $request->send()->getData();

            $data = array_map(
                function ($v) {
                    return substr($v, 1, mb_strlen($v) - 2) . '';
                },
                $data
            );

            if (array_get($data, 'success') == 'true') {
                $data['trade_status'] = 'TRADE_SUCCESS';
            } else {
                $data['trade_status'] = 'WAIT_BUYER_PAY';
            }
        } else {
            $request = new LegacyNotifyRequest($this->httpClient, $this->httpRequest);
            $request->initialize($this->parameters->all());
            $request->setAlipayPublicKey($this->getAlipayPublicKey());
            $request->setVerifyNotifyId($this->verifyNotifyId);
            $request->setKey($this->getKey());
            $response = $request->send();

            $data = $response->getData();
        }

        return $this->response = new LegacyCompletePurchaseResponse($this, $data);
    }
127035
public function sendData($data)
    {
        $signer = new Signer($data);
        $signer->setIgnores(array('signature'));
        $content   = $signer->getContentToSign();
        $publicKey = $this->getPublicKey();

        if (! $this->getPublicKey()) {
            $publicKey = Signer::findPublicKey($data['certId'], $this->getCertDir());
        }

        $data['verify_success'] = $signer->verifyWithRSA($content, $data['signature'], $publicKey);

        $data['is_paid'] = $data['verify_success'] && ($this->getRequestParam('respCode') == '00');

        return $this->response = new ExpressCompletePurchaseResponse($this, $data);
    }
1151181
public function createUsingTemporaryToken(array $data, array $headers = [])
    {
        $url = $this->url('payment_sources/create_using_temp_token');

        return $this->post($url, $data, $headers);
    }
62256
public function addTransaction(TPkgShopPaymentTransactionData $transactionData)
    {
        $transactionData->checkRequirements();

        $sTransactionType = $transactionData->getType();
        $amount = $transactionData->getTotalValue();
        $oContext = $transactionData->getContext();
        $iSequenceNumber = $transactionData->getSequenceNumber();

        $oTransactionType = $this->getTransactionTypeObject($sTransactionType);

        if (null === $iSequenceNumber) {
            $iSequenceNumber = $this->getNextTransactionSequenceNumber();
        }
        if (self::TRANSACTION_TYPE_CREDIT == $sTransactionType || self::TRANSACTION_TYPE_PAYMENT_REVERSAL === $sTransactionType) {
            $amount = -1 * $amount;
        }
        $aData = array(
            'shop_order_id' => $this->order->id,
            'data_extranet_user_id' => (null !== $oContext->getExtranetUser()) ? ($oContext->getExtranetUser(
            )->id) : (''),
            'cms_user_id' => (null !== $oContext->getCmsUser()) ? ($oContext->getCmsUser()->id) : (''),
            'datecreated' => date('Y-m-d H:i:s'),
            'ip' => $oContext->getIp(),
            'amount' => $amount,
            'context' => $oContext->getContext(),
            'pkg_shop_payment_transaction_type_id' => $oTransactionType->id,
            'sequence_number' => $iSequenceNumber,
            'confirmed' => '0',
        );

        $oTransaction = TdbPkgShopPaymentTransaction::GetNewInstance($aData);

        $oTransaction->AllowEditByAll(true);
        $oTransaction->SaveFieldsFast($aData);
        $oTransaction->AllowEditByAll(false);

        // add items
        $aItems = $transactionData->getItems();
        /** @var TPkgShopPaymentTransactionItemData $oItem */
        $itemAmountMultiplier = 1;
        if (self::TRANSACTION_TYPE_CREDIT == $sTransactionType || self::TRANSACTION_TYPE_PAYMENT_REVERSAL === $sTransactionType) {
            $itemAmountMultiplier = -1;
        }

        foreach ($aItems as $oItem) {
            $aData = array(
                'pkg_shop_payment_transaction_id' => $oTransaction->id,
                'amount' => ($itemAmountMultiplier * $oItem->getAmount()),
                'value' => $oItem->getValue(),
                'shop_order_item_id' => $oItem->getOrderItemId(),
                'type' => $oItem->getType(),
            );
            $oTransactionPosition = TdbPkgShopPaymentTransactionPosition::GetNewInstance($aData);
            $oTransactionPosition->AllowEditByAll(true);
            $oTransactionPosition->SaveFieldsFast($aData);
        }

        if (true === $transactionData->getConfirmed()) {
            $this->confirmTransaction($iSequenceNumber, $transactionData->getConfirmedTimestamp());
        }

        return $oTransaction;
    }