title: Trying to integrate Tap Payment gateway in codeigniter
body: <p>I am trying to integrate Tap payment gateway in Codeigniter. I am using <a href="https://github.com/iZaL/tap-payment-php" rel="nofollow noreferrer">https://github.com/iZaL/tap-payment-php</a> api. Because this does't give you any php support or any documentation.</p>
  
  <p>So, I was busting my head from last 2 days to get this thing work, and so far I have done this.</p>
  
  <p>This is the response i am successfully getting: </p>
  
  <pre><code>    BILLING
  IZaL\Tap\TapBilling Object
  (
      [ApiKey:protected] =&gt; 1tap7
      [MerchantID:protected] =&gt; mymercid
      [UserName:protected] =&gt; Tap@PS13
      [Password:protected] =&gt; *****
      [ErrorURL:protected] =&gt; 
      [PaymentURL:protected] =&gt; https://www.gotapnow.com/TapWebConnect/Tap/WebPay/PaymentRequest
      [PaymentOption:protected] =&gt; ALL
      [AutoReturn:protected] =&gt; Y
      [CurrencyCode:protected] =&gt; KWD
      [LangCode:protected] =&gt; AR
      [TotalAmount:protected] =&gt; 800
      [customerInfo:protected] =&gt; Array
          (
              [Email] =&gt; customer@email.com
              [Name] =&gt; Awesome Customer
              [Mobile] =&gt; 9999999
          )
  
      [productInfo:protected] =&gt; Array
          (
              [0] =&gt; Array
                  (
                      [Quantity] =&gt; 1
                      [TotalPrice] =&gt; 500
                      [UnitName] =&gt; Product Name
                      [UnitDesc] =&gt; Product Description
                      [UnitPrice] =&gt; 500
                  )
  
              [1] =&gt; Array
                  (
                      [Quantity] =&gt; 2
                      [TotalPrice] =&gt; 300
                      [UnitName] =&gt; Product Name
                      [UnitDesc] =&gt; Product Description
                      [UnitPrice] =&gt; 150
                  )
  
          )
  
      [gatewayInfo:protected] =&gt; Array
          (
              [Name] =&gt; ALL
          )
  
      [merchantInfo:protected] =&gt; Array
          (
              [ReturnURL] =&gt; http://sandbox/tap-payment-php-master/tests/TapBillingTest.php
              [ReferenceID] =&gt; 5addbc03781e0
          )
  
      [response] =&gt; IZaL\Tap\TapBillingResponse Object
          (
              [response] =&gt; GuzzleHttp\Psr7\Response Object
                  (
                      [reasonPhrase:GuzzleHttp\Psr7\Response:private] =&gt; OK
                      [statusCode:GuzzleHttp\Psr7\Response:private] =&gt; 200
                      [headers:GuzzleHttp\Psr7\Response:private] =&gt; Array
                          (
                              [Cache-Control] =&gt; Array
                                  (
                                      [0] =&gt; no-cache
                                  )
  
                              [Pragma] =&gt; Array
                                  (
                                      [0] =&gt; no-cache
                                  )
  
                              [Content-Type] =&gt; Array
                                  (
                                      [0] =&gt; application/json; charset=utf-8
                                  )
  
                              [Expires] =&gt; Array
                                  (
                                      [0] =&gt; -1
                                  )
  
                              [Server] =&gt; Array
                                  (
                                      [0] =&gt; Microsoft-IIS/8.0
                                  )
  
                              [X-Powered-By] =&gt; Array
                                  (
                                      [0] =&gt; UrlRewriter.NET 1.7.0
                                  )
  
                              [X-AspNet-Version] =&gt; Array
                                  (
                                      [0] =&gt; 4.0.30319
                                  )
  
                              [Date] =&gt; Array
                                  (
                                      [0] =&gt; Mon, 23 Apr 2018 11:01:38 GMT
                                  )
  
                              [Content-Length] =&gt; Array
                                  (
                                      [0] =&gt; 251
                                  )
  
                          )
  
                      [headerNames:GuzzleHttp\Psr7\Response:private] =&gt; Array
                          (
                              [cache-control] =&gt; Cache-Control
                              [pragma] =&gt; Pragma
                              [content-type] =&gt; Content-Type
                              [expires] =&gt; Expires
                              [server] =&gt; Server
                              [x-powered-by] =&gt; X-Powered-By
                              [x-aspnet-version] =&gt; X-AspNet-Version
                              [date] =&gt; Date
                              [content-length] =&gt; Content-Length
                          )
  
                      [protocol:GuzzleHttp\Psr7\Response:private] =&gt; 1.1
                      [stream:GuzzleHttp\Psr7\Response:private] =&gt; GuzzleHttp\Psr7\Stream Object
                          (
                              [stream:GuzzleHttp\Psr7\Stream:private] =&gt; Resource id #43
                              [size:GuzzleHttp\Psr7\Stream:private] =&gt; 
                              [seekable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                              [readable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                              [writable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                              [uri:GuzzleHttp\Psr7\Stream:private] =&gt; php://temp
                              [customMetadata:GuzzleHttp\Psr7\Stream:private] =&gt; Array
                                  (
                                  )
  
                          )
  
                  )
  
              [ApiKey:protected] =&gt; 
              [MerchantID:protected] =&gt; 
              [UserName:protected] =&gt; 
              [Password:protected] =&gt; 
              [ErrorURL:protected] =&gt; 
              [PaymentURL:protected] =&gt; https://www.gotapnow.com/TapWebConnect/Tap/WebPay/PaymentRequest
              [PaymentOption:protected] =&gt; ALL
              [AutoReturn:protected] =&gt; Y
              [CurrencyCode:protected] =&gt; KWD
              [LangCode:protected] =&gt; AR
              [TotalAmount:protected] =&gt; 800
              [customerInfo:protected] =&gt; Array
                  (
                  )
  
              [productInfo:protected] =&gt; Array
                  (
                  )
  
              [gatewayInfo:protected] =&gt; Array
                  (
                  )
  
              [merchantInfo:protected] =&gt; Array
                  (
                  )
  
              [requiredConstructorKeys:protected] =&gt; Array
                  (
                  )
  
          )
  
      [requiredConstructorKeys:protected] =&gt; Array
          (
          )
  
  )
  paymentRequest
  
  IZaL\Tap\TapBilling Object
  (
      [ApiKey:protected] =&gt; 1tap7
      [MerchantID:protected] =&gt; 70518
      [UserName:protected] =&gt; Tap@PS13
      [Password:protected] =&gt; PSt@13Tap
      [ErrorURL:protected] =&gt; 
      [PaymentURL:protected] =&gt; https://www.gotapnow.com/TapWebConnect/Tap/WebPay/PaymentRequest
      [PaymentOption:protected] =&gt; ALL
      [AutoReturn:protected] =&gt; Y
      [CurrencyCode:protected] =&gt; KWD
      [LangCode:protected] =&gt; AR
      [TotalAmount:protected] =&gt; 800
      [customerInfo:protected] =&gt; Array
          (
              [Email] =&gt; customer@email.com
              [Name] =&gt; Awesome Customer
              [Mobile] =&gt; 9999999
          )
  
      [productInfo:protected] =&gt; Array
          (
              [0] =&gt; Array
                  (
                      [Quantity] =&gt; 1
                      [TotalPrice] =&gt; 500
                      [UnitName] =&gt; Product Name
                      [UnitDesc] =&gt; Product Description
                      [UnitPrice] =&gt; 500
                  )
  
              [1] =&gt; Array
                  (
                      [Quantity] =&gt; 2
                      [TotalPrice] =&gt; 300
                      [UnitName] =&gt; Product Name
                      [UnitDesc] =&gt; Product Description
                      [UnitPrice] =&gt; 150
                  )
  
          )
  
      [gatewayInfo:protected] =&gt; Array
          (
              [Name] =&gt; ALL
          )
  
      [merchantInfo:protected] =&gt; Array
          (
              [ReturnURL] =&gt; http://sandbox/tap-payment-php-master/tests/TapBillingTest.php
              [ReferenceID] =&gt; 5addbc03781e0
          )
  
      [response] =&gt; IZaL\Tap\TapBillingResponse Object
          (
              [response] =&gt; GuzzleHttp\Psr7\Response Object
                  (
                      [reasonPhrase:GuzzleHttp\Psr7\Response:private] =&gt; OK
                      [statusCode:GuzzleHttp\Psr7\Response:private] =&gt; 200
                      [headers:GuzzleHttp\Psr7\Response:private] =&gt; Array
                          (
                              [Cache-Control] =&gt; Array
                                  (
                                      [0] =&gt; no-cache
                                  )
  
                              [Pragma] =&gt; Array
                                  (
                                      [0] =&gt; no-cache
                                  )
  
                              [Content-Type] =&gt; Array
                                  (
                                      [0] =&gt; application/json; charset=utf-8
                                  )
  
                              [Expires] =&gt; Array
                                  (
                                      [0] =&gt; -1
                                  )
  
                              [Server] =&gt; Array
                                  (
                                      [0] =&gt; Microsoft-IIS/8.0
                                  )
  
                              [X-Powered-By] =&gt; Array
                                  (
                                      [0] =&gt; UrlRewriter.NET 1.7.0
                                  )
  
                              [X-AspNet-Version] =&gt; Array
                                  (
                                      [0] =&gt; 4.0.30319
                                  )
  
                              [Date] =&gt; Array
                                  (
                                      [0] =&gt; Mon, 23 Apr 2018 11:01:38 GMT
                                  )
  
                              [Content-Length] =&gt; Array
                                  (
                                      [0] =&gt; 251
                                  )
  
                          )
  
                      [headerNames:GuzzleHttp\Psr7\Response:private] =&gt; Array
                          (
                              [cache-control] =&gt; Cache-Control
                              [pragma] =&gt; Pragma
                              [content-type] =&gt; Content-Type
                              [expires] =&gt; Expires
                              [server] =&gt; Server
                              [x-powered-by] =&gt; X-Powered-By
                              [x-aspnet-version] =&gt; X-AspNet-Version
                              [date] =&gt; Date
                              [content-length] =&gt; Content-Length
                          )
  
                      [protocol:GuzzleHttp\Psr7\Response:private] =&gt; 1.1
                      [stream:GuzzleHttp\Psr7\Response:private] =&gt; GuzzleHttp\Psr7\Stream Object
                          (
                              [stream:GuzzleHttp\Psr7\Stream:private] =&gt; Resource id #43
                              [size:GuzzleHttp\Psr7\Stream:private] =&gt; 
                              [seekable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                              [readable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                              [writable:GuzzleHttp\Psr7\Stream:private] =&gt; 1
                              [uri:GuzzleHttp\Psr7\Stream:private] =&gt; php://temp
                              [customMetadata:GuzzleHttp\Psr7\Stream:private] =&gt; Array
                                  (
                                  )
  
                          )
  
                  )
  
              [ApiKey:protected] =&gt; 
              [MerchantID:protected] =&gt; 
              [UserName:protected] =&gt; 
              [Password:protected] =&gt; 
              [ErrorURL:protected] =&gt; 
              [PaymentURL:protected] =&gt; https://www.gotapnow.com/TapWebConnect/Tap/WebPay/PaymentRequest
              [PaymentOption:protected] =&gt; ALL
              [AutoReturn:protected] =&gt; Y
              [CurrencyCode:protected] =&gt; KWD
              [LangCode:protected] =&gt; AR
              [TotalAmount:protected] =&gt; 800
              [customerInfo:protected] =&gt; Array
                  (
                  )
  
              [productInfo:protected] =&gt; Array
                  (
                  )
  
              [gatewayInfo:protected] =&gt; Array
                  (
                  )
  
              [merchantInfo:protected] =&gt; Array
                  (
                  )
  
              [requiredConstructorKeys:protected] =&gt; Array
                  (
                  )
  
          )
  
      [requiredConstructorKeys:protected] =&gt; Array
          (
          )
  
  )
  payment Response
  
  stdClass Object
  (
      [ReferenceID] =&gt; 204232018320144980
      [ResponseCode] =&gt; 0
      [ResponseMessage] =&gt; Success
      [TapPayURL] =&gt; https://www.gotapnow.com/webpay.aspx
      [PaymentURL] =&gt; https://www.gotapnow.com/webpay.aspx?ref=204232018320144980&amp;sess=ir2%2bGzVBwwM51cvkOTtnR69nS%2bVU24bu
  )
  paymentURL
  
  https://www.gotapnow.com/webpay.aspx?ref=204232018320144980&amp;sess=ir2%2bGzVBwwM51cvkOTtnR69nS%2bVU24bu
  paymentReferenceID
  
  204232018320144980
  null 
  </code></pre>
  
  <p>As you can see in the end, I am getting success response, but when I am hitting this url it gives to me:</p>
  
  <blockquote>
    <p>An error was encountered while processing your payment!</p>
  </blockquote>
  
  <p>I tried everything on my side and other, so if anyone can help my it would be really great.</p>
  
  <p>Thanks! </p>