dercoder / omnipay-neteller

Neteller REST driver for the Omnipay PHP payment processing library
MIT License
2 stars 8 forks source link

Basic usage #1

Closed icaroscherma closed 5 years ago

icaroscherma commented 7 years ago

Hey, thanks for implementing the Neteller gateway for Omnipay =) I'm trying to use it (with Laravel-Omnipay) and after basic tests I couldn't proceed, I'm getting the following error:

Client error response\n
[status code] 401\n
[reason phrase] Unauthorized\n
[url] https://test.api.neteller.com/v1/oauth2/token?grant_type=client_credentials

In My config I'm using:

return [
    'default'  => 'neteller',
    'gateways' => [
        'neteller' => [
            'driver' => 'Neteller',
            'options' => [
                'testMode'     => true,
                'clientId'     => '12345',
                'clientSecret' => '213123123123123'
            ]
        ],
    ]
];

... and inside my routes, the test itself is:

Route::get('teste-pay', function() {
    $response = \Omnipay::purchase([
        'account'          => '12345',
        'verificationCode' => '54321',
        'transactionId'    => '55555',
        'amount'           => '100.00',
        'currency'         => 'USD',
    ])->send();

    dd($response->getMessage());
});

Even to the test-server I need to proper authenticate? And (as a recommendation), what would be a nice approach to get (and store) those data from the clients before pay those stuff, and this "verificationCode" and "transactionId" are from my system or from the Neteller app? =x

dercoder commented 7 years ago

Hi, yes you need an valid clienId and clientSecret to authenticate in test mode. Please ask Neteller to create an test account for you. It's also important to use the "old" API v1

transactionId must be set from your system and verifcationCode is the password (secure ID) from the customer like account parameter

You can find this test credentials here: https://paysafegroup.github.io/neteller_rest_api_v1/#/introduction/test-member-accounts

dercoder commented 7 years ago

Example usage:


$gateway = new Omnipay\Neteller\Gateway();
$gateway->setTestMode(true);
$gateway->setClientId('TEST_CLIENT_ID');
$gateway->setClientSecret('TEST_CLIENT_SECRET');
$response = $gateway->purchase([
    'amount'           => 5.00,
    'currency'         => 'USD',
    'transactionId'    => uniqid(),
    'account'          => 'netellertest_USD@neteller.com',
    'verificationCode' => '270955'
])->send();`