BTAmericanExpressClient
Objective-C
@interface BTAmericanExpressClient : NSObject
Swift
class BTAmericanExpressClient : NSObject
BTAmericanExpressClient
enables you to look up the rewards balance of American Express cards.
-
Creates an American Express client.
Declaration
Objective-C
- (nonnull instancetype)initWithAPIClient:(nonnull BTAPIClient *)apiClient;
Swift
init(apiClient: BTAPIClient)
Parameters
apiClient
An API client
-
Unavailable
Please use initWithAPIClient:
Base initializer - do not use.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Gets the rewards balance associated with a Braintree nonce. Only for American Express cards.
Note
If the nonce is associated with an ineligible card or a card with insufficient points, the rewardsBalance will contain this information aserrorMessage
anderrorCode
.Declaration
Objective-C
- (void)getRewardsBalanceForNonce:(nonnull NSString *)nonce currencyIsoCode:(nonnull NSString *)currencyIsoCode completion: (nonnull void (^)( BTAmericanExpressRewardsBalance *_Nullable, NSError *_Nullable))completionBlock;
Swift
func rewardsBalance(forNonce nonce: String, currencyIsoCode: String) async throws -> BTAmericanExpressRewardsBalance
Parameters
nonce
A nonce representing a card that will be used to look up the rewards balance.
currencyIsoCode
The currencyIsoCode to use. Example: ‘USD’
completionBlock
A completion block that is invoked when the request has completed. If the request succeeds,
rewardsBalance
will contain information about the rewards balance anderror
will benil
(see exceptions in note); if it fails,rewardsBalance
will benil
anderror
will describe the failure.