[GH-ISSUE #141] alBaraka PosNet #70

Closed
opened 2026-03-03 15:42:41 +03:00 by kerem · 7 comments
Owner

Originally created by @malikdoksoz on GitHub (Jun 1, 2023).
Original GitHub issue: https://github.com/mewebstudio/pos/issues/141

Information Description
Kütüphane versiyonu v0.12.1
Gateway ismi PosNet
Banka ismi alBaraka

alBaraka PosNet için referans olması sebebiyle döküman ve API linkleri

alBaraka döküman:

Albaraka_Sanal_Pos_Entegrasyonu_20210421.docx

Originally created by @malikdoksoz on GitHub (Jun 1, 2023). Original GitHub issue: https://github.com/mewebstudio/pos/issues/141 | Information | Description | |--------------|---------| | Kütüphane versiyonu | v0.12.1 | | Gateway ismi| PosNet | | Banka ismi|alBaraka | alBaraka PosNet için referans olması sebebiyle döküman ve API linkleri **alBaraka döküman:** [Albaraka_Sanal_Pos_Entegrasyonu_20210421.docx](https://github.com/mewebstudio/pos/files/11623695/Albaraka_Sanal_Pos_Entegrasyonu_20210421.docx)
kerem closed this issue 2026-03-03 15:42:42 +03:00
Author
Owner

@malikdoksoz commented on GitHub (Jun 1, 2023):

Bu da yardımcı olması sebebiyle albaraka tarafından verilen API linkleri:

(TEST)3ds  Adresi             
https://epostest.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx

(TEST)Transaction Adresi:               
https://epostest.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc/

(LIVE)3ds  Adresi:             
https://epos.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx

(LIVE)Transaction Adresi:               
https://epos.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc/
<!-- gh-comment-id:1572016441 --> @malikdoksoz commented on GitHub (Jun 1, 2023): Bu da yardımcı olması sebebiyle albaraka tarafından verilen API linkleri: ```curl (TEST)3ds Adresi https://epostest.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx (TEST)Transaction Adresi: https://epostest.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc/ (LIVE)3ds Adresi: https://epos.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx (LIVE)Transaction Adresi: https://epos.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc/ ```
Author
Owner

@nuryagdym commented on GitHub (Jun 1, 2023):

Merhabalar,
account ve URL configleri olustururarak kullanmayi denediniz mi? AlBaraka'nin kullandigi PosNet ile YKB'nin PosNet'i ayni olup olmadigindan emin degilim, ama denemekte fayda var.

pos.php:

[
        'albaraka' => [
            'name'  => 'Albaraka',
            'class' => Mews\Pos\Gateways\PosNet::class,
            'urls'  => [
                'production'    => 'https://epos.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc',
                'test'          => 'https://epostest.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc',
                'gateway'       => [
                    'production'    => 'https://epos.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx',
                    'test'          => 'https://epostest.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx',
                ],
            ],
        ],
]

account config:

$account = AccountFactory::createPosNetAccount(
    'albaraka',
    'MERCHANT_NO ',
    '',
    '',
    'TERMINAL_NO',
    'EPOS_NO',
    AbstractGateway::MODEL_3D_SECURE,
    'ENCKEY'
);

geri kalan koda /examples/ykb/3d/ ile ayni

<!-- gh-comment-id:1572124291 --> @nuryagdym commented on GitHub (Jun 1, 2023): Merhabalar, account ve URL configleri olustururarak kullanmayi denediniz mi? AlBaraka'nin kullandigi PosNet ile YKB'nin PosNet'i ayni olup olmadigindan emin degilim, ama denemekte fayda var. pos.php: ``` [ 'albaraka' => [ 'name' => 'Albaraka', 'class' => Mews\Pos\Gateways\PosNet::class, 'urls' => [ 'production' => 'https://epos.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc', 'test' => 'https://epostest.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc', 'gateway' => [ 'production' => 'https://epos.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx', 'test' => 'https://epostest.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx', ], ], ], ] ``` account config: ``` $account = AccountFactory::createPosNetAccount( 'albaraka', 'MERCHANT_NO ', '', '', 'TERMINAL_NO', 'EPOS_NO', AbstractGateway::MODEL_3D_SECURE, 'ENCKEY' ); ``` geri kalan koda `/examples/ykb/3d/` ile ayni
Author
Owner

@malikdoksoz commented on GitHub (Jun 2, 2023):

Uyumlu değil galiba aldığım hata:

An uncaught Exception was encountered

Type: Symfony\Component\Serializer\Exception\NotEncodableValueException

Message: Document types are not allowed.

Filename: /home/example.org/public_html/bagis/vendor/symfony/serializer/Encoder/XmlEncoder.php

Line Number: 133

Backtrace:

File: /home/example.org/public_html/bagis/vendor/mews/pos/src/Gateways/AbstractGateway.php
Line: 569
Function: decode

File: /home/example.org/public_html/bagis/vendor/mews/pos/src/Gateways/PosNet.php
Line: 166
Function: XMLStringToArray

File: /home/example.org/public_html/bagis/vendor/mews/pos/src/Gateways/PosNet.php
Line: 61
Function: send

File: /home/example.org/public_html/bagis/vendor/mews/pos/src/Gateways/PosNet.php
Line: 133
Function: getOosTransactionData

File: /home/example.org/public_html/bagis/application/controllers/Home_controller.php
Line: 223
Function: get3DFormData

File: /home/example.org/public_html/bagis/index.php
Line: 234
Function: require_once
	$account = \Mews\Pos\Factory\AccountFactory::createPosNetAccount(
			'albaraka',
			'6212270319 ',
			'',
			'',
			'27B12620',
			'2014053822678921',
			\Mews\Pos\Gateways\AbstractGateway::MODEL_3D_SECURE,
			'ENCKEY'
		);

		// API kullanıcı hesabı ile paket bir değişkene aktarılıyor
		try {
			$pos = \Mews\Pos\Factory\PosFactory::createPosGateway($account);
			//değere göre API URL'leri test veya production değerler kullanılır.
			$pos->setTestMode(true);
		} catch (\Mews\Pos\Exceptions\BankNotFoundException | \Mews\Pos\Exceptions\BankClassNullException $e) {
			var_dump($e);
		}


		$order_id = date('Ymd') . strtoupper(substr(uniqid(sha1(time())), 0, 4));
		$instalment = '0';
		$success_url = base_url() . 'sepetim/odeme/sonuc';
		$fail_url = base_url() . 'sepetim/odeme/sonuc';

		$transaction = 'pay'; // pay => Auth, pre PreAuth
		// $transaction_type = $pos->bank->types[$transaction];

		$rand = microtime();

		$userDatas = $this->session->userdata('anonimData');

		$order = [
			'id'                => $order_id,
			'email'             => $userDatas['email'] ?? '', // optional
			'name'              => $userDatas['ad_soyad'] ?? '', // optional
			'amount'            => (float) str_replace(',', '', $this->data['cartTotal']),
			'installment'       => $instalment,
			'currency'          => 'TRY',
			'ip'                => $ip,
			'success_url'       => $success_url,
			'fail_url'          => $fail_url,
			'transaction'       => $transaction,
			'lang'              => 'tr',
			'rand'              => $rand,
			'status' 			  => 0,
			'lang' =>  \Mews\Pos\Gateways\AbstractGateway::LANG_TR,
		];

		$newOrder = $order;
		$newOrder['cartdata'] = json_encode($this->cart->contents());
		$newOrder['userdata'] = json_encode($this->session->userdata('anonimData'));

		$this->db->insert('orders', $newOrder);

		$explodeExpiry = explode("/", preg_replace('/\s+/', '', $request->get('expiry')));
		$lastType = '';
		if ($request->get('number')[0] == '4')
			$lastType = \Mews\Pos\Entity\Card\AbstractCreditCard::CARD_TYPE_VISA;
		elseif ($request->get('number')[0] == '5')
			$lastType = \Mews\Pos\Entity\Card\AbstractCreditCard::CARD_TYPE_MASTERCARD;

		$card = \Mews\Pos\Factory\CreditCardFactory::create(
			$pos,
			preg_replace('/\s+/', '', $request->get('number')),
			$explodeExpiry[0],
			$explodeExpiry[1],
			$request->get('cvc'),
			$request->get('name'),
			$lastType
		);

		$pos->prepare($order, \Mews\Pos\Gateways\AbstractGateway::TX_PAY, $card);

		$this->data['form_data'] = $pos->get3dFormData();
<!-- gh-comment-id:1573515647 --> @malikdoksoz commented on GitHub (Jun 2, 2023): Uyumlu değil galiba aldığım hata: ``` An uncaught Exception was encountered Type: Symfony\Component\Serializer\Exception\NotEncodableValueException Message: Document types are not allowed. Filename: /home/example.org/public_html/bagis/vendor/symfony/serializer/Encoder/XmlEncoder.php Line Number: 133 Backtrace: File: /home/example.org/public_html/bagis/vendor/mews/pos/src/Gateways/AbstractGateway.php Line: 569 Function: decode File: /home/example.org/public_html/bagis/vendor/mews/pos/src/Gateways/PosNet.php Line: 166 Function: XMLStringToArray File: /home/example.org/public_html/bagis/vendor/mews/pos/src/Gateways/PosNet.php Line: 61 Function: send File: /home/example.org/public_html/bagis/vendor/mews/pos/src/Gateways/PosNet.php Line: 133 Function: getOosTransactionData File: /home/example.org/public_html/bagis/application/controllers/Home_controller.php Line: 223 Function: get3DFormData File: /home/example.org/public_html/bagis/index.php Line: 234 Function: require_once ``` ```php $account = \Mews\Pos\Factory\AccountFactory::createPosNetAccount( 'albaraka', '6212270319 ', '', '', '27B12620', '2014053822678921', \Mews\Pos\Gateways\AbstractGateway::MODEL_3D_SECURE, 'ENCKEY' ); // API kullanıcı hesabı ile paket bir değişkene aktarılıyor try { $pos = \Mews\Pos\Factory\PosFactory::createPosGateway($account); //değere göre API URL'leri test veya production değerler kullanılır. $pos->setTestMode(true); } catch (\Mews\Pos\Exceptions\BankNotFoundException | \Mews\Pos\Exceptions\BankClassNullException $e) { var_dump($e); } $order_id = date('Ymd') . strtoupper(substr(uniqid(sha1(time())), 0, 4)); $instalment = '0'; $success_url = base_url() . 'sepetim/odeme/sonuc'; $fail_url = base_url() . 'sepetim/odeme/sonuc'; $transaction = 'pay'; // pay => Auth, pre PreAuth // $transaction_type = $pos->bank->types[$transaction]; $rand = microtime(); $userDatas = $this->session->userdata('anonimData'); $order = [ 'id' => $order_id, 'email' => $userDatas['email'] ?? '', // optional 'name' => $userDatas['ad_soyad'] ?? '', // optional 'amount' => (float) str_replace(',', '', $this->data['cartTotal']), 'installment' => $instalment, 'currency' => 'TRY', 'ip' => $ip, 'success_url' => $success_url, 'fail_url' => $fail_url, 'transaction' => $transaction, 'lang' => 'tr', 'rand' => $rand, 'status' => 0, 'lang' => \Mews\Pos\Gateways\AbstractGateway::LANG_TR, ]; $newOrder = $order; $newOrder['cartdata'] = json_encode($this->cart->contents()); $newOrder['userdata'] = json_encode($this->session->userdata('anonimData')); $this->db->insert('orders', $newOrder); $explodeExpiry = explode("/", preg_replace('/\s+/', '', $request->get('expiry'))); $lastType = ''; if ($request->get('number')[0] == '4') $lastType = \Mews\Pos\Entity\Card\AbstractCreditCard::CARD_TYPE_VISA; elseif ($request->get('number')[0] == '5') $lastType = \Mews\Pos\Entity\Card\AbstractCreditCard::CARD_TYPE_MASTERCARD; $card = \Mews\Pos\Factory\CreditCardFactory::create( $pos, preg_replace('/\s+/', '', $request->get('number')), $explodeExpiry[0], $explodeExpiry[1], $request->get('cvc'), $request->get('name'), $lastType ); $pos->prepare($order, \Mews\Pos\Gateways\AbstractGateway::TX_PAY, $card); $this->data['form_data'] = $pos->get3dFormData(); ```
Author
Owner

@nuryagdym commented on GitHub (Jun 2, 2023):

Merhabalar, tmm yarin bakarim

<!-- gh-comment-id:1573833708 --> @nuryagdym commented on GitHub (Jun 2, 2023): Merhabalar, tmm yarin bakarim
Author
Owner

@nuryagdym commented on GitHub (Jun 4, 2023):

Merhabalar,
alBaraka dokumanina baktim, YKB PosNet'te benziyor biraz, ama ayni degil.
Onumizdeki hafta destekleyecek sekilde kod eklemeleri yaparim.

mumkunse epostama test ortaminin bilgilerini ve test kart bilgileri paylasir misiniz.

<!-- gh-comment-id:1575543885 --> @nuryagdym commented on GitHub (Jun 4, 2023): Merhabalar, alBaraka dokumanina baktim, YKB PosNet'te benziyor biraz, ama ayni degil. Onumizdeki hafta destekleyecek sekilde kod eklemeleri yaparim. mumkunse epostama test ortaminin bilgilerini ve test kart bilgileri paylasir misiniz.
Author
Owner

@malikdoksoz commented on GitHub (Jun 5, 2023):

Dilersen yarın iletişime geçebiliriz

<!-- gh-comment-id:1577542298 --> @malikdoksoz commented on GitHub (Jun 5, 2023): Dilersen yarın iletişime geçebiliriz
Author
Owner

@nuryagdym commented on GitHub (Jun 24, 2023):

v0.13.0 PosNetV1 olarak bu gateway destegi eklendi.

<!-- gh-comment-id:1605387755 --> @nuryagdym commented on GitHub (Jun 24, 2023): v0.13.0 `PosNetV1` olarak bu gateway destegi eklendi.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pos#70
No description provided.