Checking for an existing FlexPublicKey or existing payment profile

rbrandenburg
Helper

Checking for an existing FlexPublicKey or existing payment profile

Sorry if this has already been covered in another thread, but I wasn't able to find an answer when I looked. I'm currently working in a sandbox environment and it looks like I can successfully generate FlexPublicKeys and payment profiles. I want to make sure I also set up a workflow for checking for existing keys/profiles before trying to generate them, as well as updating existing payment profiles.

 

I noticed that FlexPublicKey in the CyberSource Flex SDK has a method called "retrieveKey()" which sounds like what I should be using. Specifically, I'm thinking of calling this method when I need a FlexPublicKey for a request, and calling generateKey() if the result is null. Is this an intended/workable use case? What is the String argument that retrieveKey() takes?

 

For payment profiles, I've been working based off example code from this repo and making the request to generate a payment profile using VisaClient.doXPayTokenRequest(). From what I can tell, the identifier that specifies that the request is meant to generate a profile is "tokens" in the resource path, and the endpoint generates a payment profile based on values in the request body and includes the profile id in the response body. Is there a type of request that simply checks whether a profile exists and another that updates an existing profile? Or should I just use the same workflow for both of these cases as for generating a new profile, and build the application in such a way that it doesn't care whether a payment profile exists and always attempts to "generate" one?

 

3 REPLIES 3
API_Products
Visa Developer Support Specialist

Re: Checking for an existing FlexPublicKey or existing payment profile

Hi @rbrandenburg,

 

Good question! If you are a developer testing on v1 CyberSource APIs then this version was recently deprecated. You will need to move to v2 CyberSource APIs going forward. 

 

Here is the link to v2 CyberSource. https://developer.visa.com/capabilities/cybersource/reference#cybersource__cybs_payments_v2

 

 




Thanks,

Diana



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

rbrandenburg
Helper

Re: Checking for an existing FlexPublicKey or existing payment profile

Thank you. Does this apply to the secure acceptance flexible token API as well as the Cybersource Payments REST API? On that page, the documentation for the flex token API still shows V1, and when testing again I found that I could no longer tokenize cards whether I was using V1 or V2 or the URI. Should the V1 endpoint still be working for tokenizing? Is there updated documentation for sending a request to the V2 API from a Java application using the Cybersource flex SDK?

API_Products
Visa Developer Support Specialist

Re: Checking for an existing FlexPublicKey or existing payment profile

Hi @rbrandenburg,                             

 

We have an expert team that manages questions specific to CyberSource. Please reach out to the CyberSource team directly.

 

CyberSource Support
800-709-7779

 

CyberSource Sales
888-330-2300

 




Thanks,

Diana



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