Skip to content

shurjopay-plugins/sp-package-ios-swift

Repository files navigation

image iOS swift package

Official shurjoPay iOS swift package for merchants or service providers to connect with shurjoPay Payment Gateway developed and maintained by ShurjoMukhi Limited.

Shurjopay swift package makes the payment system easier for you with just two method calls:

  • makePayment()
  • verify()

And that's all! To know more about its usage please check the details below.

How to add in your Xcode project?

  1. Navigate the File tab within the macOS bar, and click on “Add Packages”.
  2. On the search bar enter the github repository link of the Shurjopay swift package.
  3. Click on Add Package button.

Thats it! Now we are ready to use the package.

Usage

  • First create an object of Shurjopay.
  let shurjopay : Shurjopay = Shurjopay()
  • Then prepare payment request model.
  let requestModel : ShurjopayRequestModel = ShurjopayRequestModel(
            configs: ShurjopayConfigs(
                environment: "sandbox",
                userName: "sp_sandbox",
                password: "pyyk97hu&6u6",
                prefix: "sp",
                clientIP: "127.0.0.1"
            ),
            orderID: "sp1ab2c3d5",
            currency: "BDT",
            amount: 20,
            discountAmount: 0,
            discountPercentage: 0,
            customerName: "Shajedul Islam",
            customerPhoneNumber: "01628734916",
            customerAddress: "30/4 Darus Salam Road",
            customerCity: "Dhaka",
            customerPostcode: "1216",
            returnURL: "https://www.sandbox.shurjopayment.com/return_url",
            cancelURL: "https://www.sandbox.shurjopayment.com/cancel_url"
        )
  • Now we can call makePayment method to initiate the payment.
  shurjopay.makePayment(parentUIViewController: self,  shurjopayRequestModel: requestModel)
  { 
    shurjopayResponse in
    YOUR_CODE
  }
  • To verify payment we have to call verify().
  if(shurjopayResponse.status == true && shurjopayResponse.shurjopayOrderID != nil)
      shurjopay.verify(shurjopayOrderID: spOrderID!)
      { 
        shurjopayVerificationModel in
        YOUR_CODE
      }
  }

That's all! Now you are ready to use our shurjoPay swift package to make your payment system easy and smooth.

About

shurjopay swift package to integrate with iOS apps

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages