Re: Test Question

panzhicong
Dabbler

Test Question

Hi, I am trying to create a simple app using sample code provided on the developer website, that is able to enroll C/Hs for merchant offers. Before that, I got to know that I should onboard the merchants first (reading from the community discussion). However, when I try to use the Merchant API to onboard merchant, i got the below error. Can you please tell me what had happened?

Thanks.
Zhicong

 

---------------------error message below--------------------------------------

status:
404
content:
b'{"errorResponse":{"details":{"message":"Error in processing request, Please Contact Visa Inc."},"status":404}}'

3 REPLIES 3
ricardo_visa
Community Scholar

Re: Test Question

Hi Zhicong, 

 

Can you send over the inputs from your request?

 

I will look into this for you.

 

-Ricardo 




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

Re: Test Question

Hi Ricardo,

 

What inputs are you referring to? The merchant details?

I am using the exact piece of code provided in the sample on the developer website. See below for your reference.

 

-----------Python code below:-------------------------------------------------------------------------------------------------------

 

import requests

 

url = "https://sandbox.api.visa.com/vop/merchant/v1/onboard"

cert = "C:/Users/zhpan/Desktop/Visa_Developer/MrchRecom/cert.pem"

key = "C:/Users/zhpan/Desktop/Visa_Developer/MrchRecom/key_0b5af723-2e56-464d-a9ab-3a43eee8191d.pem"

user_id = "1AUQL3TANJIWH3JMYUB72153HzGThdHUx_SK0Vb91AVXgei3M"

password = "71PwFrYThtJ132BZ3fxWAV3VE3"

headers = {'Accept': 'application/json','Authorization': {user_id: password}}

 

body = {

"onboardMerchantDetails": [

   {

     "visaMerchantName": "Try JUICE",

     "visaMerchantId": "54893549"

   }

],

"communityCode": "SANDBOX"

}

 

r = requests.post(url,

cert = (cert,key),

headers = headers,

auth = (user_id, password),

data = body)

print ('status:')

print (r.status_code)

print ('content:')

print (r.content)

ricardo_visa
Community Scholar

Re: Test Question

Hi there,

 

Try and use the visamerchant name as per the test data in Portal , a sample valid payload would be

 

body = {

"onboardMerchantDetails": [

   {

     "visaMerchantName": "JAMBA JUICE",

     "visaMerchantId": " 54893534"

   }

],

"communityCode": "SANDBOX"

}

 

Let me know how that goes. 

 

Thanks,

Ricardo




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