Skip to content

Commit

Permalink
Merge pull request #200 from mewebstudio/191-akbank-yeni-api-destegi
Browse files Browse the repository at this point in the history
191 akbank yeni api destegi
  • Loading branch information
nuryagdym authored Apr 23, 2024
2 parents fa5db28 + 5f807f2 commit 6bf8f37
Show file tree
Hide file tree
Showing 87 changed files with 7,502 additions and 569 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sistemlerinin kullanılabilmesidir.
| Gateway | Desktekleyen<br/>bankalar | Desteklenen<br/>Ödeme Tipleri | Desteklenen Sorgular |
|-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| Tosla (AKÖde) | ? | NonSecure<br/>3DPay<br/>3DHost | İptal<br/>İade<br/>Durum sorgulama<br/>Sipariş Tarihçesini sorgulama |
| AkbankPos | Akbank | NonSecure<br/>3DSecur<br/>3DPay<br/>3DHost<br/>Tekrarlanan Ödeme | İptal<br/>İade<br/>Sipariş Tarihçesini sorgulama |
| EST POS<br/>(Asseco/Payten)<br/>_deprecated_ | Akbank<br/>TEB<br/>İşbank<br/>Şekerbank<br/>Halkbank<br/>Finansbank<br/>Ziraat | NonSecure<br/>3DSecure<br/>3DPay<br/>3DHost<br/>3DPayHost<br/>Tekrarlanan Ödeme | İptal<br/>İade<br/>Durum sorgulama<br/>Sipariş Tarihçesini sorgulama |
| EST V3 POS<br/><br/>EstPos altyapının<br/>daha güvenli<br/>(sha512) hash<br/>algoritmasıyla<br/>uygulaması. | -----"----- | -----"----- | -----"----- |
| PayFlex MPI VPOS V4 | Ziraat<br/>Vakıfbank<br/>İşbank | NonSecure<br/>3DSecure<br/>Tekrarlanan Ödeme | İptal<br/>İade<br/>Durum sorgulama |
Expand Down
9 changes: 9 additions & 0 deletions config/pos_production.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
*/
return [
'banks' => [
'akbank-pos' => [
'name' => 'AKBANK T.A.S.',
'class' => Mews\Pos\Gateways\AkbankPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://api.akbank.com/api/v1/payment/virtualpos',
'gateway_3d' => 'https://virtualpospaymentgateway.akbank.com/securepay',
'gateway_3d_host' => 'https://virtualpospaymentgateway.akbank.com/payhosting',
],
],
'akbankv3' => [
'name' => 'AKBANK T.A.S.',
'class' => Mews\Pos\Gateways\EstV3Pos::class,
Expand Down
115 changes: 62 additions & 53 deletions config/pos_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,104 +2,113 @@

return [
'banks' => [
'akbank-pos' => [
'name' => 'AKBANK T.A.S.',
'class' => Mews\Pos\Gateways\AkbankPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://apipre.akbank.com/api/v1/payment/virtualpos',
'gateway_3d' => 'https://virtualpospaymentgatewaypre.akbank.com/securepay',
'gateway_3d_host' => 'https://virtualpospaymentgatewaypre.akbank.com/payhosting',
],
],
'akbankv3' => [
'name' => 'AKBANK T.A.S.',
'class' => Mews\Pos\Gateways\EstV3Pos::class,
'gateway_endpoints' => [
'payment_api' => 'https://entegrasyon.asseco-see.com.tr/fim/api',
'gateway_3d' => 'https://entegrasyon.asseco-see.com.tr/fim/est3Dgate',
'name' => 'AKBANK T.A.S.',
'class' => Mews\Pos\Gateways\EstPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://entegrasyon.asseco-see.com.tr/fim/api',
'gateway_3d' => 'https://entegrasyon.asseco-see.com.tr/fim/est3Dgate',
],
],
'akbank' => [
'name' => 'AKBANK T.A.S.',
'class' => Mews\Pos\Gateways\EstPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://entegrasyon.asseco-see.com.tr/fim/api',
'gateway_3d' => 'https://entegrasyon.asseco-see.com.tr/fim/est3Dgate',
'name' => 'AKBANK T.A.S.',
'class' => Mews\Pos\Gateways\EstPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://entegrasyon.asseco-see.com.tr/fim/api',
'gateway_3d' => 'https://entegrasyon.asseco-see.com.tr/fim/est3Dgate',
],
],
'tosla' => [
'name' => 'AkÖde A.Ş.',
'class' => Mews\Pos\Gateways\ToslaPos::class,
'gateway_endpoints' => [
'tosla' => [
'name' => 'AkÖde A.Ş.',
'class' => Mews\Pos\Gateways\ToslaPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://prepentegrasyon.tosla.com/api/Payment',
'gateway_3d' => 'https://prepentegrasyon.tosla.com/api/Payment/ProcessCardForm',
'gateway_3d_host' => 'https://prepentegrasyon.tosla.com/api/Payment/threeDSecure',
],
],
'yapikredi' => [
'name' => 'Yapıkredi',
'class' => Mews\Pos\Gateways\PosNet::class,
'gateway_endpoints' => [
'payment_api' => 'https://setmpos.ykb.com/PosnetWebService/XML',
'gateway_3d' => 'https://setmpos.ykb.com/3DSWebService/YKBPaymentService',
'name' => 'Yapıkredi',
'class' => Mews\Pos\Gateways\PosNet::class,
'gateway_endpoints' => [
'payment_api' => 'https://setmpos.ykb.com/PosnetWebService/XML',
'gateway_3d' => 'https://setmpos.ykb.com/3DSWebService/YKBPaymentService',
],
],
'albaraka' => [
'name' => 'Albaraka',
'class' => Mews\Pos\Gateways\PosNetV1Pos::class,
'gateway_endpoints' => [
'payment_api' => 'https://epostest.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc',
'gateway_3d' => 'https://epostest.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx',
'name' => 'Albaraka',
'class' => Mews\Pos\Gateways\PosNetV1Pos::class,
'gateway_endpoints' => [
'payment_api' => 'https://epostest.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc',
'gateway_3d' => 'https://epostest.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx',
],
],
'garanti' => [
'name' => 'Garanti',
'class' => Mews\Pos\Gateways\GarantiPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://sanalposprovtest.garantibbva.com.tr/VPServlet',
'gateway_3d' => 'https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine',
'name' => 'Garanti',
'class' => Mews\Pos\Gateways\GarantiPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://sanalposprovtest.garantibbva.com.tr/VPServlet',
'gateway_3d' => 'https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine',
],
],
'qnbfinansbank-payfor' => [
'name' => 'QNBFinansbank-PayFor',
'class' => Mews\Pos\Gateways\PayForPos::class,
'gateway_endpoints' => [
'name' => 'QNBFinansbank-PayFor',
'class' => Mews\Pos\Gateways\PayForPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://vpostest.qnbfinansbank.com/Gateway/XMLGate.aspx',
'gateway_3d' => 'https://vpostest.qnbfinansbank.com/Gateway/Default.aspx',
'gateway_3d_host' => 'https://vpostest.qnbfinansbank.com/Gateway/3DHost.aspx',
],
],
'vakifbank' => [
'name' => 'VakifBank-VPOS',
'class' => Mews\Pos\Gateways\PayFlexV4Pos::class,
'gateway_endpoints' => [
'payment_api' => 'https://onlineodemetest.vakifbank.com.tr:4443/VposService/v3/Vposreq.aspx',
'gateway_3d' => 'https://3dsecuretest.vakifbank.com.tr:4443/MPIAPI/MPI_Enrollment.aspxs',
'query_api' => 'https://sanalpos.vakifbank.com.tr/v4/UIWebService/Search.aspx', // todo update with the correct one
'name' => 'VakifBank-VPOS',
'class' => Mews\Pos\Gateways\PayFlexV4Pos::class,
'gateway_endpoints' => [
'payment_api' => 'https://onlineodemetest.vakifbank.com.tr:4443/VposService/v3/Vposreq.aspx',
'gateway_3d' => 'https://3dsecuretest.vakifbank.com.tr:4443/MPIAPI/MPI_Enrollment.aspxs',
'query_api' => 'https://sanalpos.vakifbank.com.tr/v4/UIWebService/Search.aspx', // todo update with the correct one
],
],
'ziraat-vpos' => [
'name' => 'Ziraat Bankası',
'class' => Mews\Pos\Gateways\PayFlexV4Pos::class,
'gateway_endpoints' => [
'payment_api' => 'https://preprod.payflex.com.tr/Ziraatbank/VposWeb/v3/Vposreq.aspx',
'gateway_3d' => 'https://preprod.payflex.com.tr/ZiraatBank/MpiWeb/MPI_Enrollment.aspx',
'query_api' => 'https://sanalpos.ziraatbank.com.tr/v4/UIWebService/Search.aspx',
'name' => 'Ziraat Bankası',
'class' => Mews\Pos\Gateways\PayFlexV4Pos::class,
'gateway_endpoints' => [
'payment_api' => 'https://preprod.payflex.com.tr/Ziraatbank/VposWeb/v3/Vposreq.aspx',
'gateway_3d' => 'https://preprod.payflex.com.tr/ZiraatBank/MpiWeb/MPI_Enrollment.aspx',
'query_api' => 'https://sanalpos.ziraatbank.com.tr/v4/UIWebService/Search.aspx',
],
],
'vakifbank-cp' => [
'name' => 'VakifBank-PayFlex-Common-Payment',
'class' => Mews\Pos\Gateways\PayFlexCPV4Pos::class,
'gateway_endpoints' => [
'name' => 'VakifBank-PayFlex-Common-Payment',
'class' => Mews\Pos\Gateways\PayFlexCPV4Pos::class,
'gateway_endpoints' => [
'payment_api' => 'https://cptest.vakifbank.com.tr/CommonPayment/api/RegisterTransaction',
'gateway_3d' => 'https://cptest.vakifbank.com.tr/CommonPayment/api/VposTransaction',
'query_api' => 'https://cptest.vakifbank.com.tr/CommonPayment/SecurePayment',
],
],
'denizbank' => [
'name' => 'DenizBank-InterPos',
'class' => Mews\Pos\Gateways\InterPos::class,
'gateway_endpoints' => [
'name' => 'DenizBank-InterPos',
'class' => Mews\Pos\Gateways\InterPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://test.inter-vpos.com.tr/mpi/Default.aspx',
'gateway_3d' => 'https://test.inter-vpos.com.tr/mpi/Default.aspx',
'gateway_3d_host' => 'https://test.inter-vpos.com.tr/mpi/3DHost.aspx',
],
],
'kuveytpos' => [
'name' => 'kuveyt-pos',
'class' => Mews\Pos\Gateways\KuveytPos::class,
'gateway_endpoints' => [
'name' => 'kuveyt-pos',
'class' => Mews\Pos\Gateways\KuveytPos::class,
'gateway_endpoints' => [
'payment_api' => 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelProvisionGate',
'gateway_3d' => 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelPayGate',
'query_api' => 'https://boatest.kuveytturk.com.tr/BOA.Integration.WCFService/BOA.Integration.VirtualPos/VirtualPosService.svc?wsdl',
Expand Down
32 changes: 26 additions & 6 deletions docs/CANCEL-EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,33 @@ function createCancelOrder(string $gatewayClass, array $lastResponse, string $ip
}


if (isset($lastResponse['recurring_id'])
&& \Mews\Pos\Gateways\EstPos::class === $gatewayClass || \Mews\Pos\Gateways\EstV3Pos::class === $gatewayClass
) {
if (isset($lastResponse['recurring_id'])) {
// tekrarlanan odemeyi iptal etmek icin:
$cancelOrder = [
'recurringOrderInstallmentNumber' => 1, // hangi taksidi iptal etmek istiyoruz?
];
if (\Mews\Pos\Gateways\EstPos::class === $gatewayClass || \Mews\Pos\Gateways\EstV3Pos::class === $gatewayClass) {
$cancelOrder += [
'recurringOrderInstallmentNumber' => 1, // hangi taksidi iptal etmek istiyoruz?
];
} elseif (\Mews\Pos\Gateways\AkbankPos::class === $gatewayClass) {
// odemesi gerceklesmis recurring taksidin iptali:
// $cancelOrder += [
// 'recurring_id' => $lastResponse['recurring_id'],
// 'recurringOrderInstallmentNumber' => 1,
// ];

// odemesi henuz gerceklesmemis recurring taksidin iptali:
$cancelOrder += [
'recurring_id' => $lastResponse['recurring_id'],
'recurringOrderInstallmentNumber' => 2,
'recurring_payment_is_pending' => true,
];

// odemesi henuz gerceklesmemis recurring işlem talimatlarının tamamı iptal edilmek isteniyorsa
// $cancelOrder += [
// 'recurring_id' => $lastResponse['recurring_id'],
// 'recurringOrderInstallmentNumber' => null,
// 'recurring_payment_is_pending' => true,
// ];
}
}

return $cancelOrder;
Expand Down
9 changes: 9 additions & 0 deletions docs/ORDER-HISTORY-EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ function createOrderHistoryOrder(string $gatewayClass, array $lastResponse): arr
$order = [
'id' => $lastResponse['order_id'],
];
} elseif (\Mews\Pos\Gateways\AkbankPos::class === $gatewayClass) {
if (isset($lastResponse['recurring_id'])) {
$order = [
'recurring_id' => $lastResponse['recurring_id'],
];
} else {
$order = [
'id' => $lastResponse['order_id'],
];
} elseif (ToslaPos::class === $gatewayClass) {
$order = [
'id' => $lastResponse['order_id'],
Expand Down
11 changes: 11 additions & 0 deletions docs/REFUND-EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ function createRefundOrder(string $gatewayClass, array $lastResponse, string $ip
$refundOrder['payment_model'] = $lastResponse['payment_model'];
}

if (isset($lastResponse['recurring_id'])) {
// tekrarlanan odemeyi iade etmek icin:
if (\Mews\Pos\Gateways\AkbankPos::class === $gatewayClass) {
// odemesi gerceklesmis recurring taksidinin iadesi:
$refundOrder += [
'recurring_id' => $lastResponse['recurring_id'],
'recurringOrderInstallmentNumber' => 1,
];
}
}

return $refundOrder;
}

Expand Down
2 changes: 1 addition & 1 deletion docs/THREED-PAYMENT-EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ $order = [
];

if ($tekrarlanan = false) { // recurring payments
// Desteleyen Gatewayler: GarantiPos, EstPos, EstV3Pos, PayFlexV4
// Desteleyen Gatewayler: GarantiPos, EstPos, EstV3Pos, PayFlexV4, AkbankPos
$order['installment'] = 0; // Tekrarlayan ödemeler taksitli olamaz.

$recurringFrequency = 3;
Expand Down
1 change: 1 addition & 0 deletions examples/_common-codes/3d-host/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
require '../../_templates/_header.php';

$order = getNewOrder(
$pos,
$baseUrl,
$ip,
$request->get('currency', PosInterface::CURRENCY_TRY),
Expand Down
1 change: 1 addition & 0 deletions examples/_common-codes/3d/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
}
$transaction = $request->get('tx', PosInterface::TX_TYPE_PAY_AUTH);
$order = getNewOrder(
$pos,
$baseUrl,
$ip,
$request->get('currency', PosInterface::CURRENCY_TRY),
Expand Down
36 changes: 28 additions & 8 deletions examples/_common-codes/regular/cancel.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ function createCancelOrder(string $gatewayClass, array $lastResponse, string $ip
$cancelOrder['transaction_id'] = $lastResponse['transaction_id'];
$cancelOrder['amount'] = $lastResponse['amount'];
} elseif (\Mews\Pos\Gateways\VakifKatilimPos::class === $gatewayClass) {
$cancelOrder['remote_order_id'] = $lastResponse['remote_order_id']; // banka tarafındaki order id
$cancelOrder['amount'] = $lastResponse['amount'];
$cancelOrder['remote_order_id'] = $lastResponse['remote_order_id']; // banka tarafındaki order id
$cancelOrder['amount'] = $lastResponse['amount'];
// on otorizasyon islemin iptali icin PosInterface::TX_TYPE_PAY_PRE_AUTH saglanmasi gerekiyor
$cancelOrder['transaction_type'] = $lastResponse['transaction_type'] ?? PosInterface::TX_TYPE_PAY_AUTH;
} elseif (\Mews\Pos\Gateways\PayFlexV4Pos::class === $gatewayClass || \Mews\Pos\Gateways\PayFlexCPV4Pos::class === $gatewayClass) {
Expand All @@ -45,13 +45,33 @@ function createCancelOrder(string $gatewayClass, array $lastResponse, string $ip
}


if (isset($lastResponse['recurring_id'])
&& (\Mews\Pos\Gateways\EstPos::class === $gatewayClass || \Mews\Pos\Gateways\EstV3Pos::class === $gatewayClass)
) {
if (isset($lastResponse['recurring_id'])) {
// tekrarlanan odemeyi iptal etmek icin:
$cancelOrder = [
'recurringOrderInstallmentNumber' => 1, // hangi taksidi iptal etmek istiyoruz?
];
if (\Mews\Pos\Gateways\EstPos::class === $gatewayClass || \Mews\Pos\Gateways\EstV3Pos::class === $gatewayClass) {
$cancelOrder += [
'recurringOrderInstallmentNumber' => 1, // hangi taksidi iptal etmek istiyoruz?
];
} elseif (\Mews\Pos\Gateways\AkbankPos::class === $gatewayClass) {
// odemesi gerceklesmis recurring taksidin iptali:
// $cancelOrder += [
// 'recurring_id' => $lastResponse['recurring_id'],
// 'recurringOrderInstallmentNumber' => 1,
// ];

// odemesi henuz gerceklesmemis recurring taksidin iptali:
$cancelOrder += [
'recurring_id' => $lastResponse['recurring_id'],
'recurringOrderInstallmentNumber' => 2,
'recurring_payment_is_pending' => true,
];

// odemesi henuz gerceklesmemis recurring işlem talimatlarının tamamı iptal edilmek isteniyorsa
// $cancelOrder += [
// 'recurring_id' => $lastResponse['recurring_id'],
// 'recurringOrderInstallmentNumber' => null,
// 'recurring_payment_is_pending' => true,
// ];
}
}

return $cancelOrder;
Expand Down
1 change: 1 addition & 0 deletions examples/_common-codes/regular/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
$transaction = $request->get('tx', PosInterface::TX_TYPE_PAY_AUTH);

$order = getNewOrder(
$pos,
$baseUrl,
$ip,
$request->get('currency', PosInterface::CURRENCY_TRY),
Expand Down
Loading

0 comments on commit 6bf8f37

Please sign in to comment.