Cashfree.IOS.Payment.SDK
1.0.0
dotnet add package Cashfree.IOS.Payment.SDK --version 1.0.0
NuGet\Install-Package Cashfree.IOS.Payment.SDK -Version 1.0.0
<PackageReference Include="Cashfree.IOS.Payment.SDK" Version="1.0.0" />
paket add Cashfree.IOS.Payment.SDK --version 1.0.0
#r "nuget: Cashfree.IOS.Payment.SDK, 1.0.0"
// Install Cashfree.IOS.Payment.SDK as a Cake Addin #addin nuget:?package=Cashfree.IOS.Payment.SDK&version=1.0.0 // Install Cashfree.IOS.Payment.SDK as a Cake Tool #tool nuget:?package=Cashfree.IOS.Payment.SDK&version=1.0.0
Xamarin IOS SDK
The Cashfree Xamarin IOS SDK allows you to integrate Cashfree Payment Gateway into your application and start collecting payments from your customers.
The Cashfree SDK has been designed to minimise the complexity of handling and integrating payments in your application. The Cashfree Xamarin IOS SDK is available at the Nuget Gallery as a Nuget package.
Integration Steps
To integrate Cashfree Xamarin IOS SDK with your IOS application,
- Create an account with Cashfree and get the API keys.
- Integrate the Cashfree SDK into your application.
- Generate Token (From Backend)4. Initiate payment - Invoke a payment API from the Cashfree SDK with the token generated when the customer initiates payment for an order from your application. Cashfree SDK displays appropriate screens to the customer for the payment.
- Receive and handle response - Cashfree SDK returns the payment result for the order which should be handled in your application.
- Verify response - We recommend you to verify the payment response using webhooks and by checking the signature value returned in the payment response.
Initiate Payment
After generating the order token, the payment gets initiated when CFPaymentService().DoWebCheckoutPaymentWithParams()
is invoked.
For payment, your application passes the order info and the cftoken to the SDK. The relevant payment screen is displayed to the customer where they enter the required information and make the payment. After the payment is complete the customers are redirected to the IOS application and response is received on ResultDelegate.OnPaymentCompletionWithMsg()
NOTE: The order details passed during the token generation and the payment initiation should match. Else, you will get an
Invalid order details
error. Wrong appId and token will result inUnable to authenticate merchant
error. The token generated for payment is valid for 5 minutes within which the payment has to be initiated. Else, you will get anInvalid token
error.
Receive and Handle Response
After the payment is complete you will receive the response on the ResultDelegate.OnPaymentCompletionWithMsg()
function of the invoking class.
public override void OnPaymentCompletionWithMsg(string msg)
{
//call your function here.
func.Invoke(msg);
}
Web Checkout
Web Checkout is the standard flow for Cashfree IOS SDK. In this flow, the SDK loads a webview which will render the payment page. The customer can fill the required payment details here and complete the payment. The Web Checkout can be used in two ways:-
- Web Checkout with Cashfree UI: Customer selects the payment mode and enters the payment details within the Cashfree's web payment page to complete the payment
- Seamless Web Checkout: Customer selects the payment mode and enters payment details in your application. These details are then passed on to the Cashfree SDK. Webview is launched only for scenarios like the two-factor authentication.
NOTE: Web checkout supports payment through Google pay, Amazon pay, PhonePe and UPI payment modes.
Web Checkout Using Cashfree UI
Web checkout uses webview to process payment hence the name. For both Web Checkout and Seamless Web Checkout you need to call CFPaymentService().DoWebCheckoutPaymentWithParams()
.
However, there are a few extra parameters you need to pass for seamless integration method.
DoPayment:
Add this package in your class.
using Com.Cashfree.PG;
DoWebCheckoutPaymentWithParams (NSDictionary<NSString, NSObject> Params, string Environment, ResultDelegate Callback);
Starts the web checkout. The customer will be taken to the payment page on the Cashfree server where they have the option to pay through any payment option that is activated on their account. Once the payment is done the webview will close and the response will be delivered in the ResultDelegate.OnPaymentCompletionWithMsg()
.
Parameters:
- Params: A map of all the relevant parameters described here
- Environment: Value should be either "TEST" for testing server, or "PROD" for production server respectively.
- Callback: ResultDelegate implementation for handling the sdk response.
Example:
new CFPaymentService().DoWebCheckoutPaymentWithParams(Params, Environment, Callback);
Seamless Integration
When you have a requirement for a customised payment flow, you can use the seamless integration. You can implement the payment page as per your requirement and then use our SDK to authorise the payment. Once the payment details are collected the OTP or the two-factor authentication page will open in a webview. After the payment is confirmed the webview closes and you will receive a response. Click here for more info.
Request and Response Parameters
Click here for request and response parameters.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
Xamarin.iOS | xamarinios10 is compatible. |
-
Xamarin.iOS 1.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 1,640 | 10/25/2020 |