developer.visa.com/pages/working-with-visa-apis/x-pay-token
https://developer.visa.com/pages/working-with-visa-apis/x-pay-token
import java.math.BigInteger; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.SignatureException; public static String generateXpaytoken(String resourcePath, String queryString,
developer.visa.com
The World's Most Popular API Testing Tool | SoapUI
Accelerating API Quality Through Testing Whether open source or commercial, SmartBear testing tools make it easy to create, manage, and execute end-to-end tests on REST, SOAP, & GraphQL APIs, JMS, JDBC, and other web services so you can deliver software fa
www.soapui.org
To Be Continue..
Below is visa developer center web page.
I checked the CyberSource Payments checkbox.
Back to SoaUI.
copy test url :
Method : GET
https://sandbox.api.visa.com/vdp/helloworld?apikey=<your api key>
Paste this script below.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
def hmac(String secretKey, String data) {
Mac mac = Mac.getInstance("HmacSHA256")
SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(), "HmacSHA256")
mac.init(secretKeySpec)
byte[] digest = mac.doFinal(data.getBytes())
return digest
}
def APIKey = "VALUE_OF_YOUR_API_KEY"
def sharedSecret = "VALUE_OF_YOUR_SHARED_SECRET"
def URI = "helloworld"
def QS = "apikey="+APIKey
def timeStampUTC = String.valueOf(System.currentTimeMillis().intdiv(1000L))
def payload = ""
def HMACDigest = hmac(sharedSecret, timeStampUTC + URI + QS + payload)
def encodedDigest = HMACDigest.encodeHex().toString()
def XPayToken = "xv2:"+ timeStampUTC + ":" + encodedDigest
testRunner.testCase.setPropertyValue("xpayToken", XPayToken)
log.info(XPayToken)
|
cs |
'[Other API]' 카테고리의 다른 글
[Authorize.net] sandbox sign up (0) | 2021.08.24 |
---|---|
[Visa] Cybersource Developer Center – REST API Reference (0) | 2021.02.03 |
Visa Cyber Source API (0) | 2021.02.02 |
visa cyber source - memo (0) | 2021.02.01 |
Tutorial: How to Connect to Visa APIs using Two-way SSL and Postman. (0) | 2021.01.29 |