Omnipay

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
harshithvemula
Posts: 33
Joined: 19 Jul 2020, 16:27

Omnipay

Post by harshithvemula » 28 Nov 2020, 18:54

I tried to add payu , 2checkout , paypal using omnipay but it doesnt work. I got the error "class Omnipay/Payu or paypal or 2checkout/Gateway" not found. And i tried a payment gateway instamojo it worked ( I didnt got any class not found error ) and i saw that the folder structure of instamojo was "gentor/omnipay-instamojo/src/Omnipay/Instamojo/Gateway.php" It worked but with an error purpose parameter not found . But when it comes to paypal or payu the folder structure was "bileto/omnipay-instamojo/src/Gateway.php" and i am getting the following error "class Omnipay/Payu or paypal or 2checkout/Gateway" not found. Is this class not found error because of folder structure or something ?
Please help me with class not found error for payu, paypal, or help me with instamojo by solving purpose parameter not found error

Code: Select all

 "aimeos/ai-payments": "^2020.10",
    composer require league/omnipay:^3 omnipay/paypal
    instamojo,payu

---Thank you

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Omnipay

Post by aimeos » 30 Nov 2020, 14:08

The directory structure is different because of the used PSR-0 and PSR-4 standards but that doesn't matter if you installed the drivers correctly. Did you use a command like this to install the payment drivers?

Code: Select all

composer req aimeos/ai-payments gentor/omnipay-instamojo bileto/omnipay-payu omnipay/2checkout
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
harshithvemula
Posts: 33
Joined: 19 Jul 2020, 16:27

Re: Omnipay

Post by harshithvemula » 30 Nov 2020, 15:44

Yes i used those commands to install the drivers

Code: Select all

"aimeos/ai-payments": "^2020.10",
    composer require league/omnipay:^3 omnipay/paypal

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Omnipay

Post by aimeos » 01 Dec 2020, 14:34

Not all Omnipay drivers work out of the box as many developers only implment them for their own project and don't fully follow the rule for implemenation.

Also, you have to check how the payment gateway class is named and what parameter it requires. Many drivers don't have a suitable readme file and you have to look at the gateway class directly. For the 2checkout driver, the gateway name is "TwoCheckout" and the required parameters are listed here:
https://github.com/thephpleague/omnipay ... hp#L24-L25
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

FakeNymph
Posts: 1
Joined: 22 Dec 2020, 11:38

Re: Omnipay

Post by FakeNymph » 22 Dec 2020, 11:39

aimeos wrote: 01 Dec 2020, 14:34 Not all Omnipay drivers work out of the box as many developers only implment them for their own project and don't fully follow the rule for implemenation.

Also, you have to check how the payment gateway class is named and what parameter it requires. Many drivers don't have a suitable readme file and you have to look at the gateway class directly. For the 2checkout driver, the gateway name is "TwoCheckout" and the required parameters are listed here:
https://github.com/thephpleague/omnipay ... hp#L24-L25
This worked perfectly, thanks!

User avatar
harshithvemula
Posts: 33
Joined: 19 Jul 2020, 16:27

Re: Omnipay

Post by harshithvemula » 25 Dec 2020, 18:37

2checkout worked for me also.Please help me with payu 'Omnipay/payu/Gateway' not found error,i am getting continously.I tried in many ways please help me."alegra/omnipay-payu": "^0.0.21", is the package name i am using. May be the gateway name i am using "payu" is wrong

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Omnipay

Post by aimeos » 27 Dec 2020, 17:59

The bileto/omnipay-payu driver is for Omnipay 2.x only and doesn't support current Omnipay 3.x. You can try to ask the mainainer for the driver for help.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
harshithvemula
Posts: 33
Joined: 19 Jul 2020, 16:27

Re: Omnipay

Post by harshithvemula » 12 Apr 2021, 09:22

After successful payment I am redirecting to the below url but the payment status is unfinished.

Code: Select all

http://127.0.0.1:8000/shop/confirm/Instamojo?payment_id=MOJO1412705N45333693&payment_status=Credit&payment_request_id=d7249b9a0c5545c69f5929587e541946
ORDER STATUS


Order ID :247
Payment status : unfinished

User avatar
aimeos
Administrator
Posts: 7835
Joined: 01 Jan 1970, 00:00

Re: Omnipay

Post by aimeos » 14 Apr 2021, 08:27

Check what happens in the InstaMojo driver and what is passed to the Omnipay class here:
https://github.com/aimeoscom/ai-payment ... #L535-L602
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
harshithvemula
Posts: 33
Joined: 19 Jul 2020, 16:27

Re: Omnipay

Post by harshithvemula » 20 Apr 2021, 17:39

I am trying from 3 days but not able to solve. please help me.

Instamojo driver code below (Response.php)

Code: Select all


    /**
     * Was the transaction successful?
     *
     * @return string Transaction status, one of {@see STATUS_COMPLETED}, {@see #STATUS_PENDING},
     * or {@see #STATUS_FAILED}.
     */
    public function getTransactionStatus()
    {
        return static::STATUS_PENDING;
    }

      public function isSuccessful()
    {
       return false;
        
        //return !empty($this->data['success']);
        //return $this->getTransactionStatus() === static::STATUS_PENDING;
        // return $this->getTransactionStatus() === static::STATUS_COMPLETED ;
          
    }


}

Post Reply