commercetools / commercetools-php-sdk

The e-commerce SDK from commercetools for PHP.
https://docs.commercetools.com/sdk/php-sdk#php-sdk-v1
MIT License
43 stars 22 forks source link

PaymentInfo does not exist and could not be loaded #158

Closed chuykov closed 9 years ago

chuykov commented 9 years ago

According to the following documentation Order , I try to call method:

$paymentInfo = $payment->getPaymentInfo();

I suppose that $paymentInfo it is instance of PaymentInfo , however I get a weird error:

Warning: class_implements(): Class \Commercetools\Core\Model\Cart\PaymentInfo does not exist and could not be loaded in vendor/commercetools/php-sdk/src/Model/Common/AbstractJsonDeserializeObject.php on line 62

Could you please advise what I'm doing wrong?

Maybe in the commit src/Model/Order/Order.php instead of:

class Order extends Resource
{
    public function fieldDefinitions()
    {
        return [
            'paymentInfo' => [static::TYPE => '\Commercetools\Core\Model\Cart\PaymentInfo']
        ];
    }
}

there should be something like the following:

class Order extends Resource
{
    public function fieldDefinitions()
    {
        return [
            'paymentInfo' => [static::TYPE => '\Commercetools\Core\Model\Payment\PaymentInfo']
        ];
    }
}

Could you please tell what is your idea on this?

jenschude commented 9 years ago

You are right. Just hotfixed it and tagged it as RC6.

Thanks! :+1: