Skip to content

Commit

Permalink
Merge pull request #6 from square/tschweiger/readme-repo-improvements
Browse files Browse the repository at this point in the history
Update README and add `.gitattributes` file
  • Loading branch information
tobischw authored Jun 5, 2024
2 parents a24b369 + e7556a7 commit 8427c82
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* linguist-vendored
*.swift linguist-vendored=false
39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@

# Square Mobile Payments SDK

Build remarkable in-person experiences using Square's Mobile Payments SDK product now in beta. The Mobile Payments SDK has the advantage of being an API driven framework that allows for full customization as well as using the latest [V2/Payments](https://developer.squareup.com/explorer/square/payments-api/list-payments) API.
Build remarkable in-person experiences using Square's Mobile Payments SDK product, now in beta. Use the Mobile Payments SDK to accept in-person payments using Square hardware. The Mobile Payments SDK has the advantage of being an API-driven framework that allows for full customization and uses the latest [v2/payments](https://developer.squareup.com/explorer/square/payments-api/list-payments) API.

Learn what you can do with the Mobile Payments SDK [here](https://developer.squareup.com/docs/mobile-payments-sdk).

## Installation

### Swift Package Manager
### 1. Add frameworks using SPM or CocoaPods

To install the `SquareMobilePaymentsSDK` into your Xcode project, follow these steps:
#### Option A. Swift Package Manager

Install with [Swift Package Manager](https://www.swift.org/documentation/package-manager/) by following these steps:

1. Select `File > Add Package Dependencies...`.
2. Enter the repository URL: `https://github.com/square/mobile-payments-sdk-ios`.
Expand All @@ -19,38 +22,44 @@ To install the `SquareMobilePaymentsSDK` into your Xcode project, follow these s

Optionally, you can also add the `MockReaderUI` product to your target to simulate a physical reader when one is not present in a sandbox environment.

> [!WARNING]
> Please note that the `MockReaderUI` product should only be used in debug configurations and is not to be included in the release version of your application.
#### Option B. CocoaPods

### Cocoapods

Install with [CocoaPods](http://cocoapods.org/) by adding the following to your Podfile:
Install with [CocoaPods](http://cocoapods.org/) by adding the following to your `Podfile`:

```
use_frameworks!
pod "SquareMobilePaymentsSDK", "~> 2.0.0.beta1"
# Optionally include MockReaderUI if you wish to simulate a physical reader when one is not present.
# This feature is only available when provided a sandbox application id.
# This feature is only available when provided a sandbox application ID.
pod "MockReaderUI", "~> 2.0.0.beta1", configurations: ['Debug']
```
_Note that MockReaderUI framework **requires** that `SquareMobilePaymentsSDK` framework to also be present in podfile_
_Note that MockReaderUI framework **requires** the `SquareMobilePaymentsSDK` framework to also be present in your `Podfile`._

#### Add build phase to setup the SquareMobilePaymentsSDK framework ####
### 2. Add build phase to setup the framework

On your application targets’ Build Phases settings tab, click the + icon and choose New Run Script Phase. Create a Run Script in which you specify your shell (ex: /bin/sh), add the following contents to the script area below the shell:
On your application targets’ `Build Phases` settings tab, click the + icon and choose `New Run Script Phase`. Create a Run Script in which you specify your shell (ex: /bin/sh), and add the following contents to the script area below the shell:
```
SETUP_SCRIPT=${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"/SquareMobilePaymentsSDK.framework/setup"
if [ -f "$SETUP_SCRIPT" ]; then
"$SETUP_SCRIPT"
fi
```

## Documentation Links
* [MobilePaymentsSDK Overview](https://developer.squareup.com/docs/mobile-payments-sdk)
Make sure this build phase is after any `[CP] Embed Pods Frameworks` or `Embed Frameworks` Build Phase.

> [!WARNING]
> Please note that the `MockReaderUI` product should only be used in debug configurations and is not to be included in the release version of your application.
### 3. Start integrating the SDK

Follow the [Build on iOS guide](https://developer.squareup.com/docs/mobile-payments-sdk/ios#3-initialize-the-mobile-payments-sdk) to learn how to integrate the Mobile Payments SDK in your app.

## Documentation
* [Mobile Payments SDK Overview](https://developer.squareup.com/docs/mobile-payments-sdk)
* iOS Tech Reference
* [MobilePaymentsSDK Framework](https://developer.squareup.com/docs/sdk/mobile-payments/ios)
* [Mobile Payments SDK Framework](https://developer.squareup.com/docs/sdk/mobile-payments/ios)

If you need more assistance, contact [Developer and App Marketplace Support](https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68) or ask for help in the [Developer Forums](https://developer.squareup.com/forums/).

0 comments on commit 8427c82

Please sign in to comment.