Skip to content

konfig-dev/decentro-in-collections-sdk-swift

Repository files navigation

Swift5 API client for Decentro

Collections

Overview

This API client was generated by Konfig.

Installation

CocoaPods

  1. Add source 'https://github.com/CocoaPods/Specs.git' to your Podfile
  2. Add pod 'Decentro', '~> 1.0.1' to your Podfile

Your Podfile should look like:

# Podfile
source 'https://github.com/CocoaPods/Specs.git'

target 'Example' do
  pod 'Decentro', '~> 1.0.1'
end
  1. Run pod install
❯ pod install
Analyzing dependencies
Downloading dependencies
Installing Decentro 1.0.1
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.

Getting Started

import Decentro

let apiKey = ProcessInfo.processInfo.environment["API_KEY"]!
DecentroAPI.customHeaders = [
    "client_id": apiKey,
]


let apiKey = ProcessInfo.processInfo.environment["API_KEY"]!
DecentroAPI.customHeaders = [
    "client_secret": apiKey,
]


let apiKey = ProcessInfo.processInfo.environment["API_KEY"]!
DecentroAPI.customHeaders = [
    "module_secret": apiKey,
]


let apiKey = ProcessInfo.processInfo.environment["API_KEY"]!
DecentroAPI.customHeaders = [
    "provider_secret": apiKey,
]


let generatePaymentLinkRequest = GeneratePaymentLinkRequest(referenceId: "referenceId_example", payeeAccount: "payeeAccount_example", amount: 123, purposeMessage: "purposeMessage_example", generateQr: 123, expiryTime: 123, customizedQrWithLogo: 123, generateUri: 123) // GeneratePaymentLinkRequest | 

// Generate payment link
CollectionsAPI.generatePaymentLink(generatePaymentLinkRequest: generatePaymentLinkRequest) { (response, error) in
    guard error == nil else {
        print(error!)
        return
    }

    if response != nil {
        dump(response)
    }
}

API Endpoints

All URIs are relative to https://in.staging.decentro.tech

Class Method HTTP request Description
CollectionsAPI generatePaymentLink POST /v2/payments/upi/link Generate payment link
CollectionsAPI getTransactionStatus GET /v2/payments/transaction/{transaction_id}/status Get transaction status
CollectionsAPI issueCollectRequest POST /v2/payments/collection Issue collect request
CollectionsAPI issueUpiRefund POST /v2/payments/upi/refund Issue UPI Refund
CollectionsAPI validateUpiHandle POST /v2/payments/vpa/validate Validate UPI handle

Models

Authorization

client_id

  • Type: API key
  • API key parameter name: client_id
  • Location: HTTP header
import Decentro


let apiKey = ProcessInfo.processInfo.environment["API_KEY"]!
DecentroAPI.customHeaders = [
    "client_id": apiKey,
]

client_secret

  • Type: API key
  • API key parameter name: client_secret
  • Location: HTTP header
import Decentro


let apiKey = ProcessInfo.processInfo.environment["API_KEY"]!
DecentroAPI.customHeaders = [
    "client_secret": apiKey,
]

module_secret

  • Type: API key
  • API key parameter name: module_secret
  • Location: HTTP header
import Decentro


let apiKey = ProcessInfo.processInfo.environment["API_KEY"]!
DecentroAPI.customHeaders = [
    "module_secret": apiKey,
]

provider_secret

  • Type: API key
  • API key parameter name: provider_secret
  • Location: HTTP header
import Decentro


let apiKey = ProcessInfo.processInfo.environment["API_KEY"]!
DecentroAPI.customHeaders = [
    "provider_secret": apiKey,
]

About

Swift SDK for decentro-in collections API

Resources

Stars

Watchers

Forks

Packages

No packages published