Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I request for token with Merchant ID and APP ID #33

Open
Nasirkhan-259 opened this issue Apr 12, 2023 · 2 comments
Open

Can I request for token with Merchant ID and APP ID #33

Nasirkhan-259 opened this issue Apr 12, 2023 · 2 comments

Comments

@Nasirkhan-259
Copy link

I am trying to get access token via Merchant Id and APP ID , is it possible
As I don't have client_id and client_secret
TypeError: Argument 1 passed to Sebdesign\VivaPayments\OAuth::token() must be of the type string, null given

@sebdesign
Copy link
Owner

I don't think it's possible to get an access token using the Merchant ID and the App ID.
https://developer.vivawallet.com/integration-reference/oauth2-authentication/#step-2-request-access-token

Can you show me the code? It seems you are passing null instead of a string.

@Nasirkhan-259
Copy link
Author

$oauth = app(OAuth::class);
// Using `client_id` and `client_secret` from `config/services.php`:
// The token will be automatically stored on the client and used as a Bearer token.
        $token = $oauth->requestToken('**********', '**********', $guzzleOptions = []);
        dd($token);

this is the error that return now I am using client id and client secret id instead if merchant Id and App Id

GuzzleHttp\Exception\ClientException: Client error: `POST https://demo-accounts.vivapayments.com/connect/token` resulted in a `400 Bad Request` response:
{"error":"invalid_client"}
 in file C:\xamp_7.4\htdocs\mobileapi\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113 

Am I missing something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants