Import iPayy SDK

In Visual Studio, right click your project and click Manage NuGet Packages. In the search box, enter iPayy, select iPayy from the results and click install.

Make sure you have NuGet Package Manager 2.1 or newer installed in Visual Studio. Update if needed (Tools -> Extensions and Updates)

Setting up the SDK

Prerequisites for Windows Phone 8.0 Applications

Before you start using the SDK on Windows Phone projects, please make sure that the ID_CAP_NETWORKING and ID_CAP_WEBBROWSERCOMPONENT capability is checked in your application’s WMAppManifest.xml file.

Prerequisites for Windows 8.1 Applications

Important: Before you start using the SDK on Windows 8.1 projects, please make sure that you add http://*.ipayy.com to the “Content URIs” section in the Package.appxmanifest file. This is required to allow the payment website to communicate with the SDK. The SDK will not work correctly if this rule is not added. This is only needed for applications targeted for Windows 8.1.

Using the SDK

Pre-requisites before you start coding :-

  • A Merchant Key and an Application Key for your application
  • Some White-listed numbers for testing
  • The necessary project references imported

Create Payment object

Subscribe to the PaymentCompletedEventHandler event

Call the Charge method to initiate the payment

Receive the payment result

PaymentCompletedEventArgs has the following properties which can help you understand more about the payment:

Property NameDescription
PaymentStatusCurrent status of the payment. Pending, Success or Failure
AmountChargedActual amount charged.
CustomerCodeUnique customer code (per customer) from iPayy
RequestTokenRequest token id
TransactionDateTransaction timestamp (in milliseconds)
TransactionIdTransaction Id from iPayy
FailureReasonReason for failure: None UserCancel SessionTimeOut TooManyFailures LowBalance InvalidOperatorSelected Fraud NetworkFailure Other
ErrorCodeError Code as returned from iPayy Server. Refer error codes document.
ErrorMessageVerbose error message mapping to error code

Cancel the back key press (For Windows Phone 8)(Optional)