Giter VIP home page Giter VIP logo

Comments (6)

makasim avatar makasim commented on May 27, 2024

Could you please post your models, configs and etc

from payumlaravelpackage.

ateixeira avatar ateixeira commented on May 27, 2024

Hello Makasim,

This is my config.php

<?php

use Payum\Core\Storage\FilesystemStorage;

use Buzz\Client\Curl;
use Payum\Paypal\ProCheckout\Nvp\PaymentFactory as PaypalProPaymentFactory;
use Payum\Paypal\ProCheckout\Nvp\Api as PaypalProApi;

$detailsClass = 'Payum\Core\Model\ArrayObject';
$tokenClass = 'Payum\Core\Model\Token';

$payments['paypal-pro'] = PaypalProPaymentFactory::create(new PaypalProApi(
    new Curl,
    array(
        'username' => 'xxxxx',
        'password' => 'xxxxx',
        'partner' => 'xxxxx',
        'vendor' => 'xxxxx',
        'sandbox' => true
    )
));

return array(
    // You can pass on object or a service id from container.
    'token_storage' => new FilesystemStorage(__DIR__.'/../../../../../storage/payments', $tokenClass, 'hash'),
    'payments' => $payments,
    'storages' => array(
        $detailsClass => new FilesystemStorage(__DIR__.'/../../../../../storage/payments', $detailsClass),
    )
);

My PaypalController where I still have stub payment data

<?php namespace DeansHomer\Controllers;
// app/controllers/PaypalController.php

use Payum\Core\Security\SensitiveValue;

use \Redirect;
use \Log;

class PaypalController extends BaseController
{
    public function prepareCheckout()
    {
        $storage = \App::make('payum')->getStorage('Payum\Core\Model\ArrayObject');

        $paymentDetails = $storage->createModel();
        $paymentDetails['CURRENCY'] = 'USD';
        $paymentDetails['AMT'] = '0.01';
        $paymentDetails['ACCT'] = '5105105105105100';
        $paymentDetails['EXPDATE'] = '1214';
        $paymentDetails['CVV2'] = '123';
        $paymentDetails['billtofirstname'] = 'MyFirstName';
        $paymentDetails['billtolastname'] = 'Test';
        $paymentDetails['billtostreet'] = '123 Main St.';
        $paymentDetails['billtocity'] = 'San Jose';
        $paymentDetails['billtostate'] = 'CA';
        $paymentDetails['billtozip'] = '95101';
        $paymentDetails['billtocountry'] = 'US';
        $storage->updateModel($paymentDetails);

        $captureToken = \App::make('payum.security.token_factory')->createCaptureToken('paypal-pro', $paymentDetails, 'csi/payment_done');

        // return $captureToken->getTargetUrl();
        return Redirect::to($captureToken->getTargetUrl());
    }
}

And the payment_done controller

<?php namespace DeansHomer\Controllers;

use Payum\Core\Registry\RegistryInterface;
use Payum\Core\Request\GetHumanStatus;
use Payum\Core\Security\HttpRequestVerifierInterface;
use Symfony\Component\HttpFoundation\Request;

use \Input;
use \Log;

class PaymentController extends BaseController
{
    public function done()
    {

        $payum_token = urldecode(Input::get('payum_token'));

        /** @var Request $request */
        $request = \App::make('request');
        $request->attributes->set('payum_token', $payum_token);

        $token = $this->getHttpRequestVerifier()->verify($request);
        $payment = $this->getPayum()->getPayment($token->getPaymentName());

        $status = new GetHumanStatus($token);

        $payment->execute($status);

        return \Response::json(array(
            'status' => $status->getStatus(),
            'details' => iterator_to_array($status->getModel())
        ));
    }

from payumlaravelpackage.

makasim avatar makasim commented on May 27, 2024

I cannot find any bugs, everything looks correct.

from payumlaravelpackage.

makasim avatar makasim commented on May 27, 2024

there was a bug in the lib, again. Fixed it Payum/Payum@0507dea

I am going to tag this now

from payumlaravelpackage.

makasim avatar makasim commented on May 27, 2024

has to fixed in: https://github.com/Payum/Payum/releases/tag/0.11.2 and https://github.com/Payum/PaypalProCheckoutNvp/releases/tag/0.11.2

from payumlaravelpackage.

shoaibgits avatar shoaibgits commented on May 27, 2024

I got the error:
Request GetHumanStatus{model: ArrayObject} is not supported. while using the Sofort payment method

from payumlaravelpackage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.