Re: how to test

Solved! Go to solution
amalsalim
Helper

how to test

So I have sandbox and I'm able to send requests and create rules for VTC. However this is for test data. 

 

How can i test with testdata?
For example: I created a spending rule on VTC where any item purchased above $20 is rejected. How can simulate a card swipe to see if this works as configured?

3 REPLIES 3
API_Managers
Visa Developer Support Specialist

Re: how to test

Hey @amalsalim,

 

We don't have an API to emulate Magstripe transactions. Note that you cannot emulate a swipe. For a card present transaction, the interaction must be between the card and the magstripe reader.



 




Thanks,

Tee



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

amalsalim
Helper

Re: how to test

ok..so I'm confused on how i can test the notification API. The notification API is to be called from the Visa server, and if I can't emulate a mag stripe, how can I invoke the notification API from the visa server?

 

thanks

Amal

API_Managers
Visa Developer Support Specialist

Re: how to test

Hey @amalsalim,

 

Visa Transaction Controls (VTC) can also send email notification. Please follow below steps to receive last mile alert delivery on Email. Currently, Sandbox supports only Email. SMS and PUSH are not available.
 
VTC Alert Delivery - Email
• Register a card
EndPoint: https://sandbox.api.visa.com/vctc/customerrules/v1/consumertransactioncontrols
Request
{"primaryAccountNumber": "418543265390XXXX"}
Response
{
  "receivedTimestamp": "2019-04-05 16:45:13.958",
  "resource": {
    "lastUpdateTimeStamp": "2019-04-05 16:42:59",
    "documentID": "ctc-vd-5c063ea2-257a-4bc1-860b-6a70f0982c0c"
  },
  "processingTimeinMs": 4
}
 
• Create a Customer Profile and set up Customer Alert Preferences using Email
EndPoint: https://sandbox.api.visa.com/vctc/customerrules/v1/consumertransactioncontrols/customer
Request
{
  "lastName": "Sam",
  "firstName": "Jim",
  "preferredLanguage": "en-us",
  "userIdentifier": "jim123",
  "countryCode": "USA",
  "primaryAccountNumber": "418543265390XXXX",
  "defaultAlertsPreferences": [{
    "isVerified": "true",
    "contactValue": "test@abc.com",
    "contactType": "Email",
    "preferredEmailFormat": "Html",
    "status": "Active"
  }]
}
 
Response
{
  "receivedTimestamp": "2019-04-05 16:46:03.938",
  "resource": {
    "isProfileActive": true,
    "firstName": "Jim",
    "lastName": "Sam",
    "preferredLanguage": "en-us",
    "portfolioID": "001",
    "userIdentifier": "jim123",
    "preferredCountryCode": "USA",
    "defaultAlertsPreferences": [{
      "contactValue": "test@abc.com",
      "isVerified": true,
      "contactType": "Email",
      "preferredEmailFormat": "Html",
      "status": "Active"
    }]
  },
  "processingTimeinMs": 408
}
 
 
• Set Global Control for Card Off – Use the document ID from the card registration response and userIdentifier from the Customer Profile request on the below endpoint to set up the global control.
EndPoint: https://sandbox.api.visa.com/vctc/customerrules/v1/consumertransactioncontrols/ctc-vd-5c063ea2-257a-...
Request
{"globalControls": [{
  "shouldDeclineAll": true,
  "isControlEnabled": true,
  "userIdentifier": "jim123",
  "alertThreshold": 0,
  "shouldAlertOnDecline": true
}]}
Response
{
  "receivedTimestamp": "2019-04-05 16:49:17.937",
  "resource": {
    "globalControls": [{
      "shouldDeclineAll": true,
      "isControlEnabled": true,
      "userIdentifier": "jim123",
      "alertThreshold": 0,
      "shouldAlertOnDecline": true
    }],
    "lastUpdateTimeStamp": "2019-04-05 16:49:17",
    "documentID": "ctc-vd-5c063ea2-257a-4bc1-860b-6a70f0982c0c"
  },
  "processingTimeinMs": 336
}
 
 
• Authorization Decision Request
EndPoint: https://sandbox.api.visa.com/vctc/validation/v1/decisions
Request
{
  "cardholderBillAmount": 500,
  "pointOfServiceInfo": {
    "securityCondition": "IDENTIFICATION_VERIFIED",
    "terminalClass": {
      "isAttended": false,
      "howOperated": "CUSTOMER_OPERATED",
      "deviceLocation": "ON_PREMISE"
    },
    "presentationData": {
      "isCardPresent": true,
      "howPresented": "CUSTOMER_PRESENT"
    },
    "terminalEntryCapability": "MAG_STRIPE_READ",
    "terminalType": "POS_TERMINAL"
  },
  "messageType": "0100",
  "processingCode": "000000",
  "decisionType": "RECOMMENDED",
  "primaryAccountNumber": "418543265390XXXX",
  "retrievalReferenceNumber": "000000000002",
  "dateTimeLocal": "0322080000",
  "merchantInfo": {
    "city": "Highlands Ranch",
    "countryCode": "USA",
    "postalCode": "80130",
    "merchantCategoryCode": "5310",
    "name": "POS at ",
    "addressLines": ["6675 Business Center Dr"],
    "region": "CO",
    "currencyCode": "840"
  }
}
Response
{
  "receivedTimestamp": "2019-04-05 16:50:57.45",
  "resource": {
    "decisionResponse": {
      "decisionResponseTimeStamp": "2019-04-05 16:50:57",
      "declineRuleCategory": "PCT_GLOBAL",
      "shouldDecline": true
    },
    "decisionID": "ctc-vd-0120c917-3342-4523-bc69-85d2ef904d29"
  },
  "processingTimeinMs": 59
}
• Send a auth completion request – Use the decision id from the Auth Decision Response in the URL below
Endpoint: https://sandbox.api.visa.com/vctc/validation/v1/decisions/ctc-vd-0120c917-3342-4523-bc69-85d2ef904d2...
Method : PUT

 

Request
{
  "transactionApproved": "DECLINED",
  "decisionType": "COMPLETE",
  "isDeclineResultOfTransactionControl": true
}

 

Response
{
  "receivedTimestamp": "2019-04-05 16:51:49.922",
  "resource": {
    "transactionApproved": "DECLINED",
    "lastUpdateTimeStamp": "2019-04-05 16:51:49",
    "decisionType": "COMPLETE",
    "isDeclineResultOfTransactionControl": true
  },
  "processingTimeinMs": 116
}
 
• You will receive an email

 

 




Thanks,

Tee



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