Terminal-2 icon

Handle additional data

Delegate

The transactionProvidesAdditionalData delegate is called when a transaction provides additional data, for example loyalty-related data, providing the app with an opportunity to modify the amount charged based on that data.

After this method has been called, transaction-processing will be paused until continueWithUpdatedAmount is called on the given additionalDataRequest, either with an NSNumber to update the amount, or with nil to continue with the original amount.

Instead of calling continueWithUpdatedAmount, it it also possible to cancel the transaction at this point as usual, by calling [ADYTransactionRequest requestCancel]. After the transaction has been cancelled, subsequent calls to continueWithUpdatedAmount will have no effect.

Parameters

Name Type Required Description
additionalDataRequest ADYAdditionalDataRequest -white_check_mark- Request-object used to inform the ADYTransactionProcessorDelegate that additional data is available.

Declaration code example

Objective-C

- (void)transactionProvidesAdditionalData:
    (ADYAdditionalDataRequest *)additionalDataRequest;

Swift

func transactionProvidesAdditionalData(_ additionalDataRequest: ADYAdditionalDataRequest!)