The Judopay library lets you integrate card payments into your Xamarin Forms project. It is built to be mobile first with ease of integration in mind. Judopay's SDK enables a faster, simpler and more secure payment experience within your app. Build trust and user loyalty in your app with our secure and intuitive SDK.
The SDK is compatible with Android 4.4 (API 19) and above and iOS 9 and above.
Add the Xamarin.Judopay
NuGet package to your .Net Standard 2.0 Library, Android and iOS projects.
In your Xamarin Forms page, create a new Judo instance:
var judo = new Judo
{
JudoId = "<JUDO_ID>",
Token = "<API_TOKEN>",
Secret = "<API_SECRET>",
Environment = JudoEnvironment.Sandbox,
Amount = 1.50m,
Currency = "GBP",
ConsumerReference = "YourUniqueReference"
};
Note: Please make sure that you are using a unique Consumer Reference for each different consumer.
iOS requires additional steps to get set up with the Xamarin SDK. See our wiki documentation for more information.
Create a PaymentPage to show the card entry screen for Payment:
var paymentPage = new PaymentPage(judo);
Navigation.PushAsync(paymentPage);
Receive the result of the payment:
paymentPage.ResultHandler += async (sender, result) =>
{
if ("Success".Equals(result.Response.Result))
{
// handle successful payment
// close payment page
await Navigation.PopAsync();
}
};
The Judopay Xamarin library supports a range of customization options. For more information on using Judopay for Xamarin see our wiki documentation.