Giter Site home page Giter Site logo

paymentkit's Introduction

This project is deprecated and is no longer being actively maintained. Please use the Stripe iOS SDK instead.

PaymentKit

PaymentKit is a utility library for writing payment forms in iOS apps.

Important note

We've moved development of PaymentKit's components into our main iOS SDK. This will make it easier for us to keep them up-to-date, and make installation and integration simpler for most apps. Despite this, please note that you don't have to be a Stripe user to use these components - the UI we've built has no dependencies on the Stripe API.

Migration

If you're using CocoaPods, to install our iOS SDK, just add pod 'Stripe' to your Podfile. For other means of integration, check out our installation guide.

We've renamed PTKView to STPPaymentCardTextField. We've also provided a compatibility shim so if you have an app that uses PaymentKit, you won't have to change any of your code in order to migrate over. However, migration is extremely straightforward:

  • Remove any references to 'PaymentKit' in your Podfile, if you're using CocoaPods.
  • Rename any instances of PTKView in your application to STPPaymentCardTextField.
  • Remove any lines that read #import 'PTKView.h', and replace them with #import <Stripe/Stripe.h>.
  • Any classes that implement the PTKViewDelegate protocol should now adopt the STPPaymentCardTextFieldDelegate protocol instead.
  • Adjust your PTKViewDelegate methods as follows:
// Before
- (void)paymentView:(nonnull PTKView *)paymentView withCard:(nonnull PTKCard *)card isValid:(BOOL)valid {
    if (valid) {
        [self doSomethingWithCard:card];
    }
}

// After
- (void)paymentCardTextFieldDidChange:(STPPaymentCardTextField *)textField {
    if (textField.isValid) {
        STPCard *card = [[STPCard alloc] init];
        card.number = textField.cardNumber;
        card.expMonth = textField.expirationMonth;
        card.expYear = textField.expirationYear;
        card.cvc = textField.cvc;
        [self doSomethingWithCard:card];
    }
}

If you have any issues with migration, feel free to contact [email protected].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.