Giter Club home page Giter Club logo

adyen-ios's Introduction

Adyen SDK for iOS

With Adyen SDK you can help your shoppers pay with a payment method of their choice, selected from a dynamically generated list of available payment methods. Method availability is based on shoppers’ location, transaction currency, and transaction amount.

You can integrate the SDK in two ways: either make use of the default UI components and flows preconfigured by Adyen (Quick integration), or implement your own UI and checkout experience (Custom integration).

Credit Card            One-Click            Apple Pay

Installation

Use CocoaPods to integrate the Adyen SDK into your project. For this, add the following line to your Podfile and run pod install.

pod 'Adyen'

Quick integration

If you want to quickly integrate with Adyen, use the default UI elements that we provide for selecting payment methods, entering payment details, and completing a payment.

For this, instantiate CheckoutViewController, present it in your app, and implement the CheckoutViewControllerDelegate protocol for callbacks. All UI interactions are handled by Adyen.

let viewController = CheckoutViewController(delegate: self)
present(viewController, animated: true)

The following CheckoutViewControllerDelegate methods should be implemented:

- checkoutViewController:requiresPaymentDataForToken:completion:

This method requires you to fetch payment data from your server and pass it to the completion handler. Upon receiving valid payment data, the SDK will present a list of available payment methods.

For your convenience, we provide a demo server. You can find information on setting up your own server here.

- checkoutViewController:requiresReturnURL:

This method will be called if a selected payment method requires user authentication outside of your app environment (in a web browser, native banking app, etc.). Upon payment authorisation, your app will be reopened using the application(_:open:options:) callback of UIApplicationDelegate. The URL used to open your app should be passed to the completion handler.

- checkoutViewController:didFinishWith:

This method will provide you with the result of the completed payment request (authorised, refused, etc.).

For implementation details, refer to the Quick integration guide.

Custom integration

With custom integration you will have full control over the payment flow and will be able to implement your own unique checkout experience.

This approach requires instantiating and starting a PaymentRequest and implementing the PaymentRequestDelegate protocol for callbacks. The PaymentRequestDelegate callbacks will provide you with a list of available payment methods, the URL for payment methods that require an external flow, and the result of payment processing.

For implementation details, refer to the Custom integration guide.

Examples

You can find examples of both quick and custom integrations in the Examples folder of this repository.

See also

License

This repository is open source and available under the MIT license. For more information, see the LICENSE file.

adyen-ios's People

Contributors

adyen-git-manager avatar diegomarcon avatar

Watchers

shiuhyaw avatar

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.