Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose isDeviceToken on BTApplePayCardNonce [Duplicate] #1520

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## unreleased
* BraintreeApplePay
* Add `isDeviceToken` to POST `v1/payment_methods/apple_payment_tokens`
* Add `BTApplePayCardNonce.isDeviceToken` for MPAN identification

## 6.28.0 (2025-02-05)
* BraintreeVenmo
Expand Down
5 changes: 2 additions & 3 deletions Sources/BraintreeApplePay/BTApplePayCardNonce.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import BraintreeCore
/// The BIN data for the card number associated with this nonce.
public let binData: BTBinData

/// This Boolean indicates whether this tokenized card is a device-specific account number (DPAN) or merchant/cloud token (MPAN).
/// This Boolean indicates whether this tokenized card is a device-specific account number (DPAN) or merchant/cloud token (MPAN). Available on iOS 16+.
/// If `isDeviceToken` is `false`, then token type is MPAN
public var isDeviceToken: Bool

Expand All @@ -19,9 +19,8 @@ import BraintreeCore

let cardType = json["details"]["cardType"].asString() ?? "ApplePayCard"
let isDefault = json["default"].isTrue
let isDeviceToken = json["details"]["isDeviceToken"].asBool() ?? true

self.isDeviceToken = isDeviceToken
self.isDeviceToken = json["details"]["isDeviceToken"].asBool() ?? true

binData = BTBinData(json: json["binData"])
super.init(nonce: nonce, type: cardType, isDefault: isDefault)
Expand Down