thephpleague / omnipay-payfast

PayFast driver for the Omnipay PHP payment processing library
MIT License
21 stars 16 forks source link

Successful PDT response does not show as successful #4

Open georgeboot opened 9 years ago

georgeboot commented 9 years ago

When I run completePurchase() in the returnUrl, $response->isSuccessful() gives false. My $response shows the following (it looks like the break on \n doesn't work propper:

object(Omnipay\PayFast\Message\CompletePurchasePdtResponse)[799]
protected 'status' => string 'SUCCESS
m_payment_id=order_123456
pf_payment_id=159175
payment_status=COMPLETE
item_name=Test
item_description=
amount_gross=10.00
amount_fee=-0.23
amount_net=9.77
custom_str1=
custom_str2=
custom_str3=
custom_str4=
custom_str5=
custom_int1=
custom_int2=
custom_int3=
custom_int4=
custom_int5=
name_first=Test
name_last=User+01
email_address=sbtu01%40payfast.co.za
merchant_id=10000103
' (length=386)
  protected 'request' => 
    object(Omnipay\PayFast\Message\CompletePurchaseRequest)[794]
      protected 'liveEndpoint' => string 'https://www.payfast.co.za/eng' (length=29)
      protected 'testEndpoint' => string 'https://sandbox.payfast.co.za/eng' (length=33)
      protected 'parameters' => 
        object(Symfony\Component\HttpFoundation\ParameterBag)[797]
          protected 'parameters' => 
            array (size=4)
              ...
      protected 'httpClient' => 
        object(Guzzle\Http\Client)[787]
          protected 'defaultHeaders' => 
            object(Guzzle\Common\Collection)[789]
              ...
          protected 'userAgent' => string 'Guzzle/3.9.3 curl/7.35.0 PHP/5.6.6-1+deb.sury.org~trusty+1' (length=58)
          private 'config' => 
            object(Guzzle\Common\Collection)[788]
              ...
          private 'baseUrl' => string '' (length=0)
          private 'curlMulti' => 
            object(Guzzle\Http\Curl\CurlMultiProxy)[811]
              ...
          private 'uriTemplate' => 
            object(Guzzle\Parser\UriTemplate\UriTemplate)[798]
              ...
          protected 'requestFactory' => 
            object(Guzzle\Http\Message\RequestFactory)[790]
              ...
          protected 'eventDispatcher' => 
            object(Symfony\Component\EventDispatcher\EventDispatcher)[793]
              ...
      protected 'httpRequest' => 
        object(Illuminate\Http\Request)[4]
          protected 'json' => null
          protected 'sessionStore' => null
          public 'attributes' => 
            object(Symfony\Component\HttpFoundation\ParameterBag)[7]
              ...
          public 'request' => 
            object(Symfony\Component\HttpFoundation\ParameterBag)[5]
              ...
          public 'query' => 
            object(Symfony\Component\HttpFoundation\ParameterBag)[6]
              ...
          public 'server' => 
            object(Symfony\Component\HttpFoundation\ServerBag)[10]
              ...
          public 'files' => 
            object(Symfony\Component\HttpFoundation\FileBag)[9]
              ...
          public 'cookies' => 
            object(Symfony\Component\HttpFoundation\ParameterBag)[8]
              ...
          public 'headers' => 
            object(Symfony\Component\HttpFoundation\HeaderBag)[11]
              ...
          protected 'content' => null
          protected 'languages' => null
          protected 'charsets' => null
          protected 'encodings' => null
          protected 'acceptableContentTypes' => 
            array (size=5)
              ...
          protected 'pathInfo' => string '/testGatewayReturn' (length=18)
          protected 'requestUri' => string '/testGatewayReturn?pt=8e143d88-7da5-0f2f-dc60-f8345023ff1b' (length=58)
          protected 'baseUrl' => string '' (length=0)
          protected 'basePath' => null
          protected 'method' => string 'GET' (length=3)
          protected 'format' => null
          protected 'session' => 
            object(Illuminate\Session\Store)[167]
              ...
          protected 'locale' => null
          protected 'defaultLocale' => string 'en' (length=2)
      protected 'response' => 
        &object(Omnipay\PayFast\Message\CompletePurchasePdtResponse)[799]
  protected 'data' => 
    array (size=1)
      'SUCCESS
m_payment_id' => string 'order_123456
pf_payment_id=159175
payment_status=COMPLETE
item_name=Test
item_description=
amount_gross=10.00
amount_fee=-0.23
amount_net=9.77
custom_str1=
custom_str2=
custom_str3=
custom_str4=
custom_str5=
custom_int1=
custom_int2=
custom_int3=
custom_int4=
custom_int5=
name_first=Test
name_last=User 01
email_address=sbtu01@payfast.co.za
merchant_id=10000103
' (length=363)
hillelcoren commented 8 years ago

It looks like this has been corrected, however the change was made after the last PayFast release (https://github.com/thephpleague/omnipay-payfast/compare/v2.1.1...master). Are there any plans to create a new PayFast release?

shalomleib commented 4 years ago

Hi, this change was made after the last PayFast release (v2.1.1...master).

Are there any plans to create a new PayFast release?