Paymentwall website uses cookies to store your browsing preferences on your device. However, cookies do not collect personal information.

For more information about how we use cookies, check our cookie policy

Close

Documentation

New Documentation Getting Started API Libraries APIs Checklists Flows Integrations Mobile SDKs Reference Smart TV SDK SpiderPipe Testing Payments
Contacts
If you still have questions regarding integration, please email us at devsupport@paymentwall.com

MINT iOS SDK

Attachments

Do you need a simple and safe method to receive in-app payments? MINT is Paymentwall's cash payment solution designed to help monetize your digital goods and services all over the world.

Our MINT iOS SDK delivers a way to minimize development time and help accept MINT ePins in your application in several simple steps. Follow our instructions and start accepting MINT today!

How does it work?

The customer clicks on the “Buy” button inside your application. The MINT SDK is called at this moment and displays a pop up dialog with the payment information and field for entering the ePin. User enters ePin into the field and taps on the “Buy” button. The payment is completed and your callback function is triggered to handle its result. Your backend will be also notified about it.

Requirements

Credentials

Your mobile integration requires a Project key.
You can obtain these Paymentwall API credentials in the application settings of your Merchant Account at Paymentwall.com

Add SDK to your project

  1. In the menubar click "File" then "Add file to YOUR_PROJECT".
  2. Select the "MintSDK" directory in the downloaded repository.
  3. Make sure 'Copy items into destination group's folder (if needed)' is checked.
  4. Click "Add"
  5. Click on your project, in Targets tab click in "Build Settings"
  6. In the "Header Search Paths" add link to include file of SDK such as "$SOURCE_ROOT/MintSDK/include"
  7. In the "Library Search Paths" add link to file "MintSDK.a"
  8. In "Build Phases" tab add "MintResources.bundle" to "Copy Bundle Resources"

Accepting your first payment

Add the following imports

Objective-C

import "MintSDK.h"

Swift

Add this command to your Bridging-Header.h file

import "MintSDK.h"

Create MINT request

Objective-C

[MintSDK createNewPaymentWithApplicationID:YOUR_APPLICATION_HERE
         userID:YOUR_USER_ID 
         paymentName:PAYMENT_NAME
         paymentAmount:PAYMENT_AMOUNT
         paymentCurrency:PAYMENT_CURRENCY];

Swift

MintSDK.createNewPaymentWithApplicationID(YOUR_APPLICATION_HERE,
        userID:YOUR_USER_ID, 
        paymentName:PAYMENT_NAME,
        paymentAmount:PAYMENT_AMOUNT,
        paymentCurrency:PAYMENT_CURRENCY)

Start MINT dialog

Objective-C

[MintSDK createNewPaymentWithApplicationID:YOUR_APPLICATION_HERE userID:YOUR_USER_ID paymentName:PAYMENT_NAME paymentAmount:PAYMENT_AMOUNT paymentCurrency:PAYMENT_CURRENCY];

//Create Mint Payment Dialog
MintViewController *viewcontroller = [MintSDK createNewMintViewController];
viewcontroller.delegate = self;
[viewcontroller showMintWithParentViewController:self completion:^(int code){

}];

Swift

MintSDK.createNewPaymentWithApplicationID(YOUR_APPLICATION_HERE, userID: YOUR_USER_ID, paymentName:PAYMENT_NAME, paymentAmount:PAYMENT_AMOUNT, paymentCurrency:PAYMENT_CURRENCY)

//Create Mint Dialog
var viewController: MintViewController = MintSDK.createNewMintViewController()
viewController.delegate = self
viewController.showMintWithParentViewController(self, completion:{ (code) -> Void in

})

Result handling

You have to add MintSDKDelegate to your ViewController:

Objective-C

@interface YourViewController : UIViewController <MintSDKDelegate>

Swift

class YourViewController: UIViewController, MintSDKDelegate

You can handle payment results by defining your callback function. We recommend syncing up with your server at this stage to sync up user's balance, confirm purchased item etc. See the example:

Objective-C

#pragma mark - Mint SDK Delegate
-(void)mintResponse:(MintResponse *)response
{
    switch (response.responseCode) {
        case MINT_SUCCESSFUL:
            //Do something here
            break;
        case MINT_FAILED:
            //Do something here
            break;
        case MINT_CANCEL:
            //Do something here
            break;
        default:
            break;
    }
}

Swift

// MARK:- Mint SDK Delegate
func mintResponse(response: Mint Response!) {
    switch response.responseCode {
    case Int32(MINT_SUCCESSFUL.value):
        //Do something here
        break
    case Int32(MINT_FAILED.value):
        //Do something here
        break
    case Int32(MINT_CANCEL.value):
        //Do something here
        break
    default:
        break
    }
}

ResultCode code can get one of the following values:

MINT_SUCCESSFUL: the user has completed the payment.

MINT_FAILED: the user cannot complete the payment (he has entered at least one ePin but it was rejected by our system)

MINT_CANCEL: the user has aborted the payment.

Server notification handling

After each successful payment we will notify your server about it. We recommend to use this feature as it is the most reliable way to know when the payment went through. Even if your application crashes for some reason, your server will still be notified, so you can sync up later. Please use pingback processing documentation pingback processing documentation for more information.

This page needs JavaScript
Your browser is
not supported anymore.
Please update to the more recent one.
This page needs JavaScript
This page needs JavaScript.
Please enable it in your browser settings and try again.
Мы используем файлы cookie, чтобы вам было удобнее пользоваться сайтом. Используя сайт Paymentwall, вы соглашаетесь с нашей Политикой использования файлов cookie.