DispatchConnect.StripeTapToPay.iOS
0.1.1
dotnet add package DispatchConnect.StripeTapToPay.iOS --version 0.1.1
NuGet\Install-Package DispatchConnect.StripeTapToPay.iOS -Version 0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DispatchConnect.StripeTapToPay.iOS" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DispatchConnect.StripeTapToPay.iOS" Version="0.1.1" />
<PackageReference Include="DispatchConnect.StripeTapToPay.iOS" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DispatchConnect.StripeTapToPay.iOS --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DispatchConnect.StripeTapToPay.iOS, 0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DispatchConnect.StripeTapToPay.iOS@0.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DispatchConnect.StripeTapToPay.iOS&version=0.1.1
#tool nuget:?package=DispatchConnect.StripeTapToPay.iOS&version=0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Dispatch Connect - Stripe Tap to Pay for iOS
Native iOS XCFramework wrapper for Stripe Terminal Tap to Pay functionality, designed for .NET MAUI iOS applications.
What's Included
This package contains two XCFrameworks:
- DCStripeTapToPayWrapper.xcframework - Custom Objective-C wrapper exposing Stripe Terminal functionality
- StripeTerminal.xcframework - Stripe Terminal SDK v5.x (dependency)
Requirements
- iOS 15.4 or later
- .NET 8.0 or later
- Xcode 15.0+ (for building)
Installation
Option 1: NuGet Package (Recommended)
dotnet add package DispatchConnect.StripeTapToPay.iOS
The frameworks will be automatically included in your iOS project via MSBuild.
Option 2: Manual Installation
- Download
TapToPayFrameworks.zipfrom GitHub Releases - Extract both XCFrameworks to your project
- Add them as
NativeReferenceitems in your.csproj:
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'ios'">
<NativeReference Include="Native\DCStripeTapToPayWrapper.xcframework">
<Kind>Framework</Kind>
<SmartLink>True</SmartLink>
</NativeReference>
<NativeReference Include="Native\StripeTerminal.xcframework">
<Kind>Framework</Kind>
<SmartLink>True</SmartLink>
</NativeReference>
</ItemGroup>
Usage
1. Initialize the SDK
// In your iOS-specific code or MauiProgram.cs
DCTapToPay.Shared.Initialize((completion) =>
{
// Fetch connection token from your backend
var token = await YourBackend.GetConnectionToken();
completion(token, null);
});
2. Connect to Tap to Pay Reader
DCTapToPay.Shared.EnsureConnected("your_location_id", (error) =>
{
if (error != null)
{
Console.WriteLine($"Connection error: {error.LocalizedDescription}");
return;
}
Console.WriteLine("Connected to Tap to Pay reader");
});
3. Process a Payment
var clientSecret = await YourBackend.CreatePaymentIntent(amount);
DCTapToPay.Shared.CollectAndProcess(clientSecret, (paymentIntentId, status, error) =>
{
if (error != null)
{
Console.WriteLine($"Payment error: {error.LocalizedDescription}");
return;
}
Console.WriteLine($"Payment {status}: {paymentIntentId}");
});
4. Cancel Operation (Optional)
DCTapToPay.Shared.Cancel();
Info.plist Requirements
Add these keys to your iOS Info.plist:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location access is required to accept payments</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Bluetooth is used to connect to card readers</string>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
</array>
API Reference
DCTapToPay.Shared
- Initialize(fetchToken) - Initialize the Stripe Terminal SDK (call once at app startup)
- EnsureConnected(locationId, completion) - Discover and connect to Tap to Pay reader
- CollectAndProcess(clientSecret, completion) - Process a payment with the given PaymentIntent
- Cancel() - Cancel any ongoing operation
Error Codes
| Code | Description |
|---|---|
| -100 | Terminal not initialized |
| -999 | Operation canceled by user |
| -10 | PaymentIntent not found |
| -12 | Payment processing failed |
Support
- GitHub: https://github.com/Dispatch-Connect-Services/DCStripeTapToPayWrapper
- Issues: https://github.com/Dispatch-Connect-Services/DCStripeTapToPayWrapper/issues
License
MIT License - See LICENSE file for details
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-ios15.4 is compatible. net9.0-ios was computed. net10.0-ios was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0-ios15.4
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.