All Projects → iyzico → Iyzipay Php

iyzico / Iyzipay Php

Licence: mit
iyzipay api php client

Projects that are alternatives of or similar to Iyzipay Php

iyzipay-ruby
iyzipay api ruby client
Stars: ✭ 37 (-81.95%)
Mutual labels:  fintech, client-library
Iyzipay Node
iyzipay api node.js client
Stars: ✭ 116 (-43.41%)
Mutual labels:  client-library, fintech
Zvt
modular quant framework.
Stars: ✭ 1,801 (+778.54%)
Mutual labels:  fintech
Node Sparkpost
SparkPost client library for Node.js
Stars: ✭ 177 (-13.66%)
Mutual labels:  client-library
Gitlabapiclient
GitLab API client
Stars: ✭ 138 (-32.68%)
Mutual labels:  client-library
Coinbase Pro Node
Coinbase Pro API written in TypeScript and covered by tests.
Stars: ✭ 116 (-43.41%)
Mutual labels:  fintech
Rosnodejs
Client library for writing ROS nodes in JavaScript with nodejs
Stars: ✭ 145 (-29.27%)
Mutual labels:  client-library
Dash Stock Tickers Demo App
Dash Demo App - Stock Tickers
Stars: ✭ 108 (-47.32%)
Mutual labels:  fintech
Bankscrap
Ruby gem to extract balance and transactions from multiple banks.
Stars: ✭ 197 (-3.9%)
Mutual labels:  fintech
Tushare
TuShare is a utility for crawling historical data of China stocks
Stars: ✭ 11,288 (+5406.34%)
Mutual labels:  fintech
Docker Java
Java Docker API Client
Stars: ✭ 2,166 (+956.59%)
Mutual labels:  client-library
Xmlrpc
Implementation of XMLRPC protocol in Go language.
Stars: ✭ 133 (-35.12%)
Mutual labels:  client-library
Tokencaps
A middleware framework and persistence layer to aggregate and normalize crypto-currency data.
Stars: ✭ 118 (-42.44%)
Mutual labels:  fintech
Finnlp Progress
NLP progress in Fintech. A repository to track the progress in Natural Language Processing (NLP) related to the domain of Finance, including the datasets, papers, and current state-of-the-art results for the most popular tasks.
Stars: ✭ 148 (-27.8%)
Mutual labels:  fintech
Learning Blockchain
Tidy up Blockchain ecosystem and tutorial
Stars: ✭ 188 (-8.29%)
Mutual labels:  fintech
Mangopay2 Php Sdk
PHP SDK for MANGOPAY
Stars: ✭ 108 (-47.32%)
Mutual labels:  fintech
Sepa king
Ruby gem for creating SEPA XML files
Stars: ✭ 125 (-39.02%)
Mutual labels:  fintech
Finrl Library
FinRL: Financial Reinforcement Learning Framework. Please star. 🔥
Stars: ✭ 3,037 (+1381.46%)
Mutual labels:  fintech
Google Maps Services Js
Node.js client library for Google Maps API Web Services
Stars: ✭ 2,432 (+1086.34%)
Mutual labels:  client-library
Php Sparkpost
SparkPost client library for PHP
Stars: ✭ 190 (-7.32%)
Mutual labels:  client-library

iyzipay-php

Build Status Latest Stable Version Coverage Status

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

Requirements

PHP 5.3 and later.

Note

Minimum TLS v1.2 will be supported after March 2018. Please upgrade your openssl version to minimum 1.0.1. If you have any questions, please open an issue on Github or contact us at [email protected].

Installation

Composer

You can install the bindings via Composer. Run the following command:

composer require iyzico/iyzipay-php

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the IyzipayBootstrap.php file.

require_once('/path/to/iyzipay-php/IyzipayBootstrap.php');

Usage

$options = new \Iyzipay\Options();
$options->setApiKey("your api key");
$options->setSecretKey("your secret key");
$options->setBaseUrl("https://sandbox-api.iyzipay.com");
        
$request = new \Iyzipay\Request\CreatePaymentRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPrice("1");
$request->setPaidPrice("1.2");
$request->setCurrency(\Iyzipay\Model\Currency::TL);
$request->setInstallment(1);
$request->setBasketId("B67832");
$request->setPaymentChannel(\Iyzipay\Model\PaymentChannel::WEB);
$request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT);

$paymentCard = new \Iyzipay\Model\PaymentCard();
$paymentCard->setCardHolderName("John Doe");
$paymentCard->setCardNumber("5528790000000008");
$paymentCard->setExpireMonth("12");
$paymentCard->setExpireYear("2030");
$paymentCard->setCvc("123");
$paymentCard->setRegisterCard(0);
$request->setPaymentCard($paymentCard);

$buyer = new \Iyzipay\Model\Buyer();
$buyer->setId("BY789");
$buyer->setName("John");
$buyer->setSurname("Doe");
$buyer->setGsmNumber("+905350000000");
$buyer->setEmail("[email protected]");
$buyer->setIdentityNumber("74300864791");
$buyer->setLastLoginDate("2015-10-05 12:43:35");
$buyer->setRegistrationDate("2013-04-21 15:12:09");
$buyer->setRegistrationAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$buyer->setIp("85.34.78.112");
$buyer->setCity("Istanbul");
$buyer->setCountry("Turkey");
$buyer->setZipCode("34732");
$request->setBuyer($buyer);

$shippingAddress = new \Iyzipay\Model\Address();
$shippingAddress->setContactName("Jane Doe");
$shippingAddress->setCity("Istanbul");
$shippingAddress->setCountry("Turkey");
$shippingAddress->setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$shippingAddress->setZipCode("34742");
$request->setShippingAddress($shippingAddress);

$billingAddress = new \Iyzipay\Model\Address();
$billingAddress->setContactName("Jane Doe");
$billingAddress->setCity("Istanbul");
$billingAddress->setCountry("Turkey");
$billingAddress->setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$billingAddress->setZipCode("34742");
$request->setBillingAddress($billingAddress);

$basketItems = array();
$firstBasketItem = new \Iyzipay\Model\BasketItem();
$firstBasketItem->setId("BI101");
$firstBasketItem->setName("Binocular");
$firstBasketItem->setCategory1("Collectibles");
$firstBasketItem->setCategory2("Accessories");
$firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL);
$firstBasketItem->setPrice("0.3");
$basketItems[0] = $firstBasketItem;

$secondBasketItem = new \Iyzipay\Model\BasketItem();
$secondBasketItem->setId("BI102");
$secondBasketItem->setName("Game code");
$secondBasketItem->setCategory1("Game");
$secondBasketItem->setCategory2("Online Game Items");
$secondBasketItem->setItemType(\Iyzipay\Model\BasketItemType::VIRTUAL);
$secondBasketItem->setPrice("0.5");
$basketItems[1] = $secondBasketItem;

$thirdBasketItem = new \Iyzipay\Model\BasketItem();
$thirdBasketItem->setId("BI103");
$thirdBasketItem->setName("Usb");
$thirdBasketItem->setCategory1("Electronics");
$thirdBasketItem->setCategory2("Usb / Cable");
$thirdBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL);
$thirdBasketItem->setPrice("0.2");
$basketItems[2] = $thirdBasketItem;
$request->setBasketItems($basketItems);

$payment = \Iyzipay\Model\Payment::create($request, $options);

See other samples under samples directory.

Development

Install dependencies:

composer install

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)
6221060000000004 Iran

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

Mock APM Accounts

Mock APM Accounts that can be used to simulate a payment with alternative payment method:

Account Holder Name Description
success Succeeded payment after succeeded initialize
fail-after-init Failed payment after succeeded initialize
error Failed initialize

Testing

Install dependencies as mentioned above (which will resolve PHPUnit), then you can run the test suite:

./vendor/bin/phpunit

Or to run an individual test file:

./vendor/bin/phpunit tests/Iyzipay/Tests/Model/PaymentTest.php
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].