Skip to content

Commit

Permalink
Integrate new version of CheckoutComponentsSDK
Browse files Browse the repository at this point in the history
  • Loading branch information
okhan-okbay-cko committed Jan 24, 2025
1 parent 11398bd commit bc4f271
Show file tree
Hide file tree
Showing 20 changed files with 27,112 additions and 27,564 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
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# checkout-ios-components
# Flow for Mobile iOS SDK

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"/>

## Important
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.
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 bc4f271

Please sign in to comment.