PMManager Class Reference
Inherits from | NSObject |
Declared in | PMManager.h PMManager.m |
Tasks
-
+ initWithTestMode:merchantPublicKey:newDeviceId:init:
Initializes the SDK. This should always be the first call you make, when you use the SDK.
-
+ initWithTestMode:merchantPublicKey:newDeviceId:init:success:failure:success:failure:
Initializes the SDK. This should always be the first call you make, when you use the SDK.
-
+ preauthorizationWithMethod:parameters:consumable:success:failure:
Creates a new PMPreauthorization.
This is a convenience method, which generates a token in the background. -
+ transactionWithMethod:parameters:consumable:success:failure:
Creates a new PMTransaction.
This is a convenience method, which generates a token in the background. -
+ preauthorizationWithToken:parameters:consumable:success:failure:
Creates a new PMPreauthorization.
-
+ transactionWithToken:parameters:consumable:success:failure:
Creates a new PMTransaction.
-
+ transactionWithPayment:parameters:consumable:success:failure:
Creates a new PMTransaction.
-
+ preauthorizationWithPayment:parameters:consumable:success:failure:
Creates a new PMPreauthorization.
-
+ transactionWithPaymentId:parameters:consumable:success:failure:
Creates a new PMTransaction with a given payment id.
@param paymentId -
+ preauthorizationWithPaymentId:parameters:consumable:success:failure:
Creates a new PMPreauthorization with a given payment id.
@param paymentId -
+ generateTokenWithMethod:parameters:success:failure:
Creates a new token.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..) -
+ generateTokenWithMethod:success:failure:
Creates a new token.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..) -
+ generateTokenWithPublicKey:testMode:method:parameters:success:failure:
This is the preferred way to use the SDK.
Generate a token using this method and use it in your backend to process transactions, preauthorizations or any other future available trough the PayMill API.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..) -
+ generateTokenWithPublicKey:testMode:method:success:failure:
This is the preferred way to use the SDK.
Generate a token using this method and use it in your backend to process transactions, preauthorizations or any other future available trough the PayMill API.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..) -
+ getTransactionsList:failure:
Lists all transactions for the configured deviceId.
-
+ getTransactionForId:success:failure:
Get a specific PMTransaction.
-
+ getPreauthorizationsList:onFailure:
Lists all preauthorizations for the configured deviceId.
-
+ getPreauthorzationForId:success:failure:
Get a specific PMPreauthorization.
-
+ getNonConsumedPreauthorizationsList:failure:
Lists all not consumed PMPreauthorization objects for the configured deviceId.
-
+ getNonConsumedTransactionsList:failure:
Lists all not consumed PMTransaction objects for the configured deviceId.
-
+ consumeTransactionForId:success:failure:
Consume the given transaction. After successful consumption, the transaction will no longer appear in the list of not consumed.
-
+ consumePreauthorizationForId:success:failure:
Consume the given preauthorization. After successful consumption, the preauthorization will no longer appear in the list of not consumed.
-
+ getNewDeviceIdWithBlock:failure:
Creates new device id.
-
+ getDeviceId
Returns the current device id.
-
+ isInit
Returns YES, if the SDK was initialized, NO otherwise.
-
+ SDKVersion
Returns the current SDK version as string.
-
+ getPaymentsListWithPassword:successBlock:andFailureBlock:
Lists payments available for the device and the pasword provided in the Safe Store
-
+ arePaymentsAvailableWithSuccessBlock:andFailureBlock:
Checks whether payments are available for the device
-
+ resetPaymentsWithWithSuccessBlock:andFailureBlock:
Reset the password and payments for the device
-
+ deletePayment:withPassword:successBlock:andFailureBlock:
Delete the given payment object from the Safe Store
Class Methods
SDKVersion
Returns the current SDK version as string.
+ (NSString *)SDKVersion
Return Value
the SDK version.
Discussion
Returns the current SDK version as string.
Declared In
PMManager.h
arePaymentsAvailableWithSuccessBlock:andFailureBlock:
Checks whether payments are available for the device
+ (void)arePaymentsAvailableWithSuccessBlock:(OnAvailablePaymentsSuccess)successBlock andFailureBlock:(OnAvailablePaymentsFailure)failureBlock
Parameters
- successBlock
a block function of type OnAvailablePaymentsSuccess that will be called on success
- failureBlock
a block function of type OnAvailablePaymentsFailure that will be called on failure
Discussion
Checks whether payments are available for the device
Declared In
PMManager.h
consumePreauthorizationForId:success:failure:
Consume the given preauthorization. After successful consumption, the preauthorization will no longer appear in the list of not consumed.
+ (void)consumePreauthorizationForId:(NSString *)preauthorizationId success:(OnConsumeSuccess)successBlock failure:(OnConsumeFailure)failureBlock
Parameters
- preauthorizationId
the id of the preauthorization.
- success
a block callback that is executed when the preauthorization is consumed successfully.
- failure
a block callback that is executed when the preauthorization consumption failed.
Discussion
Consume the given preauthorization. After successful consumption, the preauthorization will no longer appear in the list of not consumed.
Declared In
PMManager.h
consumeTransactionForId:success:failure:
Consume the given transaction. After successful consumption, the transaction will no longer appear in the list of not consumed.
+ (void)consumeTransactionForId:(NSString *)transactionId success:(OnConsumeSuccess)successBlock failure:(OnConsumeFailure)failureBlock
Parameters
- transactionId
the id of the transaction.
- success
a block callback that is executed when the transaction is consumed successfully.
- failure
a block callback that is executed when the transaction consumption failed.
Discussion
Consume the given transaction. After successful consumption, the transaction will no longer appear in the list of not consumed.
Declared In
PMManager.h
deletePayment:withPassword:successBlock:andFailureBlock:
Delete the given payment object from the Safe Store
+ (void)deletePayment:(PMPayment *)payment withPassword:(NSString *)password successBlock:(OnPaymentDeleteSuccess)successBlock andFailureBlock:(OnPaymentDeleteFailure)failureBlock
Parameters
- payment
a payment object which is to be deleted
- password
the password securing the payments
- successBlock
a block function of type OnPaymentDeleteSuccess that will be called on success
- failureBlock
a block function of type OnPaymentDeleteFailure that will be called on failure
Discussion
Delete the given payment object from the Safe Store
Declared In
PMManager.h
generateTokenWithMethod:parameters:success:failure:
Creates a new token.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..)
+ (void)generateTokenWithMethod:(id<PMPaymentMethod>)method parameters:(PMPaymentParams *)params success:(OnTokenSuccess)successBlock failure:(OnTokenFailure)failureBlock
Parameters
- method
PMPaymentMethod created with PMFactory.
- success
a block callback that is executed when the token is created successfully.
- failure
a block callback that is executed when the token creation failed.
- parameters
PMPaymentParams created with PMFactory. It may be nil
Discussion
Creates a new token.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..)
Declared In
PMManager.h
generateTokenWithMethod:success:failure:
Creates a new token.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..)
+ (void)generateTokenWithMethod:(id<PMPaymentMethod>)method success:(OnTokenSuccess)successBlock failure:(OnTokenFailure)failureBlock
Parameters
- method
PMPaymentMethod created with PMFactory.
- success
a block callback that is executed when the token is created successfully.
- failure
a block callback that is executed when the token creation failed.
Discussion
Creates a new token.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..)
Declared In
PMManager.h
generateTokenWithPublicKey:testMode:method:parameters:success:failure:
This is the preferred way to use the SDK.
Generate a token using this method and use it in your backend to process transactions, preauthorizations or any other future available trough the PayMill API.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..)
+ (void)generateTokenWithPublicKey:(NSString *)merchantPublicKey testMode:(BOOL)testMode method:(id<PMPaymentMethod>)method parameters:(PMPaymentParams *)params success:(OnTokenSuccess)successBlock failure:(OnTokenFailure)failureBlock
Parameters
- merchantPublicKey
your PayMill public key for LIVE or TEST mode, depending on the previous parameter.
- testMode
true for TEST mode, false for LIVE mode.
- method
PMPaymentMethod created with PMFactory. It may be nil.
- success
a block callback that is executed when the token is created successfully.
- failure
a block callback that is executed when the token creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
This is the preferred way to use the SDK.
Generate a token using this method and use it in your backend to process transactions, preauthorizations or any other future available trough the PayMill API.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..)
Declared In
PMManager.h
generateTokenWithPublicKey:testMode:method:success:failure:
This is the preferred way to use the SDK.
Generate a token using this method and use it in your backend to process transactions, preauthorizations or any other future available trough the PayMill API.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..)
+ (void)generateTokenWithPublicKey:(NSString *)merchantPublicKey testMode:(BOOL)testMode method:(id<PMPaymentMethod>)method success:(OnTokenSuccess)successBlock failure:(OnTokenFailure)failureBlock
Parameters
- merchantPublicKey
your PayMill public key for LIVE or TEST mode, depending on the previous parameter.
- testMode
true for TEST mode, false for LIVE mode.
- method
PMPaymentMethod created with PMFactory. It may be nil.
- success
a block callback that is executed when the token is created successfully.
- failure
a block callback that is executed when the token creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
This is the preferred way to use the SDK.
Generate a token using this method and use it in your backend to process transactions, preauthorizations or any other future available trough the PayMill API.
Learn more about tokens in the PayMill documentation(https://www.paymill.com/en-gb/documentation-3/)..)
Declared In
PMManager.h
getDeviceId
Returns the current device id.
+ (NSString *)getDeviceId
Return Value
the id or null if none is set.
Discussion
Returns the current device id.
Declared In
PMManager.h
getNewDeviceIdWithBlock:failure:
Creates new device id.
+ (void)getNewDeviceIdWithBlock:(OnDeviceIdSucces)successBlock failure:(OnDeviceIdFailure)failureBlock
Parameters
- success
a block callback that is executed when the new device id is created successfully.
- failure
a block callback that is executed when the device id creation failed.
Discussion
Creates new device id.
Declared In
PMManager.h
getNonConsumedPreauthorizationsList:failure:
Lists all not consumed PMPreauthorization objects for the configured deviceId.
+ (void)getNonConsumedPreauthorizationsList:(OnNotConsumedPreauthorizationsSuccess)successBlock failure:(OnNotConsumedTransactionsFailure)failureBlock
Parameters
- success
a block callback that is executed when the preauthorizations were listed successfully.
- failure
a block callback that is executed when the listing the preauthorizations failed.
Discussion
Lists all not consumed PMPreauthorization objects for the configured deviceId.
Declared In
PMManager.h
getNonConsumedTransactionsList:failure:
Lists all not consumed PMTransaction objects for the configured deviceId.
+ (void)getNonConsumedTransactionsList:(OnNotConsumedTransactionsSuccess)successBlock failure:(OnNotConsumedTransactionsFailure)failureBlock
Parameters
- success
a block callback that is executed when the transactions were listed successfully.
- failure
a block callback that is executed when the listing the transactions failed.
Discussion
Lists all not consumed PMTransaction objects for the configured deviceId.
Declared In
PMManager.h
getPaymentsListWithPassword:successBlock:andFailureBlock:
Lists payments available for the device and the pasword provided in the Safe Store
+ (void)getPaymentsListWithPassword:(NSString *)password successBlock:(OnPaymentsListSuccess)successBlock andFailureBlock:(OnPaymentsListFailure)failureBlock
Parameters
- password
the password securing the payments
- successBlock
a block callback that is executed when the payments were listed successfully
- ailureBlock
a block callback that is executed when the listing the payments failed
Discussion
Lists payments available for the device and the pasword provided in the Safe Store
Declared In
PMManager.h
getPreauthorizationsList:onFailure:
Lists all preauthorizations for the configured deviceId.
+ (void)getPreauthorizationsList:(OnPreauthorizationsListSuccess)successBlock onFailure:(OnPreauthorizationsListFailure)failureBlock
Parameters
- success
a block callback that is executed when the preauthorizations were listed succesсfully.
- failure
a block callback that is executed when the listing the preauthorizations failed.
Discussion
Lists all preauthorizations for the configured deviceId.
Declared In
PMManager.h
getPreauthorzationForId:success:failure:
Get a specific PMPreauthorization.
+ (void)getPreauthorzationForId:(NSString *)preauthorizationId success:(OnPreauthorizationSuccess)successBlock failure:(OnPreauthorizationFailure)failureBlock
Parameters
- success
a block callback that is executed when the preauthorization is get successfully.
- transactionId
the id of the transaction.
- failure
a block callback that is executed when the preauthorization getting failed.
Discussion
Get a specific PMPreauthorization.
Declared In
PMManager.h
getTransactionForId:success:failure:
Get a specific PMTransaction.
+ (void)getTransactionForId:(NSString *)transactionId success:(OnTransactionSuccess)successBlock failure:(OnTransactionFailure)failureBlock
Parameters
- transactionId
the id of the transaction.
- success
a block callback that is executed when the transaction is get successfully.
- failure
a block callback that is executed when the transaction getting failed.
Discussion
Get a specific PMTransaction.
Declared In
PMManager.h
getTransactionsList:failure:
Lists all transactions for the configured deviceId.
+ (void)getTransactionsList:(OnTransactionsListSuccess)successBlock failure:(OnTransactionFailure)failureBlock
Parameters
- success
a block callback that is executed when the transactions were listed successfully.
- failure
a block callback that is executed when the listing the transactions failed.
Discussion
Lists all transactions for the configured deviceId.
Declared In
PMManager.h
initWithTestMode:merchantPublicKey:newDeviceId:init:
Initializes the SDK. This should always be the first call you make, when you use the SDK.
+ (void)initWithTestMode:(BOOL)testmode merchantPublicKey:(NSString *)merchantPublicKey newDeviceId:(NSString *)newDeviceId init:(OnInit)onInit
Parameters
- merchantPublicKey
your PayMill public key for LIVE or TEST mode, depending on the previous parameter.
- newDeviceId
an optional deviceID.
Note: You cannot specify an arbitrary string. The device ID must have been generated by the SDK, for example with getNewDeviceId() . You can use this parameter to associate end users in your applications with SDK deviceIDs.If you don’t specify a device ID, the SDK will generate one and save it for later use.
- testMode
true for TEST mode, false for LIVE mode.
- init
block function of type OnInit that will be called on success or failure
Discussion
Initializes the SDK. This should always be the first call you make, when you use the SDK.
Declared In
PMManager.h
initWithTestMode:merchantPublicKey:newDeviceId:init:success:failure:success:failure:
Initializes the SDK. This should always be the first call you make, when you use the SDK.
+ (void)initWithTestMode:(BOOL)testmode merchantPublicKey:(NSString *)merchantPublicKey newDeviceId:(NSString *)newDeviceId init:(OnInit)onInit success:(OnNotConsumedTransactionsSuccess)successTranBlock failure:(OnNotConsumedTransactionsFailure)failureTranBlock success:(OnNotConsumedPreauthorizationsSuccess)successPreauthBlock failure:(OnNotConsumedPreauthorizationsFailure)failurePreauthBlock
Parameters
- merchantPublicKey
your PayMill public key for LIVE or TEST mode, depending on the previous parameter.
- newDeviceId
an optional deviceID.
Note: You cannot specify an arbitrary string. The device ID must have been generated by the SDK, for example with getNewDeviceId() . You can use this parameter to associate end users in your applications with SDK deviceIDs.If you don’t specify a device ID, the SDK will generate one and save it for later use.
- successTranBlock
optional block callback for getting all not consumed PMTrаnsaction objects. The block will be called on success.
- failureTranBlock
optional block callback that will be called on failure when getting all not consumed PMTrаnsaction objects.
- successPreauthBlock
optional block callback for getting all not consumed PMPreauthorization objects. The block will be called on success.
- failurePreauthBlock
optional block callback that will be called on failure when getting all not consumed PMPreauthorization objects.
- testMode
true for TEST mode, false for LIVE mode.
- init
block callback that will be called on success or failure
Discussion
Initializes the SDK. This should always be the first call you make, when you use the SDK.
Declared In
PMManager.h
isInit
Returns YES, if the SDK was initialized, NO otherwise.
+ (BOOL)isInit
Discussion
Returns YES, if the SDK was initialized, NO otherwise.
Declared In
PMManager.h
preauthorizationWithMethod:parameters:consumable:success:failure:
Creates a new PMPreauthorization.
This is a convenience method, which generates a token in the background.
+ (void)preauthorizationWithMethod:(id<PMPaymentMethod>)method parameters:(PMPaymentParams *)params consumable:(BOOL)consumable success:(OnPreauthorizationSuccess)successBlock failure:(OnPreauthorizationFailure)failureBlock
Parameters
- method
PMPaymentMethod created with PMFactory.
- consumable
true if you want to consume the preauthorization later, false otherwise.
- success
a block callback that is executed when the preauthorization is created successfully.
- failure
a block callback that is executed when the preauthorization creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
Creates a new PMPreauthorization.
This is a convenience method, which generates a token in the background.
Declared In
PMManager.h
preauthorizationWithPayment:parameters:consumable:success:failure:
Creates a new PMPreauthorization.
+ (void)preauthorizationWithPayment:(PMPayment *)payment parameters:(PMPaymentParams *)params consumable:(BOOL)consumable success:(OnTransactionSuccess)successBlock failure:(OnTransactionFailure)failureBlock
Parameters
- payment
a previously generated payment object.
- consumable
true if you want to consume the preauthorization later, false otherwise.
- success
a block callback that is executed when the transaction is created successfully.
- failure
a block callback that is executed when the transaction creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
Creates a new PMPreauthorization.
Declared In
PMManager.h
preauthorizationWithPaymentId:parameters:consumable:success:failure:
Creates a new PMPreauthorization with a given payment id.
@param paymentId
+ (void)preauthorizationWithPaymentId:(NSString *)paymentId parameters:(PMPaymentParams *)params consumable:(BOOL)consumable success:(OnTransactionSuccess)successBlock failure:(OnTransactionFailure)failureBlock
Parameters
- consumable
true if you want to consume the preauthorization later, false otherwise.
- success
a block callback that is executed when the transaction is created successfully.
- failure
a block callback that is executed when the transaction creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
Creates a new PMPreauthorization with a given payment id.
@param paymentId
Declared In
PMManager.h
preauthorizationWithToken:parameters:consumable:success:failure:
Creates a new PMPreauthorization.
+ (void)preauthorizationWithToken:(NSString *)token parameters:(PMPaymentParams *)params consumable:(BOOL)consumable success:(OnPreauthorizationSuccess)successBlock failure:(OnPreauthorizationFailure)failureBlock
Parameters
- token
a previously generated token.
- consumable
true if you want to consume the preauthorization later, false otherwise.
- success
a block callback that is executed when the preauthorization is created successfully.
- failure
a block callback that is executed when the preauthorization creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
Creates a new PMPreauthorization.
Declared In
PMManager.h
resetPaymentsWithWithSuccessBlock:andFailureBlock:
Reset the password and payments for the device
+ (void)resetPaymentsWithWithSuccessBlock:(OnPaymentsResetSuccess)successBlock andFailureBlock:(OnPaymentsResetFailure)failureBlock
Parameters
- successBlock
a block function of type OnPaymentsResetSuccess that will be called on success
- failureBlock
a block function of type OnPaymentsResetFailure that will be called on failure
Discussion
Reset the password and payments for the device
Declared In
PMManager.h
transactionWithMethod:parameters:consumable:success:failure:
Creates a new PMTransaction.
This is a convenience method, which generates a token in the background.
+ (void)transactionWithMethod:(id<PMPaymentMethod>)method parameters:(PMPaymentParams *)params consumable:(BOOL)consumable success:(OnTransactionSuccess)successBlock failure:(OnTransactionFailure)failureBlock
Parameters
- method
PMPaymentMethod created with PMFactory.
- consumable
true if you want to consume the preauthorization later, false otherwise.
- success
a block callback that is executed when the transaction is created successfully.
- failure
a block callback that is executed when the transaction creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
Creates a new PMTransaction.
This is a convenience method, which generates a token in the background.
Declared In
PMManager.h
transactionWithPayment:parameters:consumable:success:failure:
Creates a new PMTransaction.
+ (void)transactionWithPayment:(PMPayment *)payment parameters:(PMPaymentParams *)params consumable:(BOOL)consumable success:(OnTransactionSuccess)successBlock failure:(OnTransactionFailure)failureBlock
Parameters
- payment
a previously generated payment object.
- consumable
true if you want to consume the preauthorization later, false otherwise.
- success
a block callback that is executed when the transaction is created successfully.
- failure
a block callback that is executed when the transaction creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
Creates a new PMTransaction.
Declared In
PMManager.h
transactionWithPaymentId:parameters:consumable:success:failure:
Creates a new PMTransaction with a given payment id.
@param paymentId
+ (void)transactionWithPaymentId:(NSString *)paymentId parameters:(PMPaymentParams *)params consumable:(BOOL)consumable success:(OnTransactionSuccess)successBlock failure:(OnTransactionFailure)failureBlock
Parameters
- consumable
true if you want to consume the preauthorization later, false otherwise.
- success
a block callback that is executed when the transaction is created successfully.
- failure
a block callback that is executed when the transaction creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
Creates a new PMTransaction with a given payment id.
@param paymentId
Declared In
PMManager.h
transactionWithToken:parameters:consumable:success:failure:
Creates a new PMTransaction.
+ (void)transactionWithToken:(NSString *)token parameters:(PMPaymentParams *)params consumable:(BOOL)consumable success:(OnTransactionSuccess)successBlock failure:(OnTransactionFailure)failureBlock
Parameters
- token
a previously generated token.
- consumable
true if you want to consume the preauthorization later, false otherwise.
- success
a block callback that is executed when the transaction is created successfully.
- failure
a block callback that is executed when the transaction creation failed.
- parameters
PMPaymentParams created with PMFactory.
Discussion
Creates a new PMTransaction.
Declared In
PMManager.h