src/TransactionService.php
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);
    }
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);
    }
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 ) ; }
Get CreditCard Ui for Transaction

@param Transaction $transaction
@param string $paymentAction
@param string $language

@return string
Get CreditCard Ui for Transaction