PPRetailTransactionContext Class Reference

Inherits from PPRetailObject : NSObject
Declared in PPRetailTransactionContext.h

Overview

The TransactionContext class is returned by RetailSDK.getTransactionManager().createTransaction and allows you to control many aspects of the payment or refund flow and observe events that occur during the flows. Simply creating a TransactionContext will not kick off any behaviors, so that you have a chance to configure the transaction context as you wish (enable on-reader tipping , specify transaction options, etc). When you’re ready to proceed with the payment flow, call beginPayment()

  invoice

The invoice being processed for this transaction @readonly

@property (nonatomic, strong, nullable, readonly) PPRetailRetailInvoice *invoice

Discussion

The invoice being processed for this transaction @readonly

Declared In

PPRetailTransactionContext.h

  type

The type of transaction being attempted (defaults to Sale if the invoice is not already paid, Refund if it is already paid)

@property (nonatomic, assign) PPRetailTransactionType type

Discussion

The type of transaction being attempted (defaults to Sale if the invoice is not already paid, Refund if it is already paid)

Declared In

PPRetailTransactionContext.h

  isSignatureRequired

Given the current state of the invoice and transaction, is a signature required to secure payment? @readonly

@property (nonatomic, assign, readonly) BOOL isSignatureRequired

Discussion

Given the current state of the invoice and transaction, is a signature required to secure payment? @readonly

Declared In

PPRetailTransactionContext.h

  digitalCard

Digital Card information

@property (nonatomic, strong, nullable) PPRetailDigitalCard *digitalCard

Discussion

Digital Card information

Declared In

PPRetailTransactionContext.h

  orderId

id of the PP order for payment

@property (nonatomic, strong, nullable) NSString *orderId

Discussion

id of the PP order for payment

Declared In

PPRetailTransactionContext.h

  totalDisplayFooter

While building your invoice, the running total will be displayed on PaymentDevices capable of displaying messages. If you set totalDisplayFooter, that will be displayed (centered) after the total amount. Note that once the payment flow starts, EMV certification requires that the display just show the total and iconography corresponding to expected payment types. Your message will not be on that screen.

@property (nonatomic, strong, nullable) NSString *totalDisplayFooter

Discussion

While building your invoice, the running total will be displayed on PaymentDevices capable of displaying messages. If you set totalDisplayFooter, that will be displayed (centered) after the total amount. Note that once the payment flow starts, EMV certification requires that the display just show the total and iconography corresponding to expected payment types. Your message will not be on that screen.

Declared In

PPRetailTransactionContext.h

– getPaymentState

Returns the current state of payment

- (PPRetailPaymentState)getPaymentState

Discussion

Returns the current state of payment

Declared In

PPRetailTransactionContext.h

– getTippingState

Returns the current state of tipping

- (PPRetailTippingState)getTippingState

Discussion

Returns the current state of tipping

Declared In

PPRetailTransactionContext.h

– clearOnReaderTip

Clear the on-reader tip that was acquired for this transaction

- (void)clearOnReaderTip

Discussion

Clear the on-reader tip that was acquired for this transaction

Declared In

PPRetailTransactionContext.h

– beginPayment:

Begin the payment flow (activate payment devices, listen for relevant events from devices)

- (PPRetailTransactionContext *_Nullable)beginPayment:(PPRetailTransactionBeginOptions *_Nullable)paymentOptions

Discussion

Begin the payment flow (activate payment devices, listen for relevant events from devices)

Declared In

PPRetailTransactionContext.h

– beginRefund:amount:

Begin the flow to issue a refund on the current invoice.

- (PPRetailTransactionContext *_Nullable)beginRefund:(BOOL)promptForCardOptions amount:(NSDecimalNumber *_Nullable)amount

Discussion

Begin the flow to issue a refund on the current invoice.

Declared In

PPRetailTransactionContext.h

– beginRefund:amount:refundTag:

Begin the flow to issue a refund on the current invoice.

- (PPRetailTransactionContext *_Nullable)beginRefund:(BOOL)promptForCardOptions amount:(NSDecimalNumber *_Nullable)amount refundTag:(NSString *_Nullable)refundTag

Discussion

Begin the flow to issue a refund on the current invoice.

Declared In

PPRetailTransactionContext.h

– isRefund

Is the transaction a type of refund?

- (BOOL)isRefund

Discussion

Is the transaction a type of refund?

Declared In

PPRetailTransactionContext.h

– deactivateFormFactors:callback:

Deactivate form factors without ending the transaction. Once deactivated, you should re-begin the transaction to start taking payments

- (void)deactivateFormFactors:(NSArray *_Nullable)formFactors callback:(PPRetailTransactionContextCompleteHandler _Nullable)callback

Discussion

Deactivate form factors without ending the transaction. Once deactivated, you should re-begin the transaction to start taking payments

Declared In

PPRetailTransactionContext.h

– clear:

Abort an idle transaction abandoning activated readers and all event listeners. The completed event will NOT be fired for this TransactionContext given that you have explicitly abandoned it

- (void)clear:(PPRetailTransactionContextCompleteHandler _Nullable)callback

Discussion

Abort an idle transaction abandoning activated readers and all event listeners. The completed event will NOT be fired for this TransactionContext given that you have explicitly abandoned it

Declared In

PPRetailTransactionContext.h

– isPaymentInRetryOrProgress

Check to see if payment is in ‘retry’ state. This check helps with disconnection/connection logic when the app goes in the background.

- (BOOL)isPaymentInRetryOrProgress

Discussion

Check to see if payment is in ‘retry’ state. This check helps with disconnection/connection logic when the app goes in the background.

Declared In

PPRetailTransactionContext.h

– requestPaymentCancellation:

Request to cancel a payment. The request will only be accepted if payment is not already in progress.

- (void)requestPaymentCancellation:(PPRetailTransactionContextCancellationHandlerHandler _Nullable)handler

Discussion

Request to cancel a payment. The request will only be accepted if payment is not already in progress.

Declared In

PPRetailTransactionContext.h

– requestDigitalCardCancellation:

Request to cancel an ongoing payment. The request will only be accepted if there is a partial digital card payment and payment is not in progress.

- (void)requestDigitalCardCancellation:(PPRetailTransactionContextVoidCompletedHandler _Nullable)voidCompletedHandler

Discussion

Request to cancel an ongoing payment. The request will only be accepted if there is a partial digital card payment and payment is not in progress.

Declared In

PPRetailTransactionContext.h

– dropHandlers

Remove all handlers

- (void)dropHandlers

Discussion

Remove all handlers

Declared In

PPRetailTransactionContext.h

– discardPresentedCard:

Discard the presented card for non-EMV transactions only

- (void)discardPresentedCard:(PPRetailCard *_Nullable)card

Discussion

Discard the presented card for non-EMV transactions only

Declared In

PPRetailTransactionContext.h

– continueWithCard:tag:

Begin the flow to issue a refund on the current invoice.

- (void)continueWithCard:(PPRetailCard *_Nullable)card tag:(NSString *_Nullable)tag

Discussion

Begin the flow to issue a refund on the current invoice.

Declared In

PPRetailTransactionContext.h

– continueWithDigitalCard:

Continue processing transaction with Digital Card/Code information

- (void)continueWithDigitalCard:(PPRetailDigitalCard *_Nullable)digitalCard

Discussion

Continue processing transaction with Digital Card/Code information

Declared In

PPRetailTransactionContext.h

– continueWithCard:

Continue processing a transaction - the behavior of which depends on the presented card. If it’s a magnetic card or an NFC tap, payment will be attempted and money will move (if successful). If it’s an EMV card insertion, we will start the EMV flow which includes a few calls to the server, potentially asking the user to enter a PIN, etc.

- (void)continueWithCard:(PPRetailCard *_Nullable)card

Discussion

Continue processing a transaction - the behavior of which depends on the presented card. If it’s a magnetic card or an NFC tap, payment will be attempted and money will move (if successful). If it’s an EMV card insertion, we will start the EMV flow which includes a few calls to the server, potentially asking the user to enter a PIN, etc.

Declared In

PPRetailTransactionContext.h

– startInvoiceSync

Sync the Invoice total to the reader display. Use this function to sync invoice amount on the app to the reader. This automatic invoice syncing will stop based on the transaction state. Use ‘syncInvoiceOnce’ to do an on-demand push invoice total to the card reader display

- (void)startInvoiceSync

Discussion

Sync the Invoice total to the reader display. Use this function to sync invoice amount on the app to the reader. This automatic invoice syncing will stop based on the transaction state. Use ‘syncInvoiceOnce’ to do an on-demand push invoice total to the card reader display

Declared In

PPRetailTransactionContext.h

– syncInvoiceOnce

Do a one time sync of invoice total to card reader

- (void)syncInvoiceOnce

Discussion

Do a one time sync of invoice total to card reader

Declared In

PPRetailTransactionContext.h

– continueWithCash

Continue processing a cash transaction.

- (void)continueWithCash

Discussion

Continue processing a cash transaction.

Declared In

PPRetailTransactionContext.h

– continueWithQRC

Continue processing a QRC transaction.

- (void)continueWithQRC

Discussion

Continue processing a QRC transaction.

Declared In

PPRetailTransactionContext.h

– continueWithCheck

Continue processing a check transaction.

- (void)continueWithCheck

Discussion

Continue processing a check transaction.

Declared In

PPRetailTransactionContext.h

– setSignatureCollector:

If you acquire signatures yourself, for example from a Topaz Pen Pad or with an external camera, set this property to a handler that will be invoked when signature should be collected. Once you’ve collected the signature, call the supplied signatureReceiver with a base64 encoded JPG of the signature. Try to keep it under 100k.

- (void)setSignatureCollector:(PPRetailTransactionContextSignatureCollectorHandler _Nullable)collector

Discussion

If you acquire signatures yourself, for example from a Topaz Pen Pad or with an external camera, set this property to a handler that will be invoked when signature should be collected. Once you’ve collected the signature, call the supplied signatureReceiver with a base64 encoded JPG of the signature. Try to keep it under 100k.

Declared In

PPRetailTransactionContext.h

– setTokenExpiredHandler:

Provide a token expiration handler if you want to handle token expirations during a transaction

- (void)setTokenExpiredHandler:(PPRetailTransactionContextTokenExpirationHandlerHandler _Nullable)expirationHandler

Discussion

Provide a token expiration handler if you want to handle token expirations during a transaction

Declared In

PPRetailTransactionContext.h

– setCardInsertedHandler:

Provide a handler to get notified after chip card insert is detected but before EMV data is read. cardInsertedHandler.continueWithCardDataRead must be invoked to continue with transaction

- (void)setCardInsertedHandler:(PPRetailTransactionContextCardInsertedHandlerHandler _Nullable)cardInsertedHandler

Discussion

Provide a handler to get notified after chip card insert is detected but before EMV data is read. cardInsertedHandler.continueWithCardDataRead must be invoked to continue with transaction

Declared In

PPRetailTransactionContext.h

– setCardPresentedHandler:

Provide a handler to get notified when card was presented and emv/magstripe data was read. TransactionContext.continueWithCard should be invoked to continue the payment

- (void)setCardPresentedHandler:(PPRetailTransactionContextCardPresentedHandler _Nullable)cardPresentedHandler

Discussion

Provide a handler to get notified when card was presented and emv/magstripe data was read. TransactionContext.continueWithCard should be invoked to continue the payment

Declared In

PPRetailTransactionContext.h

– setQRCStatusHandler:

Provide a handler to get notifications for QRC Payment

- (void)setQRCStatusHandler:(PPRetailTransactionContextOnQRCStatusHandler _Nullable)qrcStatusHandler

Discussion

Provide a handler to get notifications for QRC Payment

Declared In

PPRetailTransactionContext.h

– setCompletedHandler:

Provide a handler to get notified once transaction is complete

- (void)setCompletedHandler:(PPRetailTransactionContextTransactionCompletedHandler _Nullable)completedHandler

Discussion

Provide a handler to get notified once transaction is complete

Declared In

PPRetailTransactionContext.h

– setVaultCompletedHandler:

Provide a handler to get notified once vault is complete

- (void)setVaultCompletedHandler:(PPRetailTransactionContextVaultCompletedHandler _Nullable)completedHandler

Discussion

Provide a handler to get notified once vault is complete

Declared In

PPRetailTransactionContext.h

– setOfflineTransactionAdditionHandler:

Provide a handler to get offline transaction addition notification

- (void)setOfflineTransactionAdditionHandler:(PPRetailTransactionContextOfflineTransactionAddedHandler _Nullable)addedHandler

Discussion

Provide a handler to get offline transaction addition notification

Declared In

PPRetailTransactionContext.h

– setAdditionalReceiptOptions:receiptHandler:

If you would like to display additional receipt options such as print, etc., you can provide them here. These options would be presented on the receipt screen below the Email and Text options.

- (void)setAdditionalReceiptOptions:(NSArray *_Nullable)additionalReceiptOptions receiptHandler:(PPRetailTransactionContextReceiptOptionHandlerHandler _Nullable)receiptHandler

Discussion

If you would like to display additional receipt options such as print, etc., you can provide them here. These options would be presented on the receipt screen below the Email and Text options.

Declared In

PPRetailTransactionContext.h

– addContactlessReaderDeactivatedListener:

Add a listener for the contactlessReaderDeactivated event

- (PPRetailContactlessReaderDeactivatedSignal _Nullable)addContactlessReaderDeactivatedListener:(PPRetailContactlessReaderDeactivatedEvent _Nullable)listener

Return Value

PPRetailContactlessReaderDeactivatedSignal an object that can be used to remove the listener when you’re done with it.

Discussion

Add a listener for the contactlessReaderDeactivated event

Declared In

PPRetailTransactionContext.h

– removeContactlessReaderDeactivatedListener:

Remove a listener for the contactlessReaderDeactivated event given the signal object that was returned from addContactlessReaderDeactivatedListener

- (void)removeContactlessReaderDeactivatedListener:(PPRetailContactlessReaderDeactivatedSignal _Nullable)listenerToken

Discussion

Remove a listener for the contactlessReaderDeactivated event given the signal object that was returned from addContactlessReaderDeactivatedListener

Declared In

PPRetailTransactionContext.h

– addContactlessReaderActivatedListener:

Add a listener for the contactlessReaderActivated event

- (PPRetailContactlessReaderActivatedSignal _Nullable)addContactlessReaderActivatedListener:(PPRetailContactlessReaderActivatedEvent _Nullable)listener

Return Value

PPRetailContactlessReaderActivatedSignal an object that can be used to remove the listener when you’re done with it.

Discussion

Add a listener for the contactlessReaderActivated event

Declared In

PPRetailTransactionContext.h

– removeContactlessReaderActivatedListener:

Remove a listener for the contactlessReaderActivated event given the signal object that was returned from addContactlessReaderActivatedListener

- (void)removeContactlessReaderActivatedListener:(PPRetailContactlessReaderActivatedSignal _Nullable)listenerToken

Discussion

Remove a listener for the contactlessReaderActivated event given the signal object that was returned from addContactlessReaderActivatedListener

Declared In

PPRetailTransactionContext.h

– addPinEntryListener:

Add a listener for the pinEntry event

- (PPRetailPinEntrySignal _Nullable)addPinEntryListener:(PPRetailPinEntryEvent _Nullable)listener

Return Value

PPRetailPinEntrySignal an object that can be used to remove the listener when you’re done with it.

Discussion

Add a listener for the pinEntry event

Declared In

PPRetailTransactionContext.h

– removePinEntryListener:

Remove a listener for the pinEntry event given the signal object that was returned from addPinEntryListener

- (void)removePinEntryListener:(PPRetailPinEntrySignal _Nullable)listenerToken

Discussion

Remove a listener for the pinEntry event given the signal object that was returned from addPinEntryListener

Declared In

PPRetailTransactionContext.h

– addWillPresentSignatureListener:

Add a listener for the willPresentSignature event

- (PPRetailWillPresentSignatureSignal _Nullable)addWillPresentSignatureListener:(PPRetailWillPresentSignatureEvent _Nullable)listener

Return Value

PPRetailWillPresentSignatureSignal an object that can be used to remove the listener when you’re done with it.

Discussion

Add a listener for the willPresentSignature event

Declared In

PPRetailTransactionContext.h

– removeWillPresentSignatureListener:

Remove a listener for the willPresentSignature event given the signal object that was returned from addWillPresentSignatureListener

- (void)removeWillPresentSignatureListener:(PPRetailWillPresentSignatureSignal _Nullable)listenerToken

Discussion

Remove a listener for the willPresentSignature event given the signal object that was returned from addWillPresentSignatureListener

Declared In

PPRetailTransactionContext.h

– addReaderTippingCompletedListener:

Add a listener for the readerTippingCompleted event

- (PPRetailReaderTippingCompletedSignal _Nullable)addReaderTippingCompletedListener:(PPRetailReaderTippingCompletedEvent _Nullable)listener

Return Value

PPRetailReaderTippingCompletedSignal an object that can be used to remove the listener when you’re done with it.

Discussion

Add a listener for the readerTippingCompleted event

Declared In

PPRetailTransactionContext.h

– removeReaderTippingCompletedListener:

Remove a listener for the readerTippingCompleted event given the signal object that was returned from addReaderTippingCompletedListener

- (void)removeReaderTippingCompletedListener:(PPRetailReaderTippingCompletedSignal _Nullable)listenerToken

Discussion

Remove a listener for the readerTippingCompleted event given the signal object that was returned from addReaderTippingCompletedListener

Declared In

PPRetailTransactionContext.h

– addDidCompleteSignatureListener:

Add a listener for the didCompleteSignature event

- (PPRetailDidCompleteSignatureSignal _Nullable)addDidCompleteSignatureListener:(PPRetailDidCompleteSignatureEvent _Nullable)listener

Return Value

PPRetailDidCompleteSignatureSignal an object that can be used to remove the listener when you’re done with it.

Discussion

Add a listener for the didCompleteSignature event

Declared In

PPRetailTransactionContext.h

– removeDidCompleteSignatureListener:

Remove a listener for the didCompleteSignature event given the signal object that was returned from addDidCompleteSignatureListener

- (void)removeDidCompleteSignatureListener:(PPRetailDidCompleteSignatureSignal _Nullable)listenerToken

Discussion

Remove a listener for the didCompleteSignature event given the signal object that was returned from addDidCompleteSignatureListener

Declared In

PPRetailTransactionContext.h