All Projects → Milvasoft → Milvasoft.Iyzipay

Milvasoft / Milvasoft.Iyzipay

Licence: MIT license
Iyzico client for .Net 6

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Milvasoft.Iyzipay

iyzipay-ruby
iyzipay api ruby client
Stars: ✭ 37 (+146.67%)
Mutual labels:  iyzico, client-library, iyzipay
iyzipay-dotnet-client
iyzipay api .net framework and .net core client
Stars: ✭ 30 (+100%)
Mutual labels:  iyzico, client-library, iyzipay
iyzipay-laravel
iyzipay api integration for Laravel
Stars: ✭ 82 (+446.67%)
Mutual labels:  iyzico, iyzipay
cybersource-sdk-java
Java SDK for CyberSource Simple Order API
Stars: ✭ 44 (+193.33%)
Mutual labels:  payment, payment-service
cybersource-android-sdk
The CyberSource InApp SDK enables developers to simply and securely incorporate mobile payments into their Android applications.
Stars: ✭ 25 (+66.67%)
Mutual labels:  payment, payment-service
jsonapi
(Official) Saferpay JSON API documentation, help and examples.
Stars: ✭ 22 (+46.67%)
Mutual labels:  payment
adyen-node-api-library
Adyen API Library for Node.js
Stars: ✭ 82 (+446.67%)
Mutual labels:  payment
omnipay-unionpay
UnionPay driver for the Omnipay PHP payment processing library
Stars: ✭ 111 (+640%)
Mutual labels:  payment
react-native-cafe-bazaar
In-App billing for Cafe Bazaar (local android market)
Stars: ✭ 26 (+73.33%)
Mutual labels:  payment
django-proxypay
Django Proxypay is a Django Framework application/library that facilitates the integration of your Django project with the Proxypay API.
Stars: ✭ 14 (-6.67%)
Mutual labels:  payment
adyen-android
Adyen SDK for Android
Stars: ✭ 89 (+493.33%)
Mutual labels:  payment
payment-logos
💳 High quality vector images for your payment solutions.
Stars: ✭ 52 (+246.67%)
Mutual labels:  payment
goql
A GraphQL client package written in Go.
Stars: ✭ 17 (+13.33%)
Mutual labels:  client-library
laravel-pix
Uma solucão simples para integrar sua aplicação Laravel a API PIX do Banco Central do Brasil
Stars: ✭ 73 (+386.67%)
Mutual labels:  payment
uniteller-php-sdk
PHP (7.2+) SDK for integration internet-acquiring of the Uniteller (unofficial)
Stars: ✭ 21 (+40%)
Mutual labels:  payment
Offline
[READ-ONLY] Subtree split of the Payum Offline Component -- clone into Payum/Offline/ (master at payum/payum)
Stars: ✭ 25 (+66.67%)
Mutual labels:  payment
node-meraki-dashboard
A modern node.js client library for using the Meraki Dashboard API.
Stars: ✭ 20 (+33.33%)
Mutual labels:  client-library
SyliusMolliePlugin
Sylius Mollie payment gateway integration.
Stars: ✭ 1 (-93.33%)
Mutual labels:  payment
govpp
Go toolset for the VPP.
Stars: ✭ 119 (+693.33%)
Mutual labels:  client-library
react-native-payumoney
React Native Payumoney (Android/IOS)
Stars: ✭ 18 (+20%)
Mutual labels:  payment

Milvasoft.Iyzipay Library For .Net 6

NuGet

NuGet

Unofficial Iyzipay client library that is maintained by Milvasoft, a fork of the iyzipay-dotnet

All methods have been rearranged to use async await.

The dispose pattern has been implemented in the class where the request was sent. This class can be disposed according to optional usage. The HttpRequestMessage and HttpResponse message objects created in each request were disposed of as a result of the request.

Required dependency injection operations in Iyzico API integration have been adapted to the .net core structure.

Supports .Net 6.0

You can sign up for an iyzico account at https://iyzico.com

Requirements

One of the runtime environment is required from below

  • .NET 6.0

Installation

For now you'll need to install following libraries:

  • To install Milvasoft.Iyzipay, run the following command in the Package Manager Console
Install-Package Milvasoft.Iyzipay

Or you can download the latest .dll from Github

Milvasoft.Iyzipay Usage

In Startup.cs;

...
	    
 services.AddIyzicoIntegration(i =>
 {
     i.ApiKey = "your api key";
     i.SecretKey = "your secret key";
     i.BaseUrl = "https://sandbox-api.iyzipay.com";
     i.RestHttpClientLifeTime = ServiceLifetime.Transient;
     i.RestHttpClientV2LifeTime = ServiceLifetime.Transient;
 });

...

Sample use;

        
using Milvasoft.Iyzipay.Model;
using Milvasoft.Iyzipay.Request;
using Milvasoft.Iyzipay.Utils.Abstract;

private readonly IRestHttpClient _restHttpClient;

public PaymentController(IRestHttpClient restHttpClient)
{
    _restHttpClient = restHttpClient;
}

public async Task<IActionResult> CancelPaymentAsync()
{
    CreateCancelRequest request = new()
    {
        ConversationId = "123456789",
        Locale = Locale.TR.ToString(),
        PaymentId = "1",
        Ip = "85.34.78.112"
    };
    
    var cancel = new Cancel(_restHttpClient);
    
    cancel = await cancel.CreateAsync(request).ConfigureAwait(false);
    
    _restHttpClient.Dispose();
    
    if (cancel.Status == Status.SUCCESS.ToString())
        return Ok();
    else
        return BadRequest();
}

Or you can use like official Iyzipay library;

IOptions options = new Options
{
   ApiKey = "your api key",
   SecretKey = "your secret key",
   BaseUrl = "https://sandbox-api.iyzipay.com"
}
		
CreatePaymentRequest request = new();
request.Locale = Locale.TR.ToString();
request.ConversationId = "123456789";
request.Price = "1";
request.PaidPrice = "1.2";
request.Currency = Currency.TRY.ToString();
request.Installment = 1;
request.BasketId = "B67832";
request.PaymentChannel = PaymentChannel.WEB.ToString();
request.PaymentGroup = PaymentGroup.PRODUCT.ToString();

PaymentCard paymentCard = new();
paymentCard.CardHolderName = "John Doe";
paymentCard.CardNumber = "5528790000000008";
paymentCard.ExpireMonth = "12";
paymentCard.ExpireYear = "2030";
paymentCard.Cvc = "123";
paymentCard.RegisterCard = 0;
request.PaymentCard = paymentCard;

Buyer buyer = new();
buyer.Id = "BY789";
buyer.Name = "John";
buyer.Surname = "Doe";
buyer.GsmNumber = "+905350000000";
buyer.Email = "[email protected]";
buyer.IdentityNumber = "74300864791";
buyer.LastLoginDate = "2015-10-05 12:43:35";
buyer.RegistrationDate = "2013-04-21 15:12:09";
buyer.RegistrationAddress = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
buyer.Ip = "85.34.78.112";
buyer.City = "Istanbul";
buyer.Country = "Turkey";
buyer.ZipCode = "34732";
request.Buyer = buyer;

Address shippingAddress = new();
shippingAddress.ContactName = "Jane Doe";
shippingAddress.City = "Istanbul";
shippingAddress.Country = "Turkey";
shippingAddress.Description = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
shippingAddress.ZipCode = "34742";
request.ShippingAddress = shippingAddress;

Address billingAddress = new();
billingAddress.ContactName = "Jane Doe";
billingAddress.City = "Istanbul";
billingAddress.Country = "Turkey";
billingAddress.Description = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
billingAddress.ZipCode = "34742";
request.BillingAddress = billingAddress;

List<BasketItem> basketItems = new();
BasketItem firstBasketItem = new();
firstBasketItem.Id = "BI101";
firstBasketItem.Name = "Binocular";
firstBasketItem.Category1 = "Collectibles";
firstBasketItem.Category2 = "Accessories";
firstBasketItem.ItemType = BasketItemType.PHYSICAL.ToString();
firstBasketItem.Price = "0.3";
basketItems.Add(firstBasketItem);

BasketItem secondBasketItem = new();
secondBasketItem.Id = "BI102";
secondBasketItem.Name = "Game code";
secondBasketItem.Category1 = "Game";
secondBasketItem.Category2 = "Online Game Items";
secondBasketItem.ItemType = BasketItemType.VIRTUAL.ToString();
secondBasketItem.Price = "0.5";
basketItems.Add(secondBasketItem);

BasketItem thirdBasketItem = new();
thirdBasketItem.Id = "BI103";
thirdBasketItem.Name = "Usb";
thirdBasketItem.Category1 = "Electronics";
thirdBasketItem.Category2 = "Usb / Cable";
thirdBasketItem.ItemType = BasketItemType.PHYSICAL.ToString();
thirdBasketItem.Price = "0.2";
basketItems.Add(thirdBasketItem);
request.BasketItems = basketItems;

var client = new RequestHttpClient(new HttpClient(),options);

var payment = new Payment(client);

payment = await payment.CreateAsync(request).ConfigureAwait(false);

client.Dispose();

See other samples under Milvasoft.Iyzipay.Samples project.

Testing

You can run particular sample by passing your credential info to "Milvasoft.Iyzipay.Samples/Sample.cs"

Mock test cards

Test cards that can be used to simulate a successful payment:

Card Number Bank Card Type
5890040000000016 Akbank Master Card (Debit)
5526080000000006 Akbank Master Card (Credit)
4766620000000001 Denizbank Visa (Debit)
4603450000000000 Denizbank Visa (Credit)
4729150000000005 Denizbank Bonus Visa (Credit)
4987490000000002 Finansbank Visa (Debit)
5311570000000005 Finansbank Master Card (Credit)
9792020000000001 Finansbank Troy (Debit)
9792030000000000 Finansbank Troy (Credit)
5170410000000004 Garanti Bankası Master Card (Debit)
5400360000000003 Garanti Bankası Master Card (Credit)
374427000000003 Garanti Bankası American Express
4475050000000003 Halkbank Visa (Debit)
5528790000000008 Halkbank Master Card (Credit)
4059030000000009 HSBC Bank Visa (Debit)
5504720000000003 HSBC Bank Master Card (Credit)
5892830000000000 Türkiye İş Bankası Master Card (Debit)
4543590000000006 Türkiye İş Bankası Visa (Credit)
4910050000000006 Vakıfbank Visa (Debit)
4157920000000002 Vakıfbank Visa (Credit)
5168880000000002 Yapı ve Kredi Bankası Master Card (Debit)
5451030000000000 Yapı ve Kredi Bankası Master Card (Credit)

Cross border test cards:

Card Number Country
4054180000000007 Non-Turkish (Debit)
5400010000000004 Non-Turkish (Credit)

Test cards to get specific error codes:

Card Number Description
5406670000000009 Success but cannot be cancelled, refund or post auth
4111111111111129 Not sufficient funds
4129111111111111 Do not honour
4128111111111112 Invalid transaction
4127111111111113 Lost card
4126111111111114 Stolen card
4125111111111115 Expired card
4124111111111116 Invalid cvc2
4123111111111117 Not permitted to card holder
4122111111111118 Not permitted to terminal
4121111111111119 Fraud suspect
4120111111111110 Pickup card
4130111111111118 General error
4131111111111117 Success but mdStatus is 0
4141111111111115 Success but mdStatus is 4
4151111111111112 3dsecure initialize failed
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].