Giter VIP home page Giter VIP logo

payumlaravelpackage's Introduction

SWUbanner


Supporting Payum

Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our customers. If you'd like to join them, please consider:


Payum

Join the chat at https://gitter.im/Payum/Payum Unit Tests Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Reduce Your Development Time with Payum integrating more than 50 payment services simultaneously. Payum is one of the most popular bug-free solution that has over 1 000 000 downloads already. It is friendly for all top PHP frameworks and was successfully installed and tested by thousands of developers worldwide

Resources

License

Payum is released under the MIT License.

Sponsors

payumlaravelpackage's People

Contributors

ateixeira avatar jaike avatar makasim avatar schelmo avatar serpentblade avatar sharald avatar w33ble avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

payumlaravelpackage's Issues

Configuration from a database?

Hello,

I am trying to call the configuration of the gateways which are already in a given database, in a format other than that of the payum documentation, because they already exist.

I tried to call the config from the ServiceProvider but I do not have access to the DB from a ServiceProvider.

And is it possible to call the configuration of the gateways which are in the DB, for example, via a Helpers just before using Payum in order to generate the necessary config on the fly?

Too bad this part does not seem very flexible to use.

Recurring

Is this support Recurring method in paypal?

Call to undefined method [package] on Laravel 5

its seem newest Laravel 5 delete the method Package?

or its juts i am doing some thing wrong?

I am getting this udefined method error when i try to use Payum as payment system on Laravel 5

Request GetHumanStatus{model: ArrayObject} is not supported.

Using the Sofort Method on my project all the configuration is done now at the capture step it gives error as
Request GetHumanStatus{model: ArrayObject} is not supported.

My config file is as:
'sofort' => $sofortFactory->create(array( 'factory' => 'sofort', 'config_key' => '12345:123456:edc788a4316ce7e2ac0ede037aa623d7', )),

And Controller is looks like:

public function sofortAction()
        {
$storage = $this->getServiceLocator()->get('payum')->getStorage('Reisesparer\Model\SofortueberWeisung');

$payment = $storage->create();

$payment->setNumber(uniqid());
$payment->setCurrencyCode('EUR');
$payment->setTotalAmount(123); // 1.23 EUR
$payment->setDescription('A description');
$payment->setClientId('anId');
$payment->setClientEmail('[email protected]');

$storage->update($payment);

$captureToken = $this->getServiceLocator()->get('payum.security.token_factory')->createCaptureToken(
    'sofort', $payment, 'payment_done'
);
print_r($captureToken);
//exit();

$this->redirect()->toUrl($captureToken->getTargetUrl());
 }

And Model has the following code:

      <?php
          namespace Reisesparer\Model;

          use Payum\Core\Model\Payment;

          class SofortueberWeisung extends Payment
            {
            protected $id;
             }

Interface Doctrine\Common\Persistence\Proxy does not exist

Hello,
I am a beginner of laravel and payum. I followed the example, but cannot go through the code in sandbox.

ReflectionException
Interface Doctrine\Common\Persistence\Proxy does not exist

The error is in the file:

..\vendor\payum\core\Payum\Core\Registry\AbstractRegistry.php

The error code is:

$class = is_object($class) ? get_class($class) : $class;

    // TODO: this is a quick fix. I have to find a better\clean solution.
    if (class_exists($class)) {            
        $rc = new \ReflectionClass($class);
        if ($rc->implementsInterface('Doctrine\Common\Persistence\Proxy')) {
            $class = $rc->getParentClass()->getName();
        }
I really don't know how to deal with it.

Notify Controller doUnsafeAction doesn't resolve gateway name parameter

As route payum_notify_do_unsafe describe, this controller should recieve a gateway_name parameter, to retrive the right gateway from payum.
Instead this method receive a Request object and cannot get the right parameter.

The test can be done easily, call route('payum_notify_do_unsafe', ['gateway_name' => 'gateway-test']) via HTTP, throws a InvalidArgumentException with messagge Gateway "" does not exist. instead of Gateway "gateway-test" does not exist.

The PR #54 fix the issue.

getStorage

I encounter this error
A storage for model Scribe\Models\Frontend\AgreementDetails was not registered. There are storages for next models: Payum\Core\Model\ArrayObject.

Composer install fails laravel 5.1

Your requirements could not be resolved to an installable set o f packages.

Problem 1
- Installation request for payum/payum-laravel-package ^0.1 5.0 -> satisfiable by payum/payum-laravel-package[0.15.0].
- Conclusion: remove laravel/framework v5.1.18
- Conclusion: don't install laravel/framework v5.1.18

also note:
there is no bootstrap/start.php file to put:
App::resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) {
$payumBuilder
->addGateway('offline', ['factory' => 'offline'])
;
});

into, should this be created? or are the docs wrong, or does this not support laravel 5.+?

either way i will look for another solution in the mean time.

Laravel 5.1 failed

Problem 1
- Installation request for payum/payum-laravel-package ^1.0@dev -> satisfiable by payum/payum-laravel-package[1.0.x-dev].
- Conclusion: remove laravel/framework v5.1.1
- Conclusion: don't install laravel/framework v5.1.1
- payum/payum-laravel-package 1.0.x-dev requires illuminate/support ~4.0 -> satisfiable by illuminate/support[4.0.x-dev, 4.1.x-dev, 4.2.x-dev, v4.0.0, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13, v4.1.14, v4.1.15, v4.1.16, v4.1.17, v4.1.18, v4.1.19, v4.1.2, v4.1.20, v4.1.21, v4.1.22, v4.1.23, v4.1.24, v4.1.25, v4.1.26, v4.1.27, v4.1.28, v4.1.29, v4.1.3, v4.1.30, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.0-BETA1, v4.2.1, v4.2.12, v4.2.16, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].
- don't install illuminate/support 4.0.x-dev|don't install laravel/framework v5.1.1
- don't install illuminate/support 4.1.x-dev|don't install laravel/framework v5.1.1
- don't install illuminate/support 4.2.x-dev|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.0|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.0-BETA2|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.0-BETA3|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.0-BETA4|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.1|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.10|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.2|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.3|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.4|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.5|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.6|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.7|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.8|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.0.9|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.0|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.1|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.10|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.11|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.12|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.13|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.14|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.15|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.16|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.17|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.18|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.19|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.2|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.20|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.21|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.22|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.23|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.24|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.25|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.26|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.27|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.28|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.29|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.3|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.30|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.4|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.5|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.6|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.7|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.8|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.1.9|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.0-BETA1|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.1|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.12|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.16|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.17|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.2|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.3|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.4|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.5|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.6|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.7|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.8|don't install laravel/framework v5.1.1
- don't install illuminate/support v4.2.9|don't install laravel/framework v5.1.1
- Installation request for laravel/framework == 5.1.1.0 -> satisfiable by laravel/framework[v5.1.1].

Not installing, Laravel Container issue

Im trying to install this package with a fresh install of the latest Laravel and i keep getting a error in the console

Problem 1 - payum/payum-laravel-package dev-master requires illuminate/container ^4|^5.1|^6.0|^7.0|^8.0 -> found illuminate/container[v4.0.0-BETA2, ..., 4.2.x-dev, v5.1.1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Really like to use this package as a solution for a new billing portal im building for a friend. Thanks for the help.

Create payment refund on Laravel Package

Hello Maksim,

I'm having great experience with Payum library. Now I face the need to make Refund operations and want to contribute with the resultant code.

I've found the question http://stackoverflow.com/q/22965278/955183, talking about how to make it on Payum Bundle.. It's an excellent guideline, now I want just to ask if there are any Laravel Package specific tips so I can make it the best way.

Thanks in advance,
Teixeira

does this package support laravel 5

hello, I am trying to install it on Laravel 5, but unable to, keep getting this error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for payum/payum-laravel-package 0.13.* -> satisfiable
 by payum/payum-laravel-package[0.13.0].
    - Can only install one of: payum/core[0.14.0, 0.13.0].
    - payum/stripe 0.14.0 requires payum/core 0.14.* -> satisfiable by payum/cor
e[0.14.0].
    - payum/payum-laravel-package 0.13.0 requires payum/core 0.13.* -> satisfiab
le by payum/core[0.13.0].
    - Installation request for payum/stripe 0.14.* -> satisfiable by payum/strip
e[0.14.0].
Installation failed, reverting ./composer.json to its original content.

also asked this question on StackOverFlow:
http://stackoverflow.com/questions/28977789/laravel-5-unable-to-install-payum-package

Question

hi, How can i purchase subscription in paypal?

Trait 'Payum\Core\GatewayAwareTrait' not found

I have followed the docs and installed this library in laravel 5.2 (latest version). But i am getting this error. I also came across this on stackoverflow, and have added the guzzle library. However i am still getting this error.

FatalErrorException in PurchaseAction.php line 26:
Trait 'Payum\Core\GatewayAwareTrait' not found

GetHumanStatus{model: ArrayObject} is not supported

I want to use the PayumLaravelPackage with Payum/Payex , I followed the documentation here and tried to do a purchase,
every thing done well, But when I am redirected to:
http://project.dev:8000/en/payment/done/PMFgtu2IOoEWUTRZhF95slwNw95mDW5B6cF826J-fi8

, an error is triggered:

Request GetHumanStatus{model: ArrayObject} is not supported. Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker.

,,
my AppServiceProvider is:

public function register()
    {
        $this->app->resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) {
            $payumBuilder
                // this method registers filesystem storages, consider to change them to something more
                // sophisticated, like eloquent storage
                ->addDefaultStorages()

                ->addGateway('payex', [
                    'factory' => 'payex',
                    'account_number' => 'my account number',
                    'encryption_key' => 'my key',
                    'sandbox' => true
                ]);
        });

    }

and my Payment Controller :


namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Payum\Core\Request\GetHumanStatus;
use Payum\LaravelPackage\Controller\PayumController;

class PaymentController extends PayumController
{

    public function done($payum_token, Request $request)
    {
        $request->attributes->set('payum_token', $payum_token);

        $token = $this->getPayum()->getHttpRequestVerifier()->verify($request);
        $gateway = $this->getPayum()->getGateway($token->getGatewayName());

        $gateway->execute($status = new GetHumanStatus($token));

        return response([
            'status' => $status->getValue(),
            'details' => iterator_to_array($status->getFirstModel())
        ]);
    }

    public function captureDoneAction(Request $request)
    {
        $token = $this->get('payum')->getHttpRequestVerifier()->verify($request);

        $identity = $token->getDetails();
        $model = $this->get('payum')->getStorage($identity->getClass())->find($identity);

        $gateway = $this->get('payum')->getGateway($token->getGatewayName());

        // you can invalidate the token. The url could not be requested any more.
        // $this->get('payum')->getHttpRequestVerifier()->invalidate($token);

        // Once you have token you can get the model from the storage directly.
        //$identity = $token->getDetails();
        //$details = $payum->getStorage($identity->getClass())->find($identity);

        // or Payum can fetch the model for you while executing a request (Preferred).
        $gateway->execute($status = new GetHumanStatus($token));
        $details = $status->getFirstModel();

        // you have order and payment status
        // so you can do whatever you want for example you can just print status and payment details.

        return new JsonResponse(array(
            'status' => $status->getValue(),
            'details' => iterator_to_array($details),
        ));
    }
}

and that is my Payex Controller:

namespace App\Http\Controllers;

use App\Http\Requests;
use Illuminate\Http\Request;
use Payum\Payex\Api\OrderApi;
use Payum\LaravelPackage\Controller\PayumController;
use App\Http\Controllers\OrdersController as OrdersCart;

class PayexController extends PayumController
{

    public $cart;

    public function __construct(OrdersCart $ordersCart)
    {
        $this->cart = $ordersCart;
    }

    public function preparePayex( Request $request)
    {
        $storage = $this->getPayum()->getStorage('Payum\Core\Model\ArrayObject');

        $details = $storage->create();
        $details['price'] = $this->cart->updateCartTotalPrice($this->cart->currentCart);
        $details['priceArgList'] = '';
        $details['vat'] = 0;
        $details['currency'] = 'SEK';
        $details['orderId'] = $this->cart->currentCart;
        $details['productNumber'] = $this->cart->currentCart;
        $details['purchaseOperation'] = OrderApi::PURCHASEOPERATION_AUTHORIZATION;
        $details['view'] = OrderApi::VIEW_CREDITCARD;
        $details['description'] = '';
        $details['clientIPAddress'] = $request->getClientIp();
        $details['clientIdentifier'] = '';
        $details['additionalValues'] = '';
        $details['agreementRef'] = '';
        $details['clientLanguage'] = 'en-US';

        $storage->update($details);

        $captureToken = $this->getPayum()->getTokenFactory()->createCaptureToken('payex', $details, 'payment_done');

        $details['returnurl'] = $captureToken->getTargetUrl();
        $details['cancelurl'] = $captureToken->getTargetUrl();
        $storage->update($details);

        return redirect($captureToken->getTargetUrl());
    }

}

and i use laravel 5.2
This error is caused me a lot of boredom, so please some one help.

Fatal error: Allowed memory exhausted

I get this error when following the Get it started documentation

Noahs-Mac:dev noah$ composer require "payum/payum-laravel-package:*@stable" "payum/paypal-express-checkout-nvp:*@stable"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 72 bytes) in phar:///usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar/src/Composer/Package/Version/VersionParser.php on line 388

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 72 bytes) in phar:///usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar/src/Composer/Package/Version/VersionParser.php on line 388

Edit: seems this is a problems with Composer

Request Cancel{model: ArrayObject} is not supported

These are works good for offline
$gateway->execute($status = new Capture($token));
$gateway->execute($status = new Authorize($token));
$gateway->execute($status = new GetHumanStatus($token));
But Cancel doesn't work.
$gateway->execute($status = new Cancel($token));

Request Cancel{model: ArrayObject} is not supported. Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker.

Is it a bug? Or Isn't there any Cancel Request for Offline?

Can you tell me the list of requests that I can use for offline?

like
$gateway->execute($currency = new GetCurrency('TRY'));
$gateway->execute($status = new Capture($token));
$gateway->execute($status = new Authorize($token));
$gateway->execute($status = new GetHumanStatus($token));
etc etc

Request GetHumanStatus{model: ArrayObject} is not supported on payment done controller

Hello,

I'm working with the new 0.11.1 package (thanks for the corrections), and facing the above error on:

$status = new GetHumanStatus($token);
$payment->execute($status);

i.e.:
I'm redirected from PaypalController on

return $captureToken->getTargetUrl(); 

to http://localhost:8000/csi/payment_done?payum_token=_lLGI4Mxk-UKX4FNUiyq0j94IrY_iLjRoMZfWc8Bdg0

I can see on my storage the files payum-model-_lLGI4Mxk-UKX4FNUiyq0j94IrY_iLjRoMZfWc8Bdg0 and payum-model-5417d0934a306

The $token resultant from

$request = \App::make('request');
$request->attributes->set('payum_token', $payum_token);
$token = $this->getHttpRequestVerifier()->verify($request);

Gives me the result:

$token->getDetails() = Payum\Core\Model\ArrayObject#5417d0934a306
$token->getHash() = _lLGI4Mxk-UKX4FNUiyq0j94IrY_iLjRoMZfWc8Bdg0
$token->getPaymentName() = paypal-pro

If I try to reach payment_done controller with an invalid payum_token, it gives the error: A token with hash _lLGI4Mxk-UKX4FNUiyq0j94IrY_iLjRoMZfWc8Bdg1 could not be found. and if I try it with a valid token the Request GetHumanStatus{model: ArrayObject} is not supported. As I can see on storage a token with equivalent $token details arrayobject ID, I guess my $payments is not properly constructed on config.php.

Can you guys give me a hint on how to validate it?

Regards

Tag request

Would it be possible to tag this repository as 0.11.2 and to push the 0.12.0 tag on Payum/Core.

Currently when I try to use "payum/payum-laravel-package": "dev-master#e519568712e0e79e1085c0ea8f3c71f68fa5054c", I get:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for payum/payum-laravel-package dev-master#e519568712e0e79e1085c0ea8f3c71f68fa5054c -> satisfiable by payum/payum-laravel-package[dev-master].
    - payum/payum-laravel-package dev-master requires payum/core 0.12.*@dev -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Request Refund{model: ArrayObject} is not supported. Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker.

I have this:

  private function refund($payum_token) {
        $request = \App::make('request');
        $request->attributes->set('payum_token', $payum_token);

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

        $gateway = $this->getPayum()->getGateway($token->getGatewayName());

        try {
            $gateway->execute(new Refund($token));
        } catch (ReplyInterface $reply) {
            return $this->convertReply($reply);
        }

        $this->getPayum()->getHttpRequestVerifier()->invalidate($token);

        if($token->getAfterUrl()){
            return \Redirect::to($token->getAfterUrl());
        }

        return \Response::make(null, 204);        
    }

So now what ?

Does this package support laravel 5.2?

Hello, I want to use this package with Laravel 5.2.. Does this support the 5.2.? If yes, where I can get updated documentation? Because on this thread @makasim said: "The latest version 1.0 does not require any configs at all.". But on the offical website docs and on github docs I can see the author is talking about to place the configuration code. Also the file bootstrap/start.php is not exist.

Where should I place the configuration code?

thank you

Getting 0 as hash for the targetUrl

Trying to get the eloquent storage to work for payum in laravel 5.2.

I get the error:

Argument 1 passed to iterator_to_array() must implement interface Traversable, instance of Payum\LaravelPackage\Model\Payment given

Thrown by 'details' => iterator_to_array($status->getFirstModel()) in the method that handles the callback of payment_done

In my AppServiceProvider.php i have

<?php
$this->app->resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) {
            $payumBuilder
            // this method registers filesystem storages, consider to change them to something more
            // sophisticated, like eloquent storage
            //->addDefaultStorages()

            ->addStorage(Payment::class, new EloquentStorage(Payment::class))
            ->setTokenStorage(new EloquentStorage(Token::class))

            ->addGateway('paypal_ec', [
                'factory' => 'paypal_express_checkout',
                'username' => 'EDIT ME',
                'password' => 'EDIT ME',
                'signature' => 'EDIT ME',
                'sandbox' => true
            ]);
        });

My routes:
Route::get('/payment', 'PaypalController@prepareExpressCheckout'); Route::get('/payment/done/{payum_token}', ['as' => 'payment_done', 'uses' => 'PaypalController@done']);

Controller:

<?php

namespace App\Http\Controllers;
// app/controllers/PaypalController.php

use Payum\Core\Request\GetHumanStatus;
use Payum\LaravelPackage\Controller\PayumController;
use Symfony\Component\HttpFoundation\Request;


class PaypalController extends PayumController
{
    public function prepareExpressCheckout()
    {
        //$storage = $this->getPayum()->getStorage('Payum\Core\Model\ArrayObject');
        $storage = $this->getPayum()->getStorage('Payum\LaravelPackage\Model\Payment');

        /*
        $details = $storage->create();
        $details['PAYMENTREQUEST_0_CURRENCYCODE'] = 'EUR';
        $details['PAYMENTREQUEST_0_AMT'] = 1.23;
        $storage->update($details);
        */

        $payment = $storage->create();
         $payment->setNumber(uniqid());
         $payment->setCurrencyCode('EUR');
         $payment->setTotalAmount(1.23); // 1.23 EUR
         $payment->setDescription('A description');
         $payment->setClientId('anId');
         $payment->setClientEmail('[email protected]');
         $payment->setDetails(array(
           // put here any fields in a gateway format.
           // for example if you use Paypal ExpressCheckout you can define a description of the first item:
           'L_PAYMENTREQUEST_0_DESC' => 'A desc',
           'L_PAYMENTREQUEST_0_AMT' => 1.23
         ));
         $storage->update($payment);


        print_r($this->getPayum()->getTokenFactory());

        $captureToken = $this->getPayum()->getTokenFactory()->createCaptureToken('paypal_ec', $payment, 'payment_done');

        echo $captureToken->getTargetUrl();

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

    public function done($payum_token)
    {

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

        $token = $this->getPayum()->getHttpRequestVerifier()->verify($request);
        $gateway = $this->getPayum()->getGateway($token->getGatewayName());

        $gateway->execute($status = new GetHumanStatus($token));

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

I've been at it for two evenings and getting nowhere. The package looks promising, so i hope somebody can help me. If i get it working i promise i will write detailed documentation for laravel 5.2 users!

Class payum does not exist

Hi I'm using PayumLaravelPackage in L5.1, this issue I think that is similar to #6 I used the get it started of the docs but the service provider in the doc is

return array( 'providers' => array( 'Payum\LaravelPackage\PayumServiceProvider', ), );

In L5 I think tha it used something different like this
Payum\LaravelPackage\PayumServiceProvider::class,
I put in this way in my serviceprovicers

L5 dont get me any troubles so I tried to test using my controller like the example of the docs
`
use Illuminate\Http\Request;
use Payum\LaravelPackage\Controller\PayumController;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class AuthorizeController extends PayumController{

public function prepareExpressCheckout(){
  $storage = $this->getPayum()->getStorage('Payum\Core\Model\ArrayObject');

  $details = $storage->create();
  $details['PAYMENTREQUEST_0_CURRENCYCODE'] = 'EUR'; 
  $details['PAYMENTREQUEST_0_AMT'] = 1.23; 
  $storage->update($details);

  $captureToken = $this->getPayum()->getTokenFactory()->createCaptureToken('authorize_net', $details, 'payment_done');

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

}`

but it always send me ReflectionException in Container.php line 741: Class payum does not exist
I use the last version of this Package but I don't understand how to get correctly the class.

Thanks

Subscription defined by a start and end date.

I am working with Laravel Cashier and I have found out that you can't define a custom start / end date for subscriptions. It is inconvenient in our case because we are offering to our users an option where they can book website access for a predefined start / end date. Does this package provide such an option?

ReflectionException in Container.php line 737: Class payum does not exist

using "payum/paypal-express-checkout-nvp":"0.15.*"
laravel version 5.1

got this error.

ReflectionException in Container.php line 737: Class payum does not exist

in Container.php line 737
at ReflectionClass->__construct('payum') in Container.php line 737
at Container->build('payum', array()) in Container.php line 627
at Container->make('payum', array()) in Application.php line 674
at Application->make('payum') in Facade.php line 216
at Facade::__callStatic('make', array('payum')) in PaypalController.php line 22
at App::make('payum') in PaypalController.php line 22
at PaypalController->prepareExpressCheckout()
at call_user_func_array(array(object(PaypalController), 'prepareExpressCheckout'), array()) in Controller.php line 256
at Controller->callAction('prepareExpressCheckout', array()) in ControllerDispatcher.php line 164
at ControllerDispatcher->call(object(PaypalController), object(Route), 'prepareExpressCheckout') in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(PaypalController), object(Route), object(Request), 'prepareExpressCheckout') in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\PaypalController', 'prepareExpressCheckout') in Route.php line 203
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 712
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 714
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 679
at Router->dispatchToRoute(object(Request)) in Router.php line 639
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
at require_once('C:\xampp\htdocs\dailylunch\public\index.php') in index.php line 21

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.