Giter Club home page Giter Club logo

payum'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

payum's People

Contributors

66ton99 avatar actions-user avatar aitboudad avatar alexandernst avatar antonioperic avatar askozienko avatar ateixeira avatar chris8934 avatar cordoval avatar dmytro-pro avatar eymengunay avatar jkabat avatar kg-itembase avatar lovenunu avatar makasim avatar nyholm avatar pantelm-florajet avatar pierredup avatar roquie avatar ruslan-polutsygan avatar serdyuka avatar skadabr avatar solverat avatar studiomax avatar tetragramat avatar thiphamyp avatar thomaslandauer avatar timo-linde avatar toooni avatar tumbochka 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  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

payum's Issues

Get Payment Details by Payment Token

I think I'm missing something, please help me understand:

I'm using Payum in my Silex API backend.
I can prepare the payment.
I can pay with paypal.
I end up with a payment token from which I want to check the paid order.
Here I get lost.

In my Done method I get the token and verify the payment, then I redirect the user like that:

public function prepare($price, $orderId)
    {
        $paymentDetails                                  = $storage->createModel();
        $paymentDetails['PAYMENTREQUEST_0_CURRENCYCODE'] = 'EUR';
        $paymentDetails['PAYMENTREQUEST_0_AMT']          = $price;
        $paymentDetails['ORDER_ID']                      = $orderId;
        $storage->updateModel($paymentDetails);

        $doneToken = $this->tokenStorage->createModel();
        $doneToken->setPaymentName('paypal');
        $doneToken->setDetails($storage->getIdentificator($paymentDetails));
       //...
    }

public function done($tokenString)
    {
        $_REQUEST['payum_token'] = $tokenString;

        $token   = $this->requestVerifier->verify($_REQUEST);
        $payment = $this->registry->getPayment($token->getPaymentName());
        $payment->execute($status = new BinaryMaskStatusRequest($token));

        $returnUrl = $this->clientUrl . '/payment/';
        if ($status->isSuccess()) {
            $returnUrl .= 'success/';
        } else {
            $returnUrl .= 'error/';
        }

        return $returnUrl . $tokenString;
    }

the client now get this token and ask for the order:

public function getOrderIdByToken($tokenString)
    {
        $token   = $this->em->getRepository($this->tokenClass)->getByHash($tokenString);

       // this doesn't work:
       /*
       if($token && method_exists($token->getDetails(), 'getOrderId')){
            return $token->getDetails()->getOrderId();
        }
        */

        $paymentDetails = $this->em->getRepository($this->detailsClass)->find($token->getDetails()->getId())->getArray();

         return $paymentDetails['ORDER_ID'];
    }

Is this the only way to do that? why $doneToken->setDetails($storage->getIdentificator($paymentDetails)); is not saving my ORDER_ID?

Request SecuredCaptureRequest{model: Payment} is not supported

Found this in my error log, it was a PayPal Express transaction and happens when receive IPN.

[2014-04-17 06:10:22] app.DEBUG: [Payum] 1# Payum\Core\Action\ExecuteSameRequestWithModelDetailsAction::execute(SecuredNotifyRequest{model: PaymentSecurityToken}) [] []
[2014-04-17 06:10:22] app.DEBUG: [Payum] 2# Sylius\Bundle\PayumBundle\Payum\Paypal\Action\NotifyOrderAction::execute(SecuredNotifyRequest{model: Order}) [] []
[2014-04-17 06:10:22] app.DEBUG: [Payum] 3# Payment::execute(SyncRequest{model: Payment}) throws exception RequestNotSupportedException [] []
[2014-04-17 06:10:22] app.DEBUG: [Payum] 2# NotifyOrderAction::execute(SecuredNotifyRequest{model: Order}) throws exception RequestNotSupportedException [] []
[2014-04-17 06:10:22] app.DEBUG: [Payum] 1# ExecuteSameRequestWithModelDetailsAction::execute(SecuredNotifyRequest{model: Order}) throws exception RequestNotSupportedException [] []
[2014-04-17 06:10:22] request.CRITICAL: Uncaught PHP Exception Payum\Core\Exception\RequestNotSupportedException: "Request SyncRequest{model: Payment} is not supported." at xxx/vendor/payum/payum/src/Payum/Core/Exception/RequestNotSupportedException.php line 16 {"exception":"[object] (Payum\\Core\\Exception\\RequestNotSupportedException: Request SyncRequest{model: Payment} is not supported. at /storage/home/hype/store/releases/20140417094012/vendor/payum/payum/src/Payum/Core/Exception/RequestNotSupportedException.php:16)"} []

[Be2bill] Payment through be2bill platform

Hi,

I'l like to implement the form way of Be2bill payment. It's like Paypal Express Checkout, the visitor is redirected to Be2bill hosted form to enter its credit card detail, and then come back to our site.

I'm a bit lost in payum architecture. What is the best way of adding this payment to payum? Where to start? How to factorize all existing be2bill code useful for both payment methods?

Thanks for enlightening me!

[rfc] Several APIs in the payment. Action could ask for supported.

In general it would like PaymentAwareActionInterface. Let's say it would have name ApiAwareActionInterface. I see two ways to implement it:

Benefits

  • One payment object for all possible payments. (All currect extended classes will be removed);
  • Ability to inject API without the whole payment object. (now to access Api you have to implement PaymentAwareActionInterface and ask payment for api).
  • Ability to use several same actions but for different API versions.

First, exception driven:

I personally prefer this one.

<?php

interface ApiAwareActionInterface
{
    /**
     * @param mixed $api
     *
     * @throws \InvalidArgumentException
     */
    function setApi($api);
}

The payment tries set all APIs one by one. If the action does not support the API given it throws InvalidArgumentException. Payment catch this exception and tries to set next available API.

Second, with support method

<?php

interface ApiAwareActionInterface
{
    /**
     * @param mixed $api
     *
     * @throws \InvalidArgumentException
     */
    function setApi($api);

    /**
     * @param bool
     * 
     * @return bool
     */
    function supportApi($api);
}

In this case payment pass APIs one by one to action supportApi method till it says true. After the API was found it set via setApi method.

The payment

The payment interface should also be extended:

<?php

interface PaymentInterface
{
    /**
     * @param mixed $api
     */
   function addApi($api);
}

and Payment implementation should check for ApiAwareActionInterface in addAction method:

<?php

class Payment
{
   public function addAction(ActionInterface $action)
   {
       if ($action instanceof ApiAwareActionInterface) {
           //try to set supported API to an action.
       }
   }
}

[rfc] storage extension

<?php
namespace Payum\Extension;

use Payum\Action\ActionInterface;
use Payum\Request\InteractiveRequestInterface;
use Payum\Request\ModelRequestInterface;
use Payum\Storage\StorageInterface;

class StorageExtension implements ExtensionInterface 
{
    /**
     * @var \Payum\Storage\StorageInterface
     */
    protected $storage;

    /**
     * @param \Payum\Storage\StorageInterface $storage
     */
    public function __construct(StorageInterface $storage)
    {
        $this->storage = $storage;
    }

    /**
     * {@inheritdoc}
     */
    public function onPreExecute($request)
    {
        if (false == $request instanceof ModelRequestInterface) {
            return;
        }
        if (is_object($request->getModel())) {
            return;
        }

        if ($model = $this->storage->findModelById($request->getModel())) {
            $request->setModel($model);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function onExecute($request, ActionInterface $action)
    {
    }

    /**
     * {@inheritdoc}
     */
    public function onPostExecute($request, ActionInterface $action)
    {
        if (false == $request instanceof ModelRequestInterface) {
            return;
        }

        if ($this->storage->supportsModel($request->getModel())) {
            $this->storage->updateModel($request->getModel());
        }
    }

    /**
     * {@inheritdoc}
     */
    public function onInteractiveRequest(InteractiveRequestInterface $interactiveRequest, $request, ActionInterface $action)
    {
        if (false == $request instanceof ModelRequestInterface) {
            return;
        }

        if ($this->storage->supportsModel($request->getModel())) {
            $this->storage->updateModel($request->getModel());
        }
    }

    /**
     * {@inheritdoc}
     */
    public function onException(\Exception $exception, $request, ActionInterface $action = null)
    {
    }
}

PayPal pro checkout processing error

Hey guys, i'm getting payment failed error, how can i get error message from where i can find what is wrong in my code/config

    // checkout process method
    $paymentName = 'paypal_pro_checkout';

    $storage = $this->get('payum')->getStorageForClass(
        'Sylius\Bundle\PaymentsBundle\Model\Payment',
        $paymentName
    );

    /** @var 'Sylius\Bundle\PaymentsBundle\Model\Payment' $paymentDetails */
    $paymentDetails['acct'] = xxxxxxxxxx;
    $paymentDetails['cvv2'] = xxx;
    $paymentDetails['expDate'] = "xx/xx";
    $paymentDetails['amt'] = 0.5;
    $paymentDetails['currency'] = 'USD';

    $paymentDetails->setSource($this->container->get("sylius.repository.credit_card")->find(1));
    $paymentDetails->setMethod($this->container->get("sylius.repository.payment_method")->find(5));

    $storage->updateModel($paymentDetails);

    $captureToken = $this->get('payum.security.token_factory')->createCaptureToken(
        $paymentName,
        $paymentDetails,
        'luconic_checkout_done' // the route to redirect after capture;
    );
    return $this->forward('PayumBundle:Capture:do', array(
        'payum_token' => $captureToken,
    ));

........................................................

    // checkout done method (route = luconic_checkout_done)
    $token = $this->get('payum.security.http_request_verifier')->verify($request);

    $payment = $this->get('payum')->getPayment($token->getPaymentName());

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

    if ($status->isSuccess()) {
        $this->get('session')->getFlashBag()->set(
            'notice',
            'Payment success. Credits were added'
        );
    } else if ($status->isPending()) {
            $this->get('session')->getFlashBag()->set(
            'notice',
            'Payment is still pending. Credits were not added'
        );
    } else {
        // i'm getting this message
        $this->get('session')->getFlashBag()->set('error', 'Payment failed');
    }

........................................................

    // config part
    paypal_pro_checkout:
        paypal_pro_checkout_nvp:
            api:
                options:
                    username:  %paypal.express_checkout.username%
                    password:  %paypal.express_checkout.password%
                    partner:  'partner'
                    vendor:   'vendor'
                    sandbox:   %paypal.express_checkout.sandbox%
        storages:
            Sylius\Bundle\PaymentsBundle\Model\Payment:
                doctrine:
                    driver: orm

Failed PayPal IPN because session has expired

I got the following error in one of my payment, after it received an IPN notification.

This Express Checkout session has expired. Token value is no longer valid.

This payment was under review when customer finish checkout. The payment received two IPN, the first one was received right after customer checkout, the other one was received two days later, and it was an error in Payum. I guess the second IPN was supposed to notify Payum the payment has been completed.

Does Payum always try to retrieve payment details from PayPal server, instead of reading it from the IPN directly?

Did we forgot to renew the token after received IPN?

Array (
[state] => failed
[details] => Array
    (
        [RETURNURL] => http://xxx
        [CANCELURL] => http://xxx
        [PAYMENTREQUEST_0_NOTIFYURL] => http://xxx
        [PAYMENTREQUEST_0_INVNUM] => xxx
        [PAYMENTREQUEST_0_CURRENCYCODE] => USD
        [PAYMENTREQUEST_0_AMT] => 539.70
        [PAYMENTREQUEST_0_ITEMAMT] => 539.70
        [PAYMENTREQUEST_0_TAXAMT] => 0.00
        [L_PAYMENTREQUEST_0_NAME0] => Black Spirit T-Shirt
        [L_PAYMENTREQUEST_0_AMT0] => 25.20
        [L_PAYMENTREQUEST_0_QTY0] => 1
        [L_PAYMENTREQUEST_0_NAME1] => Multicolor Print High Desert Raglan T-Shirt
        [L_PAYMENTREQUEST_0_AMT1] => 34.20
        [L_PAYMENTREQUEST_0_QTY1] => 1
        [L_PAYMENTREQUEST_0_NAME2] => White Nico T-Shirt
        [L_PAYMENTREQUEST_0_AMT2] => 53.10
        [L_PAYMENTREQUEST_0_QTY2] => 1
        [L_PAYMENTREQUEST_0_NAME3] => Wine Para Pant
        [L_PAYMENTREQUEST_0_AMT3] => 98.10
        [L_PAYMENTREQUEST_0_QTY3] => 1
        [L_PAYMENTREQUEST_0_NAME4] => Black/Black Boy Globe Star Sweater
        [L_PAYMENTREQUEST_0_AMT4] => 89.10
        [L_PAYMENTREQUEST_0_QTY4] => 1
        [L_PAYMENTREQUEST_0_NAME5] => Multicolor Print High Desert Cargo Shorts
        [L_PAYMENTREQUEST_0_AMT5] => 72.00
        [L_PAYMENTREQUEST_0_QTY5] => 1
        [L_PAYMENTREQUEST_0_NAME6] => CLOT CLOT x BWGH Black Molano Shirt - M
        [L_PAYMENTREQUEST_0_AMT6] => 144.00
        [L_PAYMENTREQUEST_0_QTY6] => 1
        [L_PAYMENTREQUEST_0_NAME7] => Shipping Total
        [L_PAYMENTREQUEST_0_AMT7] => 24.00
        [L_PAYMENTREQUEST_0_QTY7] => 1
        [PAYMENTREQUEST_0_PAYMENTACTION] => Sale
        [LANDINGPAGE] => Billing
        [TOKEN] => EC-4YC754397X6151219
        [TIMESTAMP] => 2014-04-18T02:29:12Z
        [CORRELATIONID] => xxx
        [ACK] => Failure
        [VERSION] => 65.1
        [BUILD] => 10567876
        [CHECKOUTSTATUS] => PaymentActionCompleted
        [EMAIL] => [email protected]
        [PAYERID] => xxx
        [PAYERSTATUS] => unverified
        [FIRSTNAME] => Junliang
        [LASTNAME] => Chen
        [COUNTRYCODE] => US
        [SHIPTONAME] => xxx
        [SHIPTOSTREET] => xxx
        [SHIPTOSTREET2] => xxx
        [SHIPTOCITY] => Philadelphia
        [SHIPTOSTATE] => PA
        [SHIPTOZIP] => 19131
        [SHIPTOCOUNTRYCODE] => US
        [SHIPTOCOUNTRYNAME] => United States
        [ADDRESSSTATUS] => Confirmed
        [CURRENCYCODE] => USD
        [AMT] => 539.70
        [ITEMAMT] => 539.70
        [SHIPPINGAMT] => 0.00
        [HANDLINGAMT] => 0.00
        [TAXAMT] => 0.00
        [INVNUM] => 83480
        [NOTIFYURL] => xxx
        [INSURANCEAMT] => 0.00
        [SHIPDISCAMT] => 0.00
        [L_NAME0] => Black Spirit T-Shirt
        [L_NAME1] => Multicolor Print High Desert Raglan T-Shirt
        [L_NAME2] => White Nico T-Shirt
        [L_NAME3] => Wine Para Pant
        [L_NAME4] => Black/Black Boy Globe Star Sweater
        [L_NAME5] => Multicolor Print High Desert Cargo Shorts
        [L_NAME6] => CLOT CLOT x BWGH Black Molano Shirt - M
        [L_NAME7] => Shipping Total
        [L_QTY0] => 1
        [L_QTY1] => 1
        [L_QTY2] => 1
        [L_QTY3] => 1
        [L_QTY4] => 1
        [L_QTY5] => 1
        [L_QTY6] => 1
        [L_QTY7] => 1
        [L_TAXAMT0] => 0.00
        [L_TAXAMT1] => 0.00
        [L_TAXAMT2] => 0.00
        [L_TAXAMT3] => 0.00
        [L_TAXAMT4] => 0.00
        [L_TAXAMT5] => 0.00
        [L_TAXAMT6] => 0.00
        [L_TAXAMT7] => 0.00
        [L_AMT0] => 25.20
        [L_AMT1] => 34.20
        [L_AMT2] => 53.10
        [L_AMT3] => 98.10
        [L_AMT4] => 89.10
        [L_AMT5] => 72.00
        [L_AMT6] => 144.00
        [L_AMT7] => 24.00
        [L_ITEMWEIGHTVALUE0] => 0.00000
        [L_ITEMWEIGHTVALUE1] => 0.00000
        [L_ITEMWEIGHTVALUE2] => 0.00000
        [L_ITEMWEIGHTVALUE3] => 0.00000
        [L_ITEMWEIGHTVALUE4] => 0.00000
        [L_ITEMWEIGHTVALUE5] => 0.00000
        [L_ITEMWEIGHTVALUE6] => 0.00000
        [L_ITEMWEIGHTVALUE7] => 0.00000
        [L_ITEMLENGTHVALUE0] => 0.00000
        [L_ITEMLENGTHVALUE1] => 0.00000
        [L_ITEMLENGTHVALUE2] => 0.00000
        [L_ITEMLENGTHVALUE3] => 0.00000
        [L_ITEMLENGTHVALUE4] => 0.00000
        [L_ITEMLENGTHVALUE5] => 0.00000
        [L_ITEMLENGTHVALUE6] => 0.00000
        [L_ITEMLENGTHVALUE7] => 0.00000
        [L_ITEMWIDTHVALUE0] => 0.00000
        [L_ITEMWIDTHVALUE1] => 0.00000
        [L_ITEMWIDTHVALUE2] => 0.00000
        [L_ITEMWIDTHVALUE3] => 0.00000
        [L_ITEMWIDTHVALUE4] => 0.00000
        [L_ITEMWIDTHVALUE5] => 0.00000
        [L_ITEMWIDTHVALUE6] => 0.00000
        [L_ITEMWIDTHVALUE7] => 0.00000
        [L_ITEMHEIGHTVALUE0] => 0.00000
        [L_ITEMHEIGHTVALUE1] => 0.00000
        [L_ITEMHEIGHTVALUE2] => 0.00000
        [L_ITEMHEIGHTVALUE3] => 0.00000
        [L_ITEMHEIGHTVALUE4] => 0.00000
        [L_ITEMHEIGHTVALUE5] => 0.00000
        [L_ITEMHEIGHTVALUE6] => 0.00000
        [L_ITEMHEIGHTVALUE7] => 0.00000
        [PAYMENTREQUEST_0_SHIPPINGAMT] => 0.00
        [PAYMENTREQUEST_0_HANDLINGAMT] => 0.00
        [PAYMENTREQUEST_0_INSURANCEAMT] => 0.00
        [PAYMENTREQUEST_0_SHIPDISCAMT] => 0.00
        [PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED] => false
        [PAYMENTREQUEST_0_SHIPTONAME] => xxx
        [PAYMENTREQUEST_0_SHIPTOSTREET] => xxx
        [PAYMENTREQUEST_0_SHIPTOSTREET2] => xxx
        [PAYMENTREQUEST_0_SHIPTOCITY] => xxx
        [PAYMENTREQUEST_0_SHIPTOSTATE] => xxx
        [PAYMENTREQUEST_0_SHIPTOZIP] => 19131
        [PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => US
        [PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME] => United States
        [PAYMENTREQUEST_0_ADDRESSSTATUS] => Confirmed
        [L_PAYMENTREQUEST_0_TAXAMT0] => 0.00
        [L_PAYMENTREQUEST_0_TAXAMT1] => 0.00
        [L_PAYMENTREQUEST_0_TAXAMT2] => 0.00
        [L_PAYMENTREQUEST_0_TAXAMT3] => 0.00
        [L_PAYMENTREQUEST_0_TAXAMT4] => 0.00
        [L_PAYMENTREQUEST_0_TAXAMT5] => 0.00
        [L_PAYMENTREQUEST_0_TAXAMT6] => 0.00
        [L_PAYMENTREQUEST_0_TAXAMT7] => 0.00
        [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE0] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE1] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE2] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE3] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE4] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE5] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE6] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE7] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE0] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE1] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE2] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE3] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE4] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE5] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE6] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMLENGTHVALUE7] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE0] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE1] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE2] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE3] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE4] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE5] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE6] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMWIDTHVALUE7] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE0] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE1] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE2] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE3] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE4] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE5] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE6] => 0.00000
        [L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE7] => 0.00000
        [PAYMENTREQUESTINFO_0_ERRORCODE] => 0
        [SUCCESSPAGEREDIRECTREQUESTED] => false
        [INSURANCEOPTIONSELECTED] => false
        [SHIPPINGOPTIONISDEFAULT] => false
        [PAYMENTINFO_0_TRANSACTIONID] => xxx
        [PAYMENTINFO_0_TRANSACTIONTYPE] => cart
        [PAYMENTINFO_0_PAYMENTTYPE] => instant
        [PAYMENTINFO_0_ORDERTIME] => 2014-04-17T02:20:09Z
        [PAYMENTINFO_0_AMT] => 539.70
        [PAYMENTINFO_0_FEEAMT] => 15.95
        [PAYMENTINFO_0_TAXAMT] => 0.00
        [PAYMENTINFO_0_CURRENCYCODE] => USD
        [PAYMENTINFO_0_PAYMENTSTATUS] => Pending
        [PAYMENTINFO_0_PENDINGREASON] => paymentreview
        [PAYMENTINFO_0_REASONCODE] => None
        [PAYMENTINFO_0_PROTECTIONELIGIBILITY] => Ineligible
        [PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE] => None
        [PAYMENTINFO_0_ERRORCODE] => 0
        [PAYMENTINFO_0_ACK] => Success
        [PAYMENTREQUEST_0_TRANSACTIONID] => xxx
        [PAYMENTREQUESTINFO_0_TRANSACTIONID] => xxx
        [PAYMENTREQUEST_0_TRANSACTIONTYPE] => cart
        [PAYMENTREQUEST_0_PAYMENTTYPE] => instant
        [PAYMENTREQUEST_0_ORDERTIME] => 2014-04-17T02:20:10Z
        [PAYMENTREQUEST_0_FEEAMT] => 15.95
        [PAYMENTREQUEST_0_PAYMENTSTATUS] => Pending
        [PAYMENTREQUEST_0_PENDINGREASON] => paymentreview
        [PAYMENTREQUEST_0_REASONCODE] => None
        [L_ERRORCODE0] => 10411
        [L_SHORTMESSAGE0] => This Express Checkout session has expired.
        [L_LONGMESSAGE0] => This Express Checkout session has expired. Token value is no longer valid.
        [L_SEVERITYCODE0] => Error
    )
)

(please note that the array above are mix with pervious payment details... you know how Doctrine Loggable works...)

Unsuccessful response - Causes, how to handle?

I'm building a system using Symfony2 and Payum/PaypalExpressCheckout 0.10.0 and I keep getting the following:

Unsuccessful response
[status code] 100
[reason phrase] Continue
[url] https://api-3t.sandbox.paypal.com/nvp

I cannot figure out why it is happening, but it only happens with random item sets. Some sets work just fine, others don't. All items in the set are similar.

Sometimes this happens when sending the payment to PayPal and sometimes when coming back. If it happens during sending, it keeps happening. If coming, a refresh may send the system to the next stage.

Is this a known issue with work-around or am I mucking something up major?

Want to work together?

Hey, I just came across this library on packagist.org and we appear to be doing very similar things.

I'm working on a library called Omnipay. While it has quite a different API to your library, I think we both have the same goal in mind (unified payment processing for PHP).

Want to work together and share rather than duplicate effort? ๐Ÿ‘

Packagist versioning

Hi,

Trying to get this working through packagist - but the versioning of the dev-master configuration seems messed up - and relies on branches / tags that don't exist (specifically the 0.4.x-dev branches)

Is there are forked repository that you are working on for the stuff in the 0.4 release?

Thanks

Payum and PCI DSS Compliance

Hi @makasim,

We're still working through a Payum implementation here and are now looking at the finer points of PCI DSS. Does PCI DSS apply in the Ukraine? It certainly does over here. One of the guidelines is that we're not allowed to store card details for any length of time, or we'll be elevated to the highest level of self assessment questionnaire to gain compliance.

The SecuredCaptureRequest relies on storing all of the card information across a redirect (from what I can see). Even though this is only done for a very small amount of time, the PCI DSS requirements are pretty black and white. Even encryption does not help here!

My question is twofold:

  1. What was the purpose of introducing tokens and the SecuredCaptureRequest?
  2. Can the SecuredCaptureRequest be used without storing the data? And if not, would it still be valid to use the standard CaptureRequest in its place?

Cheers,

Mark.

payum/core 0.12 no matching package found

I'm installing payum/authorize-net-aim, yet you haven't updated the tags for the payum/core repo, so it's failing. Could you please fix this?

I will use an older version for now.

Error:

- Installation request for payum/authorize-net-aim 0.12.*@dev -> satisfiable by payum/authorize-net-aim[0.12.x-dev].
- payum/authorize-net-aim 0.12.x-dev requires payum/core 0.12.*@dev -> no matching package found.

[rfc] Payment extension

This is proposal for payment extension interface.

<?php
namespace Payum\Extension;

use Payum\Request\InteractiveRequestInterface;
use Payum\Action\ActionInterface;

interface PaymentExtensionInterface 
{
    /**
     * @param mixed $request
     * 
     * @return null|mixed If something returned it is used as request later  
     */
    function onPreExecute($request);

    /**
     * @param mixed $request
     * @param \Payum\Action\ActionInterface $action
     *
     * @return null|mixed If something returned it is used as request later
     */
    function onExecute($request, ActionInterface $action);

    /**
     * @param mixed $request
     * @param \Payum\Action\ActionInterface $action
     *
     * @return void
     */
    function onPostExecute($request, ActionInterface $action);

    /**
     * @param mixed $firstRequest
     * @param \Payum\Request\InteractiveRequestInterface $interactiveRequest
     * @param \Payum\Action\ActionInterface $action
     * 
     * @return null|mixed If something returned it is used as interactive request later
     */
    function onInteractiveRequest($firstRequest, InteractiveRequestInterface $interactiveRequest, ActionInterface $action);

    /**
     * @param \Exception $exception
     * @param mixed $request
     * @param \Payum\Action\ActionInterface $action
     *
     * @return null|mixed If something returned it is used as request later
     */
    function onException(\Exception $exception, $request, ActionInterface $action);
}

The TOKEN must be set. Have you executed SetExpressCheckoutAction?

issue from: https://github.com/Payum/PaypalExpressCheckoutNvp/issues/36

app\config\app.php

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

app\config\packages\payum\payum-laravel-package\config.php


use Payum\Core\Storage\FilesystemStorage;
use Payum\Paypal\ExpressCheckout\Nvp\PaymentFactory as PaypalPaymentFactory;
use Payum\Paypal\ExpressCheckout\Nvp\Api;

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

$paypalPayment = PaypalPaymentFactory::create(new Api( array(
    'username' => 'xxxxxxxxxxxxx',
    'password' => 'xxxxxxxxxxxxx',
    'signature' => 'xxxxxxxxxxxxx',
    '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' => array(
        // Put here any payment you want too, omnipay, payex, paypa, be2bill or any other. Here's example of paypal and stripe:
        'paypal_es' => $paypalPayment
    ),
    'storages' => array(
        $detailsClass => new FilesystemStorage(__DIR__.'/../../../../storage/payments', $detailsClass),
    )
);

app\controllers\CustomersController.php

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

$details = $storage->createModel();

$details['PAYMENTREQUEST_0_CURRENCYCODE'] = 'USD';
$details['PAYMENTREQUEST_0_AMT'] = 100;
$storage->updateModel($details);
$captureToken = $this->getTokenFactory()->createCaptureToken('paypal_es', $details, 'payment_done');
$details['RETURNURL'] = $captureToken->getTargetUrl();
$details['CANCELURL'] = $captureToken->getTargetUrl();

$storage->updateModel($details);
return \Redirect::to($captureToken->getTargetUrl());

with the previous configurations I get this:
Image of Paypal Details

and when I try to add items like this:

 $details['L_PAYMENTREQUEST_0_NAME0']  = 'sample item';
 $details['L_PAYMENTREQUEST_0_DESC0']  = 'sample desc';
 $details['L_PAYMENTREQUEST_0_AMT0']  = 8.30;
 $details['L_PAYMENTREQUEST_0_QTY0']  = 1;

then I get the error:
The TOKEN must be set. Have you executed SetExpressCheckoutAction?

Enchantments to payment factories

  • Remove hard-coded instantiation of factories from PayumBundle
  • Move factories to it own library
  • Allow define factory class in the app config file

'The model status must be new.' on production.

It is very strange.. In my local I never had this problem, but on my production, after payment process completed (completed PayPal's steps etc), the $status->isSuccess() became true! But in my local, the status is always new.

This happens to Dummy payment too!

Question:

  • So what is the correct status after payment completed? new or success?
  • payum_capture_do, is this the right place to go?
  • What might go wrong? :'(
[2014-03-20 04:09:43] request.INFO: Matched route "payum_capture_do" (parameters: "_controller": "Payum\Bundle\PayumBundle\Controller\CaptureController::doAction", "_locale": "en", "payum_token": "sWdKyR8gYUs-Efl73Qp-_gq-e2XwwcjgsVqhdfo7dwc", "_route": "payum_capture_do") [] []
[2014-03-20 04:09:43] security.DEBUG: Read SecurityContext from the session [] []
[2014-03-20 04:09:43] security.DEBUG: Reloading user from user provider. [] []
[2014-03-20 04:09:43] security.DEBUG: Username "admin" was reloaded from user provider. [] []
[2014-03-20 04:09:43] app.DEBUG: [Payum] 1# Payum\Core\Action\ExecuteSameRequestWithModelDetailsAction::execute(BinaryMaskStatusRequest{model: PaymentSecurityToken}) [] []
[2014-03-20 04:09:43] app.DEBUG: [Payum] 2# Sylius\Bundle\PayumBundle\Payum\Dummy\Action\OrderStatusAction::execute(BinaryMaskStatusRequest{model: Order}) [] []
[2014-03-20 04:09:43] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: "The model status must be new." at /storage/home/hype/store/releases/20140320060242/vendor/payum/payum-bundle/Payum/Bundle/PayumBundle/Controller/CaptureController.php line 40 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\HttpException: The model status must be new. at /storage/home/hype/store/releases/20140320060242/vendor/payum/payum-bundle/Payum/Bundle/PayumBundle/Controller/CaptureController.php:40)"} []
[2014-03-20 04:09:43] security.DEBUG: Write SecurityContext in the session [] []

Request SyncRequest{model: PaymentDetails} is not supported.

Hi guys,
I followed all the steps and gives me this error "Request SyncRequest{model: PaymentDetails} is not supported."

<?php
/***  Controller ***/

    public function prepareAction(Request $request)
    {

        $paymentName = 'paypal_pro_checkout';

        $form = $this->createPurchasePlusCreditCardForm();
        $form->handleRequest($request);
        if ($form->isValid()) {
            $storage = $this->getPayum()->getStorage('TaxiBooking\Book\BookBundle\Entity\PaymentDetails');

            $paymentDetails = $storage->createModel();
            $paymentDetails['acct'] = 5105105105105100;
            $paymentDetails['cvv2'] = 123;
            $paymentDetails['expdate'] = 1214;
            $paymentDetails['amt'] = 86.00;
            $paymentDetails['currency'] = 'USD';
            $storage->updateModel($paymentDetails);

            $captureToken = $this->get('payum.security.token_factory')->createCaptureToken(
                $paymentName,
                $paymentDetails,
                'payment_details_view'
            );

            return $this->forward('BookBundle:Payment:view', array(
                    'payum_token' => $captureToken,
                ));

        }

        return array(
                'form' => $form->createView(),
                );
    }


    public function viewAction(Request $request)
    {
        $token = $this->get('payum.security.http_request_verifier')->verify($request);
        $payment = $this->get('payum')->getPayment($token->getPaymentName());

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

        try {
            $payment->execute(new SyncRequest($token));
        } catch (RequestNotSupportedException $e) {}


        if ($status->isSuccess()) {
            $this->getUser()->addCredits(100);
            $this->get('session')->getFlashBag()->set(
                'notice',
                'Payment success. Credits were added'
            );
        } else if ($status->isPending()) {
            print_r("pendiente");
            die();
            $this->get('session')->getFlashBag()->set(
                'notice',
                'Payment is still pending. Credits were not added'
            );
        } else {
            $this->get('session')->getFlashBag()->set('error', 'Payment failed');
        }
}
<?php
/*** Entity ***/

use Payum\Core\Model\ArrayObject;

class PaymentDetails extends ArrayObject
{
    protected $id;
    protected $created;
    protected $modified;
    protected $deletedAt;

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

}

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.