Official shurjoPay iOS swift plugin for merchants or service providers to connect with shurjoPay Payment Gateway v1.1.0
developed and maintained by ShurjoMukhi Limited.
This plugin can be used with iOS swift application.
Also it makes easy for developers to integrate with shurjoPay v1.1.0
with calling three methods only:
- makePayment: create and send payment request
- onSuccess: successfully payment completed at shurjoPay
- onFailed: failed payment in shurjoPay
Also reduces many of the things that you had to do manually:
- Handles http request and errors.
- JSON serialization and deserialization.
- Authentication during initiating and verifying of payments.
This document is intended for the technical personnel of merchants and service providers who wants to integrate our online payment gateway using iOS swift plugin provided by shurjoMukhi Limited.
To integrate the shurjoPay Payment Gateway in your iOS swift project do the following tasks sequentially.
Pod
- Close the Xcode project
- Open the terminal
- cd /your project path
pod init
pod "ShurjoPaySDKV2", '~> 1.1.0
pod install
- Open "your project.xcworkspace" file
// Initialize shurjopay
import ShurjopaySdk
// Prepare payment request to initiate payment
let requestData = RequestData(
username: "username",
password: "password",
prefix: "prefix",
currency: "currency",
amount: 0,
orderId: "orderId",
discountAmount: 0,
discPercent: 0,
customerName: "customerName",
customerPhone: "customerPhone",
customerEmail: "customerEmail",
customerAddress: "customerAddress",
customerCity: "customerCity",
customerState: "customerState",
customerPostcode: "customerPostcode",
customerCountry: "customerCountry",
returnUrl: "returnUrl",
cancelUrl: "cancelUrl",
clientIp: "clientIp",
value1: "value1",
value2: "value2",
value3: "value3",
value4: "value4"
)
// Calls first method to initiate a payment
shurjopaySdk = ShurjopaySdk(onSuccess: onSuccess, onFailed: onFailed)
shurjopaySdk?.makePayment(
uiProperty: UIProperty(viewController: self,
storyboardName: "Main",
identifier: "sPayViewController"),
sdkType: AppConstants.SDK_TYPE_SANDBOX,
requestData: requestData
)
- Call success method
func onSuccess(transactionData: TransactionData?, message: ErrorSuccess) {
if(message.esType == ErrorSuccess.ESType.INTERNET_SUCCESS) {
print("DEBUG_LOG_PRINT: INTERNET SUCCESS \(String(describing: message.message))")
} else {
print("DEBUG_LOG_PRINT: HTTP SUCCESS TRANSACTION_DATA: \(String(describing: transactionData)) \(String(describing: message.message))")
}
}
- Call falid method
func onFailed(message: ErrorSuccess) {
if(message.esType == ErrorSuccess.ESType.INTERNET_ERROR) {
print("DEBUG_LOG_PRINT: INTERNET ERROR \(String(describing: message.message))")
//alertService.alert(viewController: self, message: message.message!)
} else {
print("DEBUG_LOG_PRINT: HTTP ERROR \(String(describing: message.message))")
}
}
Run the JUnit test to see shurjopay plugin in action. These tests will run on selenium browser and will provide the complete experience. Just download source and run the command mvnw.cmd test
in Windows and ./mvnw test
in Linux from plugin root path.
- iOS swift example application showing usage of the iOS swift plugin.
- Sample applications and projects in many different languages and frameworks showing shurjopay integration.
- shurjoPay Postman site illustrating the request and response flow using the sandbox system.
- shurjopay Plugins home page on github
This code is under the MIT open source License.
Please contact with shurjoPay team for more detail!
Copyright ©️2022 Shurjomukhi Limited.