Credit Card payment with PayPal Payment Pro

 /**
     *
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function confirmPaymentWithCreditCard()
    {
        $profileDetails = new RecurringPaymentsProfileDetailsType();
        $profileDetails->BillingStartDate = date(DATE_ISO8601, strtotime(date('Y-m-d') . ' +1 day'));
        //Since date start should be greater than current date.

        $paymentBillingPeriod = new BillingPeriodDetailsType();
        $paymentBillingPeriod->BillingFrequency = 1;//your own value
        $paymentBillingPeriod->BillingPeriod = "Day";//your own value

        $paymentBillingPeriod->Amount = new BasicAmountType("USD", "2.00");//your own value

        $activationDetails = new ActivationDetailsType();
        $activationDetails->InitialAmount = new BasicAmountType('USD', '2.50');
        $activationDetails->FailedInitialAmountAction = 'ContinueOnFailure';

        $scheduleDetails = new ScheduleDetailsType();
        $scheduleDetails->Description = "Recurring";
        $scheduleDetails->PaymentPeriod = $paymentBillingPeriod;
        $scheduleDetails->ActivationDetails = $activationDetails;

        $createRPProfileRequestDetails = new CreateRecurringPaymentsProfileRequestDetailsType();

        $creditCard = new CreditCardDetailsType();
        $creditCard->CreditCardNumber = "5555555555554444";
        $creditCard->CreditCardType = "MasterCard";
        $creditCard->CVV2 = "962";
        $creditCard->ExpMonth = 002;
        $creditCard->ExpYear = 2021;
        $createRPProfileRequestDetails->CreditCard = $creditCard;

        $createRPProfileRequestDetails->ScheduleDetails = $scheduleDetails;
        $createRPProfileRequestDetails->RecurringPaymentsProfileDetails = $profileDetails;

        $createRPProfileRequest = new CreateRecurringPaymentsProfileRequestType();
        $createRPProfileRequest->CreateRecurringPaymentsProfileRequestDetails = $createRPProfileRequestDetails;

        $createRPProfileReq = new CreateRecurringPaymentsProfileReq();
        $createRPProfileReq->CreateRecurringPaymentsProfileRequest = $createRPProfileRequest;


        $config = array(
            'mode' => 'sandbox',
            'acct1.UserName' => 'your username from sandbox',
            'acct1.Password' => 'your password',
            'acct1.Signature' => 'your signature'
        );
        $paypalService = new PayPalAPIInterfaceServiceService($config);
        $createRPProfileResponse = $paypalService->CreateRecurringPaymentsProfile($createRPProfileReq);

        //printr($createRPProfileResponse);

        //Now we have to check if the recurring profile successfully created.

        if ($createRPProfileResponse->Ack == 'Success') {
            $profileId = $createRPProfileResponse->CreateRecurringPaymentsProfileResponseDetails->ProfileID;
            //your own logic to save details in database.
//            printr($profileId);
//            printr($activationDetails);
//            echo "success";
            return view('pages.payment-success');

        } else {
//            printr($createRPProfileResponse);
//            echo "greska";

            return Redirect::to('error')->with('message', 'There is a problem in payment processing . ');
        }

    }