Cancel or refund with a PSP reference
Method
Call cancelOrRefundTransactionWithPSPReference
to cancel or refund a transaction where the transaction was processed online successfully and generated a PSP reference. The response from the server indicates if the cancel or refund was received, not if it was performed.
If the request is successful, if the pspReference
of the original transaction is valid, and if the transaction was not already cancelled or refunded, the cancel or refund will always be performed. When the transactions are retrieved and their refunds are examined, each refund will have a processingState
to indicate whether a cancelOrRefund
request was sent.
Parameters
Name | Type | Required | Description |
---|---|---|---|
pspReference |
merchantReference | PSP reference of the original transaction. | |
merchantReference |
NSString | Reference for the merchant, used in reporting. | |
refundState |
ADYProcessingState | Indicates whether a cancelOrRefund request was sent. |
|
error |
NSError | Information about any errors that occurred. |
Cancel or refund with a tender reference
Method
Call cancelOrRefundTransactionWithTenderReference
to cancel or refund a transaction. This is used where the transaction was offline with the provided combination of tenderReference
and UniqueTerminalId (Model-SerialNumber). The response from the server indicates if the cancel or refund was received, not if it was performed.
If the request is successful, if the he combination of tenderReference
and UniqueTerminalId
of the original transaction is valid of the original transaction is valid, and if the transaction was not already cancelled or refunded, the cancel or refund will always be performed. When the transactions are retrieved and their refunds are examined, each refund will have a processingState
to indicate whether a cancelOrRefund
request was sent.
Parameters
Name | Type | Required | Description |
---|---|---|---|
tenderReference | NSString | Reference for the transaction, used as the PSP reference is not available. | |
uniqueTerminalId | NSString | Unique terminal ID to reference the PED that is processing the request. | |
merchantReference | NSString | Reference for the merchant, used in reporting. | |
refundState | ADYProcessingState | Indicates whether a | |
error | NSError | Information about any errors that occurred. |
* When the transactions are retrieved and their refunds are examined, each refund will have a processingState * to indicate whether a scheduleRefund-request was sent. * */ - (void)refundTransactionWithPSPReferece:(NSString *)pspReference amountToRefund:(ADYAmount *)amount terminalIdentifier:(NSString *)terminalIdentifier merchantReference:(NSString *)merchantReference tenderReference:(NSString *)tenderReference onCompletion:(void (^)(ADYProcessingState, NSError *))completion;
Partially refund a transaction
Method
Call refundTransactionWithPSPReferece
to partially refund a transaction with the provided combination of pspReference
, amount
, terminalIdentifier
, merchantReference
and tenderReference
The response from the server indicates if the scheduleRefund
request was received, not if it was performed.
If the request is successful, if the combination of tenderReference
and UniqueTerminalId
of the original transaction is valid of the original transaction is valid, and if the transaction was not already cancelled or refunded, the cancel or refund will always be performed. When the transactions are retrieved and their refunds are examined, each refund will have a processingState
to indicate whether a scheduleRefund
request was sent.
Parameters
Name | Type | Required | Description |
---|---|---|---|
pspReference | merchantReference | PSP reference of the original transaction. | |
| ADYAmount | A container for the amount that needs to be refunded. | |
tenderReference | NSString | Reference for the transaction, used as the PSP reference is not available. | |
| NSString | Unique terminal ID to reference the PED that is processing the request. | |
merchantReference | NSString | Reference for the merchant, used in reporting. | |
refundState | ADYProcessingState | Indicates whether a | |
| completion | Information about any errors that occurred. |
Cancel or refund from the terminal transaction list
Use this method cancel or refund a transaction from the terminal transaction list, and receive a receipt on the POS or on the PED.
You can only use this method for transactions that:
- have been completed on the terminal that is receiving the cancel or refund request.
- are still within the terminal storage – this is currently limited to 100 tenders.
Method
Call cancelOrRefundWithRequest
on the selected ADYDevice
:
(void)cancelOrRefundWithRequest:(ADYCancelOrRefundRequest *)request completion:(void (^)(ADYProcessingState state, NSArray<ADYReceipt *> *receipts, NSError *error))completion;
The response from the device indicates whether the request was received, not whether it was performed.
Parameters
Name | Type | Required | Description |
---|---|---|---|
request | ADYCancelOrRefundRequest | Object containing information about the transaction that you want to cancel or refund. | |
completion | Block | This block called when the request was processed. Parameters:
|
ADYCancelOrRefundRequest has the following parameters:
Name | Type | Required | Description |
---|---|---|---|
reference |
String | The tender reference for the transaction that you want to cancel or refund. | |
handleReceipt |
Boolean | Specifies that the POS handles and prints receipts. If omitted, it is required that the PED prints the receipt. If there is no printer unit, the transaction will fail. | |
additionalData |
NSMutableDictionary | Contains key/value pairs that you can use to specify additional data to be passed to the terminal. |