Hounddd / omnipay-systempay

SystemPay driver for the Omnipay PHP payment processing library
MIT License
0 stars 5 forks source link

Add missing getMerchantId and setMerchantId in Gateway.php #6

Closed PubliAlex closed 3 years ago

PubliAlex commented 3 years ago

Hello,

When you try to get default parameters for this gateway, it return an array of 3 things :

    return array(
        'merchantId' => '',
        'certificate' => '',
        'testMode' => false,
    );

But, when you call :

    $gateway->initialize([
        'merchantId' => $merchantId,
        'certificate' => $certificate,
        'testMode' => $testMode,
    ]);

and you debug the gateway variable, you see that the merchantId is empty whereas the certificate is correctly filled.

The reason is that the Gateway.php file have methods to set and get certificate, but not the merchantId. You can add the merchant Id by proving it as options when you call the completePurchase method for example, but it sound more logical to initialise it when you initialize the gateway, like the certificate. And for that, you need the get and set Method in the Gateway class.

Here is the PR that fix this

Best regards,

damsfx commented 3 years ago

Many thanks @PubliAlex !

I only have one site using this platform at the moment, but I'm going to set up a test site using Offline.Mall (which you know well) and a provider.
Have you coded or do you know of such a provider for the Mall plugin?

PubliAlex commented 3 years ago

Hello @damsfx

I have a private systempay plugin for mall that rely on your repository. It's still WIP but near to be finished. I had to patch your repository to make it works (that's the reason of my PR)

If you want, I can give you a read access to that module to allow you to test it