Re: Start Build With Visa Community> "hello world" on web

moreworld
Regular Visitor

Start Build With Visa Community> "hello world" on web

 Start Build With Visa Community> "hello world" on live server
Hi everybody , It's my first post , at the community , Really after a month of test data at command line and try to use or include the sample project files to my public html to start build , that files from github wich is useful to know how to build and to test api results out of command line , but to store it and start buildding my app its a big mistake use it , and that was my mistake .
After waiting for more than a month for my callback link approved, what i was think the only way to do that , after i try many languages php, java, node.js , and all keep it at command line
if u have the same issues , Please Stop and Go back to start guide > scroll after SoupUi test Example , theres simple code for your language , take it and start to build on it , make your string > user id , password, url , keys links , choose your api explore link on sand box give it the true data store responde results and start to fetch it from that file json or xml . as you send the data
i make a sample code for thath at php i hope it will help you
please if any one from admain see that post , please told me if i have any mistake 


<?php
//More World Software
// User Data Change your values for test ,After test Store it in save place to use in your project
//*************************************************************//
$userId = 'user Id ';
$password='password';
$certificatePath='Your path ../security/cert.pem';
$privateKey='Your path ../security/key.pem';
//*************************************************************//
$SandBox = 'https://sandbox.api.visa.com';// Sand Box Basic Url
//*************************************************************//
$url = $SandBox.'/visadirect/fundstransfer/v1/pullfundstransactions';// Sand Box Basic Url
//*************************************************************//
// Make Request Header
$authString = $userId.":".$password;
$authStringBytes = utf8_encode($authString);
$authloginString = base64_encode($authStringBytes);
$authHeader= "Authorization:Basic ".$authloginString;
$header = (array("Accept: application/json", "Content-Type: application/json", $authHeader));
//*************************************************************//
// Handel Your data Store path to Save and fetch
$handlex = fopen("../VCjson/json_$strDate.json", "w");
//*************************************************************//
// Sending Data
// auto date for Data body
$strDate = date('Y-m-d\TH:i:s', time());

// Data Body
$data = json_encode ( [
'systemsTraceAuditNumber' => 300259,
'retrievalReferenceNumber' => '407509300259',
'localTransactionDateTime' => $strDate,
'acquiringBin' => 409999,
'acquirerCountryCode' => '101',
'senderPrimaryAccountNumber' => '4957030100009952',
'senderCardExpiryDate' => '2020-03',
'senderCurrencyCode' => 'USD',
'amount' => '110',
'surcharge' => '2.00',
'cavv' => '0000010926000071934977253000000000000000',
'foreignExchangeFeeTransaction' => '10.00',
'businessApplicationId' => 'AA',
'merchantCategoryCode' => 6012,
'cardAcceptor' => [
'name' => 'Saranya',
'terminalId' => '365539',
'idCode' => 'VMT200911026070',
'address' => [
'state' => 'CA',
'county' => '081',
'country' => 'USA',
'zipCode' => '94404'
]
],
'magneticStripeData' => [
'track1Data' => '1010101010101010101010101010'
],
'pointOfServiceData' => [
'panEntryMode' => '90',
'posConditionCode' => '0',
'motoECIIndicator' => '0'
],
'pointOfServiceCapability' => [
'posTerminalType' => '4',
'posTerminalEntryCapability' => '2'
],
'feeProgramIndicator' => '123'
] );

// start call With curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_SSLCERT, $certificatePath);
curl_setopt($ch, CURLOPT_SSLKEY, $privateKey);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_URL, $url);
// Store Response Data
curl_setopt($ch, CURLOPT_FILE, $handlex);
// End Curl
$res = curl_exec($ch);
curl_close($ch);
// Fetch data
$jsonStr = file_get_contents("../VCjson/json_$strDate.json");
$json = json_decode($jsonStr,true);
$OutData = $json['transactionIdentifier'];
echo "<h1>Hello Visa World </h1><hr /><h2> transactionIdentifier ::::: ".$OutData."</h2>";

?>

1 REPLY 1
ricardo_visa
Community Scholar

Re: Start Build With Visa Community> "hello world" on web

Hi there, 

 

Sorry to hear that! 

 

We are looking into this. Let us know if you have any additional questions in the meantime. 

 

Thank 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.