Create an instance of StoreCardViewController with a verification amount and a delegate to handle various outcomes of the operation:

let controller = MPStoreCardViewController(verificationAmount: 1.00, 
                                         delegate: self)

present(controller, animated: true, completion: nil)
MPStoreCardViewController *controller = [[MPStoreCardViewController alloc] initWithVerificationAmount:1.00
                                                                                         delegate:self];

[self presentViewController:controller animated:YES completion:nil];

 

If you would like to automatically issue a refund for the verification amount you have used while tokenizing the card, you can do that by initializing the StoreCard controller like so:

let controller = MPStoreCardViewController(verificationAmount: 0.00, autoReverse: true, delegate: self);
MPStoreCardViewController *controller = [[MPStoreCardViewController alloc] initWithVerificationAmount:1.00, autoReverse: true,
                                                                                         delegate:self];

 

The delegate must implement StoreCardDelegate’s methods.

func storeCardDidComplete(withData storedCard: StoredCard)
func storeCardDidFailWithError(_ error: MobilePaymentSDKError)
- (void)storeCardDidCompleteWithData:(StoredCard *)storedCard
- (void)storeCardDidFailWithError:(MobilePaymentSDKError *)error;

 

Update a Stored Card


Create an instance of UpdateStoredCardViewController with a verification amount and a delegate to handle various outcomes of the operation:

let controller = MPUpdateStoredCardViewController(cardToken: selectedCard.token
                                                verificationAmount: 1.00, 
                                                delegate: self)

present(controller, animated: true, completion: nil)
MPUpdateStoredCardViewController *controller = [[MPUpdateStoredCardViewController alloc] initWithCardToken:_card.token
                                                                                    verificationAmount:1.00
                                                                                              delegate:self];
[self presentViewController:controller animated:YES completion:nil];

 

The delegate must implement StoreCardDelegate’s methods.

 

func updateStoredCardDidComplete(withData storedCard: StoredCard, forCardWithToken cardToken: String)
func updateStoredCardDidFailWithError(_ error: MobilePaymentSDKError)
- (void)updateStoredCardDidCompleteWithData:(StoredCard *)storedCard forCardWithToken:(NSString *)cardToken
- (void)updateStoredCardDidFailWithError:(MobilePaymentSDKError *)error