omnipay payment wall integration -Error

404 views Asked by At

I tried to implement paymentwall payment gateway integration with Laravel using omnipay library.After setting setApiType, setPublicKey and setPrivateKey and trying to call the API, its getting the response "Public key is missed or invalid" from payment wall gateway. Actually this error is happened due to passing parameter public key as public_Key instead of public_key from the omnipay library.

The following is the response

[request:protected] => Omnipay\PaymentWall\Message\PurchaseRequest Object
        (
            [endPoint:protected] => https://api.paymentwall.com/api
            [parameters:protected] => Symfony\Component\HttpFoundation\ParameterBag Object
                (
  [parameters:protected] => Array
                        (
                            [apiType] => 0
                            [publicKey] => hjghjghsdfsc5464564564e56456
                            [privateKey] => gfh4567686786787hfjfhgfgfgh
                            [amount] => 10.00
                            [currency] => USD
                            [accountId] => 
                            [description] => test Pay
                            [email] => [email protected]
                            [clientIp] => 112.133.236.158
                            [browserDomain] => test.com
                            [card] => Omnipay\Common\CreditCard Object



[response:protected] => Omnipay\PaymentWall\Message\Response Object
 *RECURSION*
            [zeroAmountAllowed:protected] => 1
            [negativeAmountAllowed:protected] => 
        )

    [data:protected] => Array
        (
            [type] => Error
            [object] => Error
            [error] => Public key is missed or invalid
            [code] => 2111
            [log] => 
        )

)

Public key is missed or invalid

1

There are 1 answers

0
delatbabel On

As I commented in the issue that you raised on github:

  • This is working for everyone else. Are you sure there isn't really an issue with your keys? Can you check that there are no spurious newlines, etc, in your key as provided to the library?
  • The correct name for the public key parameter within Omnipay is publicKey. The correct name within the paymentwall library is public_key. A check of the code appears to indicate that the parameter naming is correct. The Omnipay publicKey parameter is correctly passed to the paymentwall library as public_key.