AuthorizeNet / sample-code-php

This repository contains working code samples which demonstrate php integration with the Authorize.Net API
MIT License
175 stars 197 forks source link

Error code : E00124 Error message : The provided access token is invalid #89

Closed prakash-2 closed 6 years ago

prakash-2 commented 7 years ago

Transaction Failed Error code : E00124 Error message : The provided access token is invalid Getting above error message while using method createVisaCheckoutTransaction()

ashtru commented 7 years ago

Hi @prakash-2, what is the method you are using to get the access token? Is it a sandbox or production merchant?

adavidw commented 7 years ago

Hi @ashtru,

This is in sandbox. The submitter ( @prakash-2 ) has more details in this community thread:

https://community.developer.authorize.net/t5/Integration-and-Testing/E00124-The-provided-access-token-is-invalid/td-p/58105

One thing he points out is that the sample code for Visa Checkout doesn't have an explicit assignment of marketType. Since marketType is required to be "0" for Visa Checkout, we should include a spot where that is assigned to override any default marketType in their account.

prakash-2 commented 7 years ago

Hi Ashutosh, we are using the source code and method provided in link https://github.com/AuthorizeNet/sample-code-php/blob/master/VisaCheckout/create-visa-checkout-transaction.php

we only update login key,txn key and response from visa checkout like encKey ,encData & CallID , and added Matket Type as '0' .

Do we explicitly need to create access token before calling method createVisaCheckoutTransaction() ?

prakash-2 commented 7 years ago

hi any update on this ..

adavidw commented 7 years ago

Do we explicitly need to create access token before calling method createVisaCheckoutTransaction() ?

What does this mean? Are you not already retrieving the token before each time you call createVisaCheckoutTransaction? I would expect that you need a new token each time. If you're reusing tokens, that could explain what you're seeing.

prakash-2 commented 7 years ago

Hi , My question is very simple what will happen when i use source code provided at

https://github.com/AuthorizeNet/sample-code-php/blob/master/VisaCheckout/create-visa-checkout-transaction.php

with MarketType as 0 and with my login,txn key and enckey,encdata and callid recieved from visa checkout.

As per my understanding it will create a transaction and it will be visible at my sandbox login under transaction list. But I am getting error "E00124".

Can you provide me a running sample code .

ashtru commented 6 years ago

Merchant authentication is missing in your code posted on the community. Your login id and transaction key need to be provided instead of the constants in the sample code lines .