Get Payment Information #437
sarathpm-l7
started this conversation in
Team Posts
Replies: 3 comments
-
Hi, |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi Guys,
We can decrypt card number, In order to decrypt credit card number.
You should contact to CyberSource team for public and private keys for secure communication.
However, you can use below code as pseudo (Controller version).
===========================================================
var profile : dw.customer.Profile = args.profile;
var instruments : Collection = profile.getWallet().getPaymentInstruments(dw.order.PaymentInstrument.METHOD_CREDIT_CARD);
var certRef : dw.crypto.CertificateRef = new dw.crypto.CertificateRef("server");
var keyRef : dw.crypto.CertificateRef = new dw.crypto.KeyRef("private");
var custPay : PaymentInstrument = null;
var cipher : Cipher = null;
var encryCC = '';
var decCC = '';
var cipher = new Cipher();
if(instruments.size() > 0){
for each (var e : PaymentInstrument in instruments){
if (e.creditCardNumber != null){
encryCC = e.getEncryptedCreditCardNumber(dw.order.PaymentInstrument.ENCRYPTION_ALGORITHM_RSA, certRef);
decCC = cipher.decrypt(encryCC,keyRef,dw.order.PaymentInstrument.ENCRYPTION_ALGORITHM_RSA,null,0); }
}
}
===========================================================
Hope, it’s helpful.
Let me know if you have any concern.
Thanks
Sanjay
From: svarshney123 [mailto:[email protected]]
Sent: Wednesday, July 17, 2019 2:45 PM
To: SalesforceCommerceCloud/community
Cc: Subscribed
Subject: Re: [SalesforceCommerceCloud/community] Get Payment Information (#88)
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
We can't get full card number and demandware is allowing to store last 4
digit of the card Number in profile.
On Wed, Jul 17, 2019 at 2:32 PM rajat-p-talwar ***@***.***> wrote:
Hi,
Check out this documentation
<https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDWAPI%2Fscriptapi%2Fhtml%2Fapi%2Fclass_dw_customer_CustomerPaymentInstrument.html&resultof=%22%64%77%2e%63%75%73%74%6f%6d%65%72%2e%43%75%73%74%6f%6d%65%72%50%61%79%6d%65%6e%74%49%6e%73%74%72%75%6d%65%6e%74%22%20>
link.
You can use the getCreditCardNumber method to get the decrypted card
number. If the mentioned conditions are met, you can retrieve the actual
number otherwise it returns the masked number.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/orgs/SalesforceCommerceCloud/teams/community/discussions/88/comments/1?email_source=notifications&email_token=AK32TFQOLSZ3VC6XDZFHBHTP73G3VA5CNFSM4IENOPMKYY3PNVWWK3TUL52HS4DFWNCGS43DOVZXG2LPNZIG643UKJSXA3DZVJRW63LNMVXHIX3JMTHAAAQLMQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK32TFXQ3DOPYPNYKIYYL3LP73G3VANCNFSM4IENOPMA>
.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://github.com/orgs/SalesforceCommerceCloud/teams/community/discussions/88/comments/2?email_source=notifications&email_token=AK5T6MFHJDSHHF5PMIISQDTP73PKBA5CNFSM4IENOPMKYY3PNVWWK3TUL52HS4DFWNCGS43DOVZXG2LPNZIG643UKJSXA3DZVJRW63LNMVXHIX3JMTHAAAQLNY>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AK5T6MD7P5TMRLVSR25UWFDP73PKBANCNFSM4IENOPMA>.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
Is there a way to fetch payment information of a customer added in his account. In the customer object, I'm getting the payment information as 'xxxxxxxx1111'. How can I get the full credit card details? The requirement is to get the payment information from other customers so that they can send money to each other.
Thanks and Regards.
Beta Was this translation helpful? Give feedback.
All reactions