Xamarin.Forms: Add Credit/Debit Card Reader to you App with PayPal.Forms

Xamarin.Forms: Add Credit/Debit Card Reader to you App with PayPal.Forms

Hello today I'll show how easily is to add a card scanner into your Xamarin.Forms(Android, iOS) app with only a few lines of code using the PayPal.Forms Library.

First at all we need to add PayPal.Forms to all of your projects(Android, iOS and PCL-Forms) by searching for "PayPal.Forms" in nuget packages manager or running next command on a nuget packages console "Install-Package PayPal.Forms"

Second on our Android app we need to add a few lines of code for permissions and features inside our "AndroidManifest.xml"


Add "NSCameraUsageDescription" into you Info.plist file.
<string>We will use your camera to scan the credit card</string>

After this now we're able to configure PayPal.Forms init calls inside our MainActivity.cs(Android) and AppDelegate.cs(iOS)

Call just CrossPayPalManager.Init(); just after call Forms.Init ();

***NOTE: if you plan to use only card scanner you can use init PayPal Config as follow***

If the configuration is getting fine now we can use the scan method CrossPayPalManager.Current.ScanCard();

Optional Parameter:

-- PayPal: Display PayPal Logo in the Scanner Page
-- CardIO: Display CardIO Logo in the Scanner Page
-- None: Hide Brand Logo in the Scanner Page

Result Data:

-- Status (SuccessfulCancelledError)
-- Card:
--- Scaned: Returns true if card was scanned or false if the card was input by hand by user
--- RedactedCardNumber: Give you the card number with next format **** **** **** 1234.
--- PostalCode: Give you the card postal code(if is requerid).
--- ExpiryYear: Give you the card expiry year.
--- ExpiryMonth: Give you the card expiry month.
--- Cvv: Give you the card cvv.
--- CardType (Unrecognized, Ambiguous, Amex, Jcb, Visa, Mastercard, Discover)
--- CardNumber: Give you the card number.
--- CardImage: Forms ImageSource with Scanned Card Image.

Hope that this can help you to create and awesome Forms app now i invite you to play with it and also remember that this lib also can help you to implement PayPal Mobile SDK Frameworks for more information and examples take a look to my PayPal.Forms repository on Github:


In the future we will continue with this post series to allow you monetize your Xamarin.Forms easily Happy Code Devs


  1. hola alejandro buen dia
    porque pesas tanto la dll de Xamarin.Paypal.iOs

    1. Es por el peso de las librerías nativas de iOS pero en el ensamblado final no se ve reflejado el peso total puedes checar los pesos aquí





    2. Este comentario ha sido eliminado por el autor.

  2. o cuando tengo habilitada la opcion de "Link SDK assemblies only" y corro la app ya sea en emulador o en dispositivo fisico me marca el siguiente error "Could not link assemblies. Reason: Object reference not set to an instance of an object", pero cuando habilito la opcion de "Dont link" la app corre perfectamente en emulador o en dispositivo fisico pero pesa demasiado la app instalada alrededor de 200mb y solo utiliso esa libreria y un viewcontroller se me hace demasiado tendras algua idea de por que pasa eso??

  3. Este comentario ha sido eliminado por el autor.

  4. Tengo un problema al seleccionar el pago con tarjeta, me dice que la divisa no esta permitida con paypal, utilizo "MXN"

  5. Informative blog! I am truly awed by this blog post! Very clear explanation about the Xamarin Development. I agree with all points.
    Hire affordable Xamarin Developer


Publicar un comentario

Entradas populares de este blog

Xamarin Month: Fall in Love with Xamarin.Forms Shell

ASP.NET Core Identity with Cosmos DB (MongoDB) Part2: ASP.NET Core Code

C# Interface Ejemplo Sencillo