how to get my shared Credentials from my project

ashOne
Regular Visitor

how to get my shared Credentials from my project

I can not found any  shared Credentials in my project. when I create the visa-in-app project step by step , then select " API KEY - Shared Secret (X-Pay-Token) " as  Authentication Method , and done. in  the project , but i can not found it in Credentials tab . how can I get it .

here is the screenshot:

 

asd.jpg

3 REPLIES 3
SyedSa
Community Moderator

Re: how to get my shared Credentials from my project

Hi @ashOneThank you for reaching out. An agent will get back to you as soon as possible. Until then, if any community member has information that may be helpful, please feel free to reply.

API_Products
Visa Developer Support Specialist

Re: how to get my shared Credentials from my project

Hey @ashOne,

 

If you have created a project on the Visa Developer Platform and selected "API Key - Shared Secret (X-Pay-Token)" as the authentication method, but you cannot find the shared credentials in the Credentials tab, follow these steps to retrieve them:

 

Steps to Retrieve Shared Credentials on Visa Developer Platform

1. Log in to the Visa Developer Portal
- Go to the Visa Developer Portal at https://developer.visa.com/ and log in with your credentials.

2. Access Your Project
- Navigate to the "Projects" section and select the project you have created.

3. Navigate to the Credentials Tab
- Within your project, go to the "Credentials" tab. This is where all your API keys and credentials are listed.

4. Check API Key and Shared Secret
- In the "Credentials" tab, you should find your API Key. The shared secret for generating the X-Pay-Token should also be listed here. If it’s not visible immediately, there might be a "Show" button or similar option to reveal the secret.

5. If Credentials Are Missing
- If you still cannot find the shared credentials, try the following steps:
- Refresh the Page: Sometimes, credentials might not load correctly. Refresh the page and check again.
- Create a New Credential: In some cases, you may need to create new credentials. Look for an option to generate new API keys or credentials within the Credentials tab.
- Contact Visa Support: If you are unable to find the credentials after trying the above steps, contact Visa Developer Support for assistance. They can help you retrieve or reset the shared credentials.

 

Example of Using X-Pay-Token

 

Here is an example of how you might use the shared secret to generate an X-Pay-Token for API requests:

```python

 

# START 
import hashlib
import hmac
import time

# Replace with your actual credentials
api_key = "your_api_key"
shared_secret = "your_shared_secret"
resource_path = "/v1/payment"
query_string = "apikey=" + api_key
body = ""

# Generate the timestamp
timestamp = int(round(time.time() * 1000))

# Create the prehash string
prehash_string = timestamp + resource_path + query_string + body

# Generate the HMAC SHA256 signature
signature = hmac.new(bytes(shared_secret, 'utf-8'), bytes(prehash_string, 'utf-8'), hashlib.sha256).hexdigest()

# Construct the X-Pay-Token
x_pay_token = "xv2:" + str(timestamp) + ":" + signature

print("X-Pay-Token:", x_pay_token)
# END 
```

 

Your API Key and Shared Secret should be available in the Credentials tab of your project on the Visa Developer Platform. If they are not visible, try refreshing the page, creating new credentials, or contacting Visa Developer Support for help.




Thanks,

Diana H.



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

ashOne
Regular Visitor

Re: how to get my shared Credentials from my project

it still don't work.