Access Checkout iOS is split into two projects:
- The AccessCheckoutSDK, available as a Cocoapods pod
- A sample App, AccessCheckoutDemo, demonstrating how to integrate the different functionalities available in the SDK
Refer to the Worldpay Developers documentation to find out how to integrate the SDK in your app - https://developer.worldpay.com/docs/access-worldpay/checkout/ios
Note: <access-checkout-ios-root> refers to the folder that contains your copy of the access-checkout-ios repository
-
Install XCode, if not already installed
-
Install cocoapods (for dependency management), if not already installed
sudo gem install cocoapods
-
Install dependencies for the SDK project (i.e. add pods)
cd <access-checkout-ios-root>/AccessCheckoutSDK pod install pod update
-
Open project in XCode
- Click on 'File > Open'
- Select the '/AccessCheckoutSDK/' directory and click 'Open'
-
Build the project
- Click the
Play
button in the top left corner to build the project, the build should be successful.
- Click the
-
Install
pact-ruby-standalone
- Download a copy from https://github.com/pact-foundation/pact-ruby-standalone
- Unzip the file in a folder of your choice (reference as
<pact-ruby-folder>
hereafter) - Run the
install.sh
script located in<pact-ruby-folder>
. This will install binaries in<pact-ruby-folder>/pact/bin/
-
Create a syml link to the
pact-ruby-standalone
binaries in the AccessCheckoutSDK projectcd <access-checkout-ios-root>/AccessCheckoutSDK/ mkdir pact cd pact ln -s <pact-ruby-folder>/pact/bin .
This step is required because we have configured a Test pre-action/post-action in XCode to start/stop a mock-service before and after the PACT tests. If you want, you can check this configuration as following:
1. Click on the AccessCheckoutSDK scheme next to the Play/Stop icon at the top of XCode 2. Click `Edit Scheme` 3. Expand `Test` 4. Click on `Pre-actions` / `Post-actions` to see the commands that are run
-
Go to the Test Navigator in XCode. You can access it by
- Clicking on View > Navigators > Show Test Navigator menu
- Or by clicking on the Diamond icon in the small menu bar above the list of modules
-
Click on the
Play
icon next toAccessCheckoutSDKTests
to run the unit tests -
Click on the
Play
icon next toAccessCheckoutSDKPactTest
to run the PACT tests- If you're having failures, make sure that the
<access-checkout-ios-root>/AccessCheckoutSDK/pact/bin
sym link exists
- If you're having failures, make sure that the
-
When running the Pact tests to generate and upload new Pact versions - make sure you run each Pact test file separately one after the other. There is an issue with PactConsumerSwift not supporting multiple providers.
See instructions in the AccessCheckoutSDK/scripts/mocks-build-phase.sh
script
-
Install dependencies
# Install Cocoapods dependencies for the SDK first cd <access-checkout-ios-root>/AccessCheckoutSDK pod install # Install Cocoapods dependencies for the demo app cd <access-checkout-ios-root>/AccessCheckoutDemo pod install
-
Open project
AccessCheckoutDemo
in XCode- Click on
File > Open
- Select the
<access-checkout-ios-root>/AccessCheckoutSDKDemo/AccessCheckoutDemo.xcworkspace
directory and clickOpen
- Click on
-
In the Project Navigator in XCode, click on the
AccessCheckoutDemo
app -
In the app properties, select the
AccessCheckoutDemo
target underTargets
-
Scroll down to the
User-Defined
properties -
Replace the
ACCESS_CHECKOUT_ID
value by theCheckout ID
that was provided to you when you were on-boarded on Access Worldpay -
To run the demo app, click the
Play
button in the top-left corner of the screen to open the demo app in the simulated device of your choice.
Checkmarx scans are triggered on push via a webhook set up in GitHub, and CRs for new releases must have a valid Checkmarx report attached to the CR
Run the command below to bump the SDK version in code. A commit with all relevant changes will be added to the branch currently checked out.
./scripts/bump_version.sh -v=[version] -t=[ticket_number]