Install the SDK
The mCommerce SDK is designed to work with iOS 6 and up.
Install the mCommerce SDK
Install the mCommerce SDK
Before you can process transactions, we need to set up the mobile.connect framework in your project.
Drag and Drop the
mobile.connect.framework
and the
mobile.connect-resources.bundle
folders to the "Frameworks" folder of your project. Make sure that the files are copied if needed.
Then, click on your project (above the project files), choose the "Build Phases" tab, and make sure
mobile.connect.framework
is in "Link Binaries with Libraries" and
mobile.connect-resources.bundle
is in "Copy Bundle Resources".
Also add
Security.framework
and
SystemConfiguration.framework
to your project: Click the "+" at "Link binaries with Libraries" and select it from the list.
You can now import the framework in your header file:
#import mobile.connect/mobile.connect.h>
Create the provider variable, e.g. in one of your controllers:
@property (strong, nonatomic) PWPaymentProvider *provider;
...and initialize it, for example in the
viewDidLoad
method.
- (void)viewDidLoad { [super viewDidLoad]; // Initialize Provider self.provider = [PWPaymentProvider getProviderWithApplicationId: YOUR APPLICATION IDENTIFIER profileToken: YOUR PROFILE TOKEN]; } - (void)viewDidLoad { [super viewDidLoad]; // Initialize Provider self.provider = [PWPaymentProvider getProviderWithApplicationId: YOUR APPLICATION IDENTIFIER profileToken: YOUR PROFILE TOKEN]; }
Replace "YOUR PROFILE TOKEN" and "YOUR APPLICATION IDENTIFIER" with your sandbox credentials.
Install the SDK
Before you can process transactions, we need to set up the Payworks Pulse.connect framework in your project.
Drag and drop
mobile.connect-android-version.jar
to the "libs" folder of your project. Make sure that the files are copied if needed. It is automatically added as a dependency.
Then, open your
AndroidManifest.xml
and declare the connect service within the application tag:
In addition, request the "INTERNET" permission before the application tag:
You can now initialize the service variable in your activity:
private PWProviderBinder _binder; private static final String APPLICATIONIDENTIFIER = "YOUR APP ID"; private static final String PROFILETOKEN = "YOUR PROFILE TOKEN"; private ServiceConnection _serviceConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { _binder = (PWProviderBinder) service; // we have a connection to the service try { _binder.initializeProvider(PWProviderMode.TEST, APPLICATIONIDENTIFIER, PROFILETOKEN); } catch (PWException ee) { // error initializing the provider ee.printStackTrace(); } } @Override public void onServiceDisconnected(ComponentName name) { _binder = null; } };
Replace "YOUR PROFILE TOKEN" and "YOUR APPLICATION IDENTIFIER" with your sandbox credentials.