OpenBuildings / omnipay-paypal

Rest API paypal processor for Omnipay
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Wrong Namespace #3

Open greydnls opened 8 years ago

greydnls commented 8 years ago

Hi, Since this isn't an official omnipay package you shouldn't be using the Omnipay namespace. Please change it to your personal namespace.

w3guy commented 8 years ago

I kinda in a similar boat @kayladnls because am writing a more improve 2checkout omnipay driver. The official one uses the deprecated parameter.

Here is the my repo btw https://github.com/collizo4sky/omnipay-2checkout (Still writing test for it).

Changing the root namespace from Omnipay to my Github userame "collizo4sky" wasn't a problem, the problem was how will the driver classes be instantiated by Omnipay::create()

For example, Here is an excerpt of my Gateway.php

namespace Collizo4sky\TwoCheckout;

use Omnipay\Common\AbstractGateway;

/**
 * 2Checkout Gateway.
 */
class Gateway extends AbstractGateway

How then will i be able to instantiate it via Omnipay::create() ?

Omnipay::create('TwoCheckout') won't work because it will be resolved as \Omnipay\TwoCheckout\Gateway

hkdobrev commented 8 years ago

@kayladnls I think a more appropriate resolution is to mark this package as abandoned as now you provide a built-in support for PayPal Rest API in the official Omnipay PayPal package.

Anyway, I think it was an oversight from us as I see you state to not reuse the namespace in the omnipay readme. However it was made like that with the best intentions so users would easily be able to use the package.

terdelyi commented 8 years ago

I'm not using this package, but I'm also developing some other Omnipay drivers and I arrived here from a Google search results page, but this conversation caught my attention. What's exactly the problem with the namespace @greydnls?