Giter Site home page Giter Site logo

zarinpal-ios-payment's Introduction

The Repo and Project has been DEPRECATED and Archived please check iOS-SDK

ZarinPal iOS SDK Payment

Payment request and Automatic verification in Clinet

How to add Framework to my Project?

Simply Install by Cocoapods and use it!

  • NOTE: Framework Updated to Swift 4.1 Version Compile.
  • NOTE: Fix Amount DataType
  • NOTE: Supported iOS 10 to higher

How to Install Pod?

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.5+ is required

To integrate ZarinPal SDK into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
       pod 'ZarinPalSDKPayment', '~> 0.2.4'
end

Then, run the following command:

$ pod install

Example

       
import ZarinPalSDKPayment <= import this.
class ViewController: UIViewController , ZarinPalPaymentDelegate {
   
   func didSuccess(refID: String, authority: String, builder: ZarinPal.Builder) {
                       //when Payment is Success and return:
                       //refID: this is transaction id.
                       //authority: this is a payment unique id
                       //payment : included payment details ex: amount , description
       print(refID);
   }
   
   func didFailure(code: Int, authority: String?) {
    //when Payment is failure and return:
                       //status : ZarinPal failure codes
                       //authority: this is a payment unique id
       print(code);
   }
  
   
   @IBAction func click(_ sender: Any) {
       
       let zarinpal =   ZarinPal.Builder(vc: self, merchantID: "****************", amount: 100, description: "description");
      
       zarinpal.indicatorColor = UIColor.black;  //this set indicator color *optional
       zarinpal.title = "Payment Gateway";  //this set title of payment page *optional
       zarinpal.pageBackgroundColor = UIColor.lightGray; // this set background payment color *optional
       zarinpal.email = "[email protected]"; //this set email *optional
       zarinpal.mobile = "09355106005"; //this set mobile *optional
       zarinpal
           .build()
           .start(delegate: self);
       
   }
  

   override func viewDidAppear(_ animated: Bool) {
   
  
   }

   override func didReceiveMemoryWarning() {
       super.didReceiveMemoryWarning()
       // Dispose of any resources that can be recreated.
   }


}
       
       

zarinpal-ios-payment's People

Contributors

farshidroohi avatar imanx avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zarinpal-lab

zarinpal-ios-payment's Issues

install without pods

hi,
how can I install framework without CocoaPods?
(non-CocoaPods version of the ZarinPal SDK)

Upgrade swift version

Hi,
It's a nice framework but it's incompatible with swift 5 or upper versions.
Good luck

Generic iOS Device error

سلام, من با مشکل خیلی عجیب برخوردم که نمیدونم چه تر درستش کنم, ممنون میشم اگر کمک کنید
Vaghti dar hale Generic iOS Device Build mikonam error mide ke

Use of undeclared type 'ZarinPalPaymentDelegate'

screen shot 2018-02-21 at 18 21 16

screen shot 2018-02-21 at 18 22 34

Dar in axha neshoon mide ke vaghti dar simulator build mikonam error nist, amma dar halate Generic iOS Device error mide

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.