thephpleague / omnipay-paypal

PayPal driver for the Omnipay PHP payment processing library
MIT License
299 stars 175 forks source link

No support for instalment purchase option. #210

Open MarlonEtiene opened 6 years ago

MarlonEtiene commented 6 years ago

Hallo I am from Brazil, and here we can buy with credit card in installments

I have tried to many ways to make paypal purchase to show instalments option.

After long searching I found what I think the problem. let me explain:

In the class ExpressGateway you have a method called purchase, but this method call other method called authorize and this authorize method make a request based in \Omnipay\PayPal\Message\ExpressAuthorizeRequest.

The problem is in \Omnipay\PayPal\Message\ExpressAuthorizeRequest the parameter PAYMENTREQUEST_0_PAYMENTACTION is equal Authorization and to enable the purchase instalment option the paypal need this parameter seted as Sale.

I do not found a class ExpressPurchaseRequest and I think this is the problem. When we call purchase the package set the request as Authorization, and does not show the instalment option

I just changed this parameter in the referenced class from Authorization to Sale and the installment option was enabled.

I think this method purchase need to create a request same the authorize method and call a properly class and set the parameter with the correct value Sale.

Could yuo help me?

Thanks in advance.