Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

CybersourceAPIdocumentation

Feature:Saving/Retrievingthecustomercardforfuturetransactions.
ThisdocumentwillexplaintherequiredRequestparametersandtheendpointurlformakingaSOAPcallto
CybersourceAPItocreateandsavethecustomerprofileandcarddetails(withoutchargingafee)thatcanbe
retrievedlaterforfuturetransactions.
>>CybersourceTestBusinessCentersteps:
Url:https://ebctest.cybersource.com/ebctest/login/
WeneedtocreateaCybersourcemerchantaccounttotestoutourtransactionsandretrievea MerchantIDand
TransactionKey.AftercreatinganaccountandobtainingtheMerchantID(assignedautomaticallytoanewly
createdaccount),thestepstocreatetheTransactionKeyareasfollows:
1. ClickonTransactionSecurityKeysoptionunderAccountManagementtab.

2. SelectSecurityKeysfortheSOAPToolkitAPIoptionasweareusingSOAPtoolkitAPI.

3. ClickonGenerateKey

>>CreatingtheSTUBfromcybersourcewsdlfile.
WehavetocreatethestubfromtheCybersourcewsdlfilewhichwedownloadedfromthebelowurl.Thewsdlfile
isCyberSourceTransaction_1.121.wsdl.
Thewsdlcanbedownloadedfromtheurl:
https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.123.wsdl
#Note:TheJAVAclasses(stub)formwsdlcanbegeneratedbyfollowingthisstep
RightClickonanyProject>CreateNewOther>WebServices>WebServiceClient>Thenpastethewsdlurl(or
location)inServiceDefinition>Next>Finish
#Note: Incybs.propertiesfile,wehavetomentiontheMerchantID,DirectoryofthekeyandFilenameofthe
transactionkeyinmerchantID,keysDirectoryandkeyFilenamepropertiesrespectively.
#Note: WehavetofirstraiseaticketinCybersourceBusinessCentersupportsectiontoenabletheRecurring
Billing Subscriptionservice on themerchant IDyouare usingfrom their support center tosave/ retrieve the
customerprofiledetails.OtherwiseitwillthrowanErrorcode150.
>>Savingthecustomercard/profileonCybersource
1.EndPointCybersourceAPIURL:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor
2.Creatingacustomerprofilefirstrequirestoauthorizethecardusedforthetransaction.Tovalidate/authorizethe
customeraccount,followingRequestMessagefieldsneedstobesettothecorrespondingvalues:
RequestMessageParameters

SampleValues

paySubscriptionCreateService_run

true(String)

ccAuthService_run

true(String)

purchaseTotals_grandTotalAmount

0.00(String)

3.Aftersettingthefieldsforauthorizingthecustomer'scard,thefollowingRequestMessagefieldsneedstobeset
tothecorrespondingvalues:
RequestMessageParameters

SampleValues

billTo_firstName

John
(String)

billTo_lastName

Doe(String)

billTo_city

MountainView(String)

billTo_country

US(String)

billTo_email

null@cybersource.com(String)

billTo_postalCode

94043(String)

billTo_state

CA(String)

billTo_street1

1295CharlestonRoad(String)

card_accountNumber

4111111111111111(String)

card_cardType

001(String)

card_expirationMonth

12(BigInteger)

card_expirationYear

2018(BigInteger)

merchantID

demoID(String)

merchantReferenceCode

1234(String)

purchaseTotals_currency

USD(String)

recurringSubscriptionInfo_frequency

ondemand(String)

4.Aftersettingalltherequiredparameters,theAPIendpointURLneedstobeinvokedtogettheReplyMessage
fromthetransaction.TheReasonCodeneedstobeofvalue100toindicateasuccessfultransaction.
SampleReplyforasuccessfultransaction:
decision=ACCEPT
merchantReferenceCode=1234
paySubscriptionCreateReply_reasonCode=100
paySubscriptionCreateReply_subscriptionID=0000562489861111
purchaseTotals_currency=USD
reasonCode=100
requestID=3790672461500176056470
NOTE:The subscriptionID retrievedintheaboveresponsewillbeusedforretrievingthecustomerprofilefor
futuretransactionswheneverthecustomerwantstousethesamecardforthem.

5.XMLformatoftherequestmessagefortheabovetransactioncall:
<requestMessagexmlns="urn:schemascybersourcecom:transactiondata1.92">
<billTo>
<firstName>John</firstName>
<lastName>Doe</lastName>
<street1>1295CharlestonRoad</street1>
<city>MountainView</city>
<state>CA</state>
<postalCode>94043</postalCode>
<country>US</country>
<email>john.doe@example.com</email>
</billTo>
<purchaseTotals>
<currency>USD</currency>
</purchaseTotals>
<card>
<accountNumber>4111111111111111</accountNumber>
<expirationMonth>12</expirationMonth>
<expirationYear>2015</expirationYear>
<cardType>001</cardType>
</card>
<merchantID>demoID</merchantID>
<merchantReferenceCode>1234</merchantReferenceCode>
<recurringSubscriptionInfo>
<frequency>ondemand</frequency>
</recurringSubscriptionInfo>
<paySubscriptionCreateServicerun="true"/>
</requestMessage>
>>Retrievingthecustomercard/profilefromCybersource
1.EndPointCybersourceAPIURL:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor
2.ForretrievingthecustomerprofilefromCybersourceend,followingRequestMessagefieldsneedstobesetto
thecorrespondingvalues:
RequestMessageParameters

SampleValues

paySubscriptionRetrieveService_run

true(String)

merchantID

demoID(String)

merchantReferenceCode

1234(String)

recurringSubscriptionInfo_subscriptionID

subscriptionID(String)Retrievedfromthe
save card transaction response explained
above.

3.Aftersettingalltherequiredparameters,theAPIendpointURLneedstobeinvokedtogettheReplyMessage
fromthetransaction.ThisReplyMessagewillcontainthecustomerprofiledetailswhichcanberetrievedtomakea

futurepurchase.TheReasonCodeneedstobeofvalue100toindicateasuccessfultransaction.
SampleReplyforasuccessfultransaction:
merchantReferenceCode=1234
requestID=3790689247280176056442
decision=ACCEPT
reasonCode=100
paySubscriptionRetrieveReply_reasonCode=100
paySubscriptionRetrieveReply_cardAccountNumber=411111XXXXXX1111
paySubscriptionRetrieveReply_cardExpirationMonth=12
paySubscriptionRetrieveReply_cardExpirationYear=2018
paySubscriptionRetrieveReply_cardType=001
paySubscriptionRetrieveReply_city=MountainView
paySubscriptionRetrieveReply_country=US
paySubscriptionRetrieveReply_currency=USD
paySubscriptionRetrieveReply_email=null@cybersource.com
paySubscriptionRetrieveReply_firstName=JOHN
paySubscriptionRetrieveReply_frequency=ondemand
paySubscriptionRetrieveReply_lastName=DOE
paySubscriptionRetrieveReply_paymentMethod=creditcard
paySubscriptionRetrieveReply_postalCode=94043
paySubscriptionRetrieveReply_state=CA
paySubscriptionRetrieveReply_status=CURRENT
paySubscriptionRetrieveReply_street1=1295CharlestonRoad
paySubscriptionRetrieveReply_subscriptionID=0000562489861111
paySubscriptionRetrieveReply_ownerMerchantID=demoID
Theabovedetailscanbeusedtodisplayasavedcustomercardintheprofilesectionifuserwantstousethis
existingcardforfuturebillingandpurchase.
>>SearchingatransactioninCybersourceBusinessCenter
A transaction details can be searched in Cybersource Business center using the requestID returned from the
transactioncallasfollows:
1.ClickonGeneralSearchoptionunderTransactionSearchtab.Thefollowingscreenappearswhereyoucan
entertherequestIDtosearchthetransaction.

2.
The
followingtransactionresultscreenwillappearwherealltherelateddetailsarelisted.

You might also like