we want to get the last four digits of the real card number in apple Pay, and I found information about it in the document, link: https://developer.apple.com/documentation/passkit_apple_pay_and_wallet/pksecureelementpass/3543366-primaryaccountnumbersuffix?language=objc My question is how to use it,can you provide sample code? We are very anxious, thank you!
How do I get the last four digits of the real card number in apple Pay by "PKSecureElementPass.primaryAccountNumberSuffix"?
if (@available(iOS 13.4, *)) { NSArray<PKSecureElementPass *> *secureArray = [passLib remoteSecureElementPasses];
NSLog(@"Number of passes in library are: %lu", (unsigned long)[secureArray count]);
if ([secureArray count] > 0) {
PKSecureElementPass *onePass = [secureArray objectAtIndex:0];
NSLog(@"One pass: %@", onePass);
PKPaymentPass *paymentPass = [onePass paymentPass];
if (paymentPass) {
NSLog(@"Pass activation code: %lu", (unsigned long)[paymentPass activationState]);
NSLog(@"AuthenticationToken: %@, DeviceAccountIdentifier: %@, PrimaryAccountNumberSuffix: %@",
[paymentPass authenticationToken],
[paymentPass deviceAccountIdentifier],
[paymentPass primaryAccountNumberSuffix]);
}
}
} else { // Fallback on earlier versions } I try to use "remoteSecureElementPasses", but either distribute certificate or development certificate, the array's count is always 0.