At Prolific Interactive, we develop consumer-facing mobile apps and pride ourselves on aligning them perfectly with the style and brand of our partners. We aim to create an app that makes our partners say, “This is us!” without hesitation. In doing this, we are often confronted with the challenge of collecting payment information without ruining or crowding the UI.

For example, this is how we designed and built the payment screen for Lilly Pulitzer:

IMG_0001

When we executed on these designs, we used to fork the Stripe iOS SDK and modify it directly. This approach worked well enough, but it always felt hacky. We knew there had to be a better way to build these interfaces. Using our past experiences, we ultimately wrote Caishen, a library written from scratch with Swift. Caishen addresses some of the major pain points we’ve had with payment card UIs – adding Swift-specific functionality, interoperability and extensibility, and a cleaner approach to customization.

Here is a quick preview of the functionality:

Caishen Sample

All Swift Approach

One of the major drivers to developing this framework from scratch was the opportunity to build it using only Swift. Swift allowed us to produce code that is not only cleaner than the current Objective C libraries available, but also took advantage of powerful Swift features, including protocol extensions and generics.

Interoperability and Extensibility

Caishen comes out of the box with a lot of default functionality. On top of the text field element itself, the framework provides validation for all of the most common card types, including Visa, Mastercard, Discover, American Express, and more. Because of this, Caishen is fully usable right from the start: simply add it to your project and start using it, utilizing all of the default benefits.

We also made it easy for developers to put their own custom spin on the library.

Customizing Caishen’s Design

Last, but not least, it is incredibly easy for you to modify the look and feel of Caishen.

interface-builder

Going forward

Every app’s style is different, and Caishen is prepared to handle most of the common use-cases and issues right out of the box. However, we won’t stop here. New versions will follow as we encounter new situations that need to be accommodated for. We hope that Caishen becomes the go-to library of choice for accepting payment input and validation.

Caishen is now open-sourced and available through GitHub. You can contribute and help out with development in Caishen in one of two ways:

We are incredibly proud of the work we did in Caishen, and we can’t wait to see where it goes from here!

Share Button