Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ok complete #195

Merged
merged 110 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
759b7ea
PHP version update
osman-keser Mar 4, 2024
b58c64c
Card Blacklist services & tests
osman-keser Mar 12, 2024
d0dafba
iyziLink Ccreate Product service upgrade complete, FastLink with 404 …
osman-keser Mar 12, 2024
d732662
IyziLink FastLink create complete
osman-keser Mar 13, 2024
8fe8cf8
IyziLink Update Product Status Complete
osman-keser Mar 13, 2024
d8c9827
requestToStringQuery type update
osman-keser Mar 14, 2024
db6f326
IyziLink / Search Merchant Products complete
osman-keser Mar 14, 2024
b7e557e
PHP version update
osman-keser Mar 14, 2024
e805bb1
Create C2C Submerchant complete
osman-keser Mar 14, 2024
108e5ce
Verify C2C Submerchant complete
osman-keser Mar 14, 2024
120cb29
Create & Verify C2C Submerchant tests complete
osman-keser Mar 14, 2024
35122ce
create function return type added
osman-keser Mar 14, 2024
ab7d1ac
Minor type fixes
osman-keser Mar 16, 2024
f827aab
Amount Bsee Refund Services & sample complete
osman-keser Mar 16, 2024
0e43e7a
Amount Base Refund tests complete
osman-keser Mar 16, 2024
c6e2c4e
PlusInstallment: Create Payment service complete
osman-keser Mar 18, 2024
e876417
PlusInstallment: Create Payment sample & tests complete
osman-keser Mar 18, 2024
5328d95
Base model updates
osman-keser Mar 18, 2024
e8b3902
Mail address change
osman-keser Mar 18, 2024
10f00aa
Merge branch 'ok-new-version' into ok-plus-installment
osman-keser Mar 18, 2024
a4b08ee
getHttpHeadersV2 function params update
osman-keser Mar 18, 2024
ae6fbae
Merge branch 'ok-new-version' into ok-payment-services
osman-keser Mar 18, 2024
8486c3f
Merge branch 'ok-new-version' into ok-marketplace-c2c
osman-keser Mar 18, 2024
d1f72d5
Merge branch 'ok-new-version' into ok-iyzilink
osman-keser Mar 18, 2024
3dd0b2f
Merge branch 'ok-new-version' into ok-blacklisted-card
osman-keser Mar 18, 2024
6ae7a29
reportingScrollTransaction type added
osman-keser Mar 18, 2024
de2009c
Reporting: Scroll Transaction Reporting service complete
osman-keser Mar 18, 2024
0a3c3d1
Reporting: Scroll Transaction Reporting sample & tests complete
osman-keser Mar 18, 2024
fbe6008
Subscription List service partially complete with date format error.
osman-keser Mar 19, 2024
02c73a7
Subscription List sample & tests complete
osman-keser Mar 19, 2024
1aa5cd8
Uncommented lines
osman-keser Mar 19, 2024
d152707
Subscription: Delete Customer service complete
osman-keser Mar 19, 2024
52addf2
Subscription: Delete Customer sample & tests complete
osman-keser Mar 19, 2024
024211f
Date filters format fix
osman-keser Mar 21, 2024
56b85d5
sms verification code encryption for verify endpoint complete
osman-keser Mar 25, 2024
fe1e0ef
payload uri re-structured for v2 headers
osman-keser Jul 3, 2024
d94e0ce
signature verification function implemented
osman-keser Jul 3, 2024
901e10a
CheckoutFormInitialize service updated to v2 headers
osman-keser Jul 3, 2024
441baf5
Removed unused line
osman-keser Jul 4, 2024
f1b1275
Function updated to reflect params order variations
osman-keser Jul 4, 2024
45ca8d3
Added signature verification sample codes
osman-keser Jul 4, 2024
c54bde4
BKM Initialize service updated with v2 headers along with signature v…
osman-keser Jul 4, 2024
d5957a3
CheckoutForm Retrieve service updated to v2 Headers
osman-keser Jul 4, 2024
2a1820f
BKM Retrieve service updated to v2 headers
osman-keser Jul 4, 2024
2712c5c
Payment Service Initialize 3D Payment updated to v2 headers
osman-keser Jul 4, 2024
d3f1041
Payment Service Create 3D Payment updated to v2 headers
osman-keser Jul 4, 2024
7e7a703
Payment Service Create Non3D Payment updated to v2 headers
osman-keser Jul 4, 2024
48384ed
Payment Service Retrieve Payment Result updated to v2 headers
osman-keser Jul 4, 2024
21d4ccb
Cleanup
osman-keser Jul 4, 2024
dfca036
Provision Service Create Non3D Preauth updated to v2 headers along wi…
osman-keser Jul 4, 2024
201a141
Provision Service Initialize 3D Preatuh updated to v2 headers along w…
osman-keser Jul 4, 2024
d233904
Provision Service Initialize CheckoutForm Preauth updated to v2 heade…
osman-keser Jul 4, 2024
636ee54
Provision Service Create PostAuth updated to v2 headers along with a …
osman-keser Jul 4, 2024
a56b853
PWI Services Initialize updated to v2 headers
osman-keser Jul 4, 2024
0ecdbd0
Cleanup
osman-keser Jul 4, 2024
dcf40af
PWI Services Retrieve updated to v2 headers
osman-keser Jul 4, 2024
c1da4f0
removed used token
osman-keser Jul 4, 2024
406569d
AUTHORIZATION_FALLBACK_HEADER added to v2 headers
osman-keser Jul 4, 2024
9b75264
APM Service Initialize & Retrieve updated to v2 headers
osman-keser Jul 4, 2024
664ee76
Merge branch 'ok-blacklisted-card' into ok-complete
osman-keser Jul 25, 2024
ec014a8
Merge branch 'ok-iyzilink' into ok-complete
osman-keser Jul 25, 2024
19cde59
Merge branch 'ok-marketplace-c2c' into ok-complete
osman-keser Jul 25, 2024
f88c951
Merge branch 'ok-payment-services' into ok-complete
osman-keser Jul 25, 2024
e41b37e
Merge branch 'ok-plus-installment' into ok-complete
osman-keser Jul 25, 2024
4403ad3
Merge branch 'ok-reporting' into ok-complete
osman-keser Jul 25, 2024
107539b
Merge branch 'ok-subscription' into ok-complete
osman-keser Jul 25, 2024
9bc4c87
Updated Service in sample file
osman-keser Jul 25, 2024
8e3243b
Signature verification test codes added
osman-keser Jul 25, 2024
7c174c5
Signature field moved to Resource file
osman-keser Jul 25, 2024
63551db
paymentId field added into request and sample file
osman-keser Jul 25, 2024
dca7a88
sample file create_threads_preauth renamed to initialize_checkoutform…
osman-keser Jul 25, 2024
8661212
Loyalty/Inquire service updated to v2 headers
osman-keser Jul 25, 2024
012978c
Marketplace Services updated to v2 headers
osman-keser Jul 25, 2024
20d2323
Marketplace C2C Services updated to v2 headers
osman-keser Jul 25, 2024
b0e1759
Payment Services updated to v2 headers
osman-keser Jul 25, 2024
890a713
PlusInstallment Service updated to v2 headers
osman-keser Jul 25, 2024
9931a14
Reporting Service updated to v2 headers
osman-keser Jul 25, 2024
a6e6dec
Card Register Service updated to v2 headers
osman-keser Jul 25, 2024
484c87f
Card BlackList Service updated to v2 headers
osman-keser Jul 25, 2024
01099be
Payment & iyziUp Services updated to v2 headers
osman-keser Jul 25, 2024
fe663e4
PaymentPreAuth Retrieve updated to v2 headers along with a signature …
osman-keser Jul 25, 2024
2f4f816
iyziUp Form Services updated to v2 headers
osman-keser Jul 25, 2024
56b5a27
installmentHtml Service updated to v2 headers
osman-keser Jul 25, 2024
5d52433
Crossbooking Services updated to v2 headers
osman-keser Jul 25, 2024
531ff19
Payment Services updated to v2 headers
osman-keser Jul 25, 2024
5fb41a6
callbackUrl & webhook signature validation files added to samples folder
osman-keser Jul 25, 2024
cb26221
Variable name fixes
osman-keser Aug 3, 2024
6fe12ae
chore: Update IyziAuthV2Generator.php and AmountBaseRefund.php
tarikkamat Aug 23, 2024
5047cf9
chore: Update .gitignore to exclude index.php file
tarikkamat Aug 23, 2024
0fd08c6
gitignore updated
tarikkamat Sep 5, 2024
2412d34
ReportingPaymentDetailRequest bug fix
tarikkamat Sep 5, 2024
6c5850b
amount_base_refund uri bug fix
tarikkamat Sep 10, 2024
7277431
getHttpHeadersIsV2 method added
tarikkamat Sep 16, 2024
8f741bb
Remove test.php file
tarikkamat Sep 16, 2024
4e25be6
ucs_init.php print_r fixed
tarikkamat Sep 16, 2024
d6438c7
getHttpHeadersV2 to getHttpHeadersIsV2
tarikkamat Sep 16, 2024
8f8b2ec
Refactor ThreedsPayment::retrieve method to use getHttpHeadersV2 for …
tarikkamat Sep 17, 2024
8499966
Refactor ThreedsPayment::retrieve method to use getHttpHeadersV2 for …
tarikkamat Sep 17, 2024
b932605
Update github_pull_request.yml
erdemdmr Sep 17, 2024
849bfaa
Update PHP version requirement to 7.4 and later
tarikkamat Sep 17, 2024
dc47036
Update github_pull_request.yml
erdemdmr Sep 17, 2024
fb6b82e
Merge branch 'ok-complete' of https://github.com/iyzico/iyzipay-php i…
tarikkamat Sep 17, 2024
36ecc1f
Update PHPUnit version requirement to 5.4.*
tarikkamat Sep 17, 2024
2f74734
Update PHPUnit version requirement to ~9.6
tarikkamat Sep 17, 2024
617f976
FileBase64Encoder rename FileBase64EncoderTest
tarikkamat Sep 17, 2024
3750b81
Refactor test classes to extend TestCase
tarikkamat Sep 17, 2024
16d3956
Ok fixes (#196)
erdemdmr Sep 23, 2024
ea9b422
Ok fixes (#197)
SKMan Sep 23, 2024
81b3b04
Ok fixes (#198)
SKMan Sep 23, 2024
c1dcbe4
Ok fixes (#200)
SKMan Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ build/
composer.lock
composer.phar
vendor/*

.phpunit.result.cache

# PHPFiles
index.php

# VSCode
.vscode

# SonarQube
.scannerwork
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
}
],
"require": {
"php": ">=5.3.0",
"php": ">=7.4.0",
"ext-curl": "*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpunit/phpunit": "~9.6",
"satooshi/php-coveralls": "~0.6.1"
},
"autoload": {
Expand Down
17 changes: 17 additions & 0 deletions samples/amount_base_refund.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

require_once('config.php');

function amountBaseRefund(): void {
$request = new \Iyzipay\Request\AmountBaseRefundRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId('123456789');
$request->setPaymentId('2921546163');
$request->setPrice(3.12);
$request->setIp('85.34.78.112');

$amountBaseRefund = \Iyzipay\Model\AmountBaseRefund::create($request, Config::options());
print_r($amountBaseRefund);
}

amountBaseRefund();
50 changes: 50 additions & 0 deletions samples/callbackUrl_Signature_Validation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

/* You can verify the request using the method below */

$secretKey = "merchant_secret_key";
$conversationData = "conversationData_from_callbackUrl";
$conversationId = "conversationId_from_callbackUrl";
$mdStatus = "mdStatus_from_callbackUrl";
$paymentId = "paymentId_from_callbackUrl";
$status = "status_from_callbackUrl";

$dataToSign = $conversationData.":".$conversationId.":".$mdStatus.":".$paymentId.":".$status ;
$hmac256Signature = bin2hex(hash_hmac('sha256', $dataToSign, $secretKey, true));

$signature = "signature_from_callbackUrl_payload";

if ($hmac256Signature == $signature) {
echo "HMAC-SHA256 Signature Verified: " . $hmac256Signature . "\n";
echo "Enjoy your code...";
} else {
echo "Signature verification failed.\n";
}


/*
* Sample Signature Calculation
*
* Payload: status=success&paymentId=22484292&conversationData=&conversationId=&mdStatus
* =1&signature=a4f73b80bb32a6ef8358090bbd8609a49a7b53f463048f8ef147496e236d04f0
*
* $secretKey = "jLc7GQHD2pyJoqXDeEcTnGHYtP7Ai5jl";
* $conversationData = "";
* $conversationId = "";
* $mdStatus = "1";
* $paymentId = "22484292";
* $status = "success";
*
* $signature = "a4f73b80bb32a6ef8358090bbd8609a49a7b53f463048f8ef147496e236d04f0";
*
* $dataToSign = "::1:22484292:success";
*
* After hashing string with secretKey
* $hmac256Signature = "a4f73b80bb32a6ef8358090bbd8609a49a7b53f463048f8ef147496e236d04f0";
*
* $hmac256Signature is equal to $signature so the request validated.
*/



?>
16 changes: 16 additions & 0 deletions samples/create_blacklisted_card.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

require_once('config.php');

function createBlacklistedCard() {
$request = new \Iyzipay\Request\CreateBlackListedCardRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setCardToken('G7Zzo5Y24cxwaIwC4h+jUJXtqTA=');
$request->setCardUserKey('ew9hzoujBUJgOUer8st0ler0dOQ=');

$blacklistedCard = \Iyzipay\Model\BlacklistedCard::create($request, Config::options());
print_r($blacklistedCard);
}

createBlacklistedCard();
22 changes: 22 additions & 0 deletions samples/create_c2c_sub_merchant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once('config.php');

function createC2CSubMerchant(): void {
$request = new \Iyzipay\Request\CreateC2CSubMerchantRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId('299487456');
$request->setName('John');
$request->setSurname('Doe');
$request->setEmail('[email protected]');
$request->setGsmNumber('+905558001479');
$request->setTckNo('55555555555');
$request->setBirthDate('1996-10-07');
$request->setAddress('Besiktas / Istanbul');
$request->setExternalId('ccd74b86-e4a8-469e-b3d3-312f0544ea6e');

$c2cSubMerchant = \Iyzipay\Model\C2CSubMerchant::create($request, Config::options());
print_r($c2cSubMerchant);
}

createC2CSubMerchant();
16 changes: 15 additions & 1 deletion samples/create_payment.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

require_once('config.php');
require_once('signature_verification.php');

# create request class
$request = new \Iyzipay\Request\CreatePaymentRequest();
Expand Down Expand Up @@ -88,4 +89,17 @@
$payment = \Iyzipay\Model\Payment::create($request, Config::options());

# print response
print_r($payment);
print_r($payment);

#verify signature
$paymentId = $payment->getPaymentId();
$currency = $payment->getCurrency();
$basketId = $payment->getBasketId();
$conversationId = $payment->getConversationId();
$paidPrice = $payment->getPaidPrice();
$price = $payment->getPrice();
$signature = $payment->getSignature();

$calculatedSignature = calculateHmacSHA256Signature(array($paymentId, $currency, $basketId, $conversationId, $paidPrice, $price));
$verified = $signature == $calculatedSignature;
echo "Signature verified: $verified";
32 changes: 32 additions & 0 deletions samples/create_payment_postauth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

require_once('config.php');
require_once('signature_verification.php');

# create request class
$request = new \Iyzipay\Request\CreatePaymentPostAuthRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPaymentId("1");
$request->setPaidPrice("1.2");
$request->setIp("85.34.78.112");
$request->setCurrency(\Iyzipay\Model\Currency::TL);

# make request
$postAuth = \Iyzipay\Model\PaymentPostAuth::create($request, Config::options());

# print result
print_r($postAuth);

#verify signature
$paymentId = $postAuth->getPaymentId();
$currency = $postAuth->getCurrency();
$basketId = $postAuth->getBasketId();
$conversationId = $postAuth->getConversationId();
$paidPrice = $postAuth->getPaidPrice(1);
$price = $postAuth->getPrice();
$signature = $postAuth->getSignature();

$calculatedSignature = calculateHmacSHA256Signature(array($paymentId, $currency, $basketId, $conversationId, $paidPrice, $price));
$verified = $signature == $calculatedSignature;
echo "Signature verified: $verified";
105 changes: 105 additions & 0 deletions samples/create_payment_preauth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php

require_once('config.php');
require_once('signature_verification.php');

# create request class
$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);

# make request
$payment = \Iyzipay\Model\PaymentPreAuth::create($request, Config::options());

# print response
print_r($payment);

#verify signature
$paymentId = $payment->getPaymentId();
$currency = $payment->getCurrency();
$basketId = $payment->getBasketId();
$conversationId = $payment->getConversationId();
$paidPrice = $payment->getPaidPrice();
$price = $payment->getPrice();
$signature = $payment->getSignature();

$calculatedSignature = calculateHmacSHA256Signature(array($paymentId, $currency, $basketId, $conversationId, $paidPrice, $price));
$verified = $signature == $calculatedSignature;
echo "Signature verified: $verified";
15 changes: 14 additions & 1 deletion samples/create_payment_with_registered_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,17 @@
$payment = \Iyzipay\Model\Payment::create($request, Config::options());

# print response
print_r($payment);
print_r($payment);

#verify signature
$paymentId = $payment->getPaymentId();
$currency = $payment->getCurrency();
$basketId = $payment->getBasketId();
$conversationId = $payment->getConversationId();
$paidPrice = $payment->getPaidPrice();
$price = $payment->getPrice();
$signature = $payment->getSignature();

$calculatedSignature = calculateHmacSHA256Signature(array($paymentId, $currency, $basketId, $conversationId, $paidPrice, $price));
$verified = $signature == $calculatedSignature;
echo "Signature verified: $verified";
Loading
Loading