Skip to content

Commit

Permalink
Integrate new version of CheckoutComponentsSDK
Browse files Browse the repository at this point in the history
Change paths for gitignore.
Add privacy manifest file.
Improvements in xcframework.
Fix package dependency paths.
  • Loading branch information
okhan-okbay-cko authored Jan 28, 2025
1 parent b573243 commit 5a4293c
Show file tree
Hide file tree
Showing 22 changed files with 21,548 additions and 21,863 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ playground.xcworkspace
Package.resolved

## Files
SampleApplication/SampleApplication/Configuration/env.xcconfig
EnvironmentVars.generated.swift
# Ignore all env.xcconfig files in any directory
**/env.xcconfig

# Ignore all EnvironmentVars.generated.swift files in any directory
**/EnvironmentVars.generated.swift
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
# checkout-ios-components
# Flow for Mobile iOS SDK ![BETA](https://img.shields.io/badge/status-BETA-yellow)

To see the details of how to integrate the SDK, please refer to our [public documentation](https://www.checkout.com/docs/payments/accept-payments/accept-a-payment-on-your-mobile-app).

Also, you can find an example integration by running our Sample Application.

## Configuring the sample app:
When you first clone the repository, you will see 2 files under the `SampleApplication/SampleApplication/Configuration` file:

<img width="213" alt="initial-state" src="https://github.com/user-attachments/assets/dc5d279d-1902-4c9c-9a8e-0aa5f9053883" />

`env-example.xcconfig`: Includes a dummy example of environment variables to be tracked under source control and to be shared.
`EnvironmentVars.stencil`: Code generation template file for a new tool that we start using: [Sourcery](https://github.com/krzysztofzablocki/Sourcery)

The actions that you need to take after cloning the repo:

`cd` to the repository's root folder.
run `bash .github/scripts/init-env-vars.sh`

Go to the newly copied file that’s `env.xcconfig`, which is an untracked (by `.gitignore`) version of the example file to host the public and private keys
Replace the dummy values with their own values that you received from Checkout.com.

run bash `.github/scripts/codegen-env-vars.sh`

This will create another untracked but compilable file named `EnvironmentVars.generated.swift` which will be referenced in the code.

You can run the sample project and see it up and running!

The final thing you will have will look like below:

<img width="292" alt="latest-state" src="https://github.com/user-attachments/assets/afd548ac-fe75-4722-966c-1627152b8b8d"/>


> [!CAUTION]
> Embedding the secret key into the `Sample Application` is only to see the sample app in a quick way. In real life, you must never embed a secret key into your actual application since there is practically no viable way to secure it fully. You must make a request to your own APIs to create a payment session.
## Dependencies
Please add NetworkClient dynamic dependency to the sample app's Package Dependencies: https://github.com/checkout/NetworkClient-iOS
10 changes: 5 additions & 5 deletions SDK/CheckoutComponentsSDK.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>CheckoutComponentsSDK.framework/CheckoutComponentsSDK</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>CheckoutComponentsSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>CheckoutComponentsSDK.framework/CheckoutComponentsSDK</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>CheckoutComponentsSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Loading

0 comments on commit 5a4293c

Please sign in to comment.