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

Vakifkatilimpos fix errors #224

Merged
merged 7 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ sistemlerinin kullanılabilmesidir.

### Deskteklenen Payment Gateway'ler / Bankalar:

| 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<br/>Geçmiş İşlemleri sorgulama |
| EST POS<br/><sup>(Asseco/Payten)<br/>_deprecated_</sup> | 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/><sup>EstPos altyapının<br/>daha güvenli<br/>(sha512) hash<br/>algoritmasıyla<br/>uygulaması.</sup> | -----"----- | -----"----- | -----"----- |
| PayFlex MPI VPOS V4 | Ziraat<br/>Vakıfbank VPOS 7/24<br/>İşbank | NonSecure<br/>3DSecure<br/>Tekrarlanan Ödeme | İptal<br/>İade<br/>Durum sorgulama |
| PayFlex<br/>Common Payment V4<br/><sup>(Ortak Ödeme)</sup> | Ziraat<br/>Vakıfbank<br/>İşbank | NonSecure<br/>3DPay<br/>3DHost | İptal<br/>İade |
| Garanti Virtual POS | Garanti | NonSecure<br/>3DSecure<br/>3DPay<br/>3DHost<br/>Tekrarlanan Ödeme | İptal<br/>İade<br/>Durum sorgulama<br/>Sipariş Tarihçesini sorgulama<br/>Geçmiş İşlemleri sorgulama |
| PosNet | YapıKredi | NonSecure<br/>3DSecure<br/> | İptal<br/>İade<br/>Durum sorgulama |
| PosNetV1<br/><sup>(JSON API)</sup> | Albaraka Türk | NonSecure<br/>3DSecure | İptal<br/>İade<br/>Durum sorgulama |
| PayFor | Finansbank<br/>Enpara | NonSecure<br/>3DSecure<br/>3DPay<br/>3DHost | İptal<br/>İade<br/>Durum sorgulama<br/>Sipariş Tarihçesini sorgulama<br/>Geçmiş İşlemleri sorgulama |
| InterPOS | Deniz bank | NonSecure<br/>3DSecure<br/>3DPay<br/>3DHost | İptal<br/>İade<br/>Durum sorgulama |
| Kuveyt POS TDV2.0.0 | Kuveyt Türk | NonSecure<br/>3DSecure | İptal<br/>İade<br/>Durum sorgulama<br/>(SOAP API) |
| VakifKatilimPos<br/><sup>(test edilmesi gerekiyor)</sup> | Vakıf Katılım | NonSecure<br/>3DSecure<br/>3DHost | İptal<br/>İade<br/>Durum sorgulama<br/>Sipariş Tarihçesini sorgulama<br/>Geçmiş İşlemleri sorgulama |
| 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<br/>Geçmiş İşlemleri sorgulama |
| EST POS<br/><sup>(Asseco/Payten)<br/>_deprecated_</sup> | 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/><sup>EstPos altyapının<br/>daha güvenli<br/>(sha512) hash<br/>algoritmasıyla<br/>uygulaması.</sup> | -----"----- | -----"----- | -----"----- |
| PayFlex MPI VPOS V4 | Ziraat<br/>Vakıfbank VPOS 7/24<br/>İşbank | NonSecure<br/>3DSecure<br/>Tekrarlanan Ödeme | İptal<br/>İade<br/>Durum sorgulama |
| PayFlex<br/>Common Payment V4<br/><sup>(Ortak Ödeme)</sup> | Ziraat<br/>Vakıfbank<br/>İşbank | NonSecure<br/>3DPay<br/>3DHost | İptal<br/>İade |
| Garanti Virtual POS | Garanti | NonSecure<br/>3DSecure<br/>3DPay<br/>3DHost<br/>Tekrarlanan Ödeme | İptal<br/>İade<br/>Durum sorgulama<br/>Sipariş Tarihçesini sorgulama<br/>Geçmiş İşlemleri sorgulama |
| PosNet | YapıKredi | NonSecure<br/>3DSecure<br/> | İptal<br/>İade<br/>Durum sorgulama |
| PosNetV1<br/><sup>(JSON API)</sup> | Albaraka Türk | NonSecure<br/>3DSecure | İptal<br/>İade<br/>Durum sorgulama |
| PayFor | Finansbank<br/>Enpara | NonSecure<br/>3DSecure<br/>3DPay<br/>3DHost | İptal<br/>İade<br/>Durum sorgulama<br/>Sipariş Tarihçesini sorgulama<br/>Geçmiş İşlemleri sorgulama |
| InterPOS | Deniz bank | NonSecure<br/>3DSecure<br/>3DPay<br/>3DHost | İptal<br/>İade<br/>Durum sorgulama |
| Kuveyt POS TDV2.0.0 | Kuveyt Türk | NonSecure<br/>3DSecure | İptal<br/>İade<br/>Durum sorgulama<br/>(SOAP API) |
| VakifKatilimPos | Vakıf Katılım | NonSecure <sup>(test edilmesi gerekiyor)</sup><br/>3DSecure<br/>3DHost <sup>(test edilmesi gerekiyor)</sup> | İptal<br/>İade<br/>Durum sorgulama<br/>Sipariş Tarihçesini sorgulama<br/>Geçmiş İşlemleri sorgulama |

### Ana başlıklar

Expand Down
11 changes: 11 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Changelog
## [1.4.0] - 2024-07-02

### New Features
- **GarantiPos** - geçmiş işlemleri sorgulama (PR #221).
- **VakifKatilimPos** - kısmi iade desteği. (issue #218)

### Fixed
- **VakifKatilimPos** - 3D Secure ödeme çalışmıyor.
- **VakifKatilimPos** - iptal işlemi çalışmıyor.

# Changelog
## [1.3.0] - 2024-05-24

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public function create3DEnrollmentCheckRequestData(KuveytPosAccount $kuveytPosAc
'TransactionSecurity' => $this->secureTypeMappings[$paymentModel],
'InstallmentCount' => $this->mapInstallment($order['installment']),
'Amount' => $this->formatAmount($order['amount']),
'DisplayAmount' => $this->formatAmount($order['amount']),
'FECCurrencyCode' => $this->mapCurrency($order['currency']),
'MerchantOrderId' => $order['id'],
'OkUrl' => $order['success_url'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ public function mapCancelResponse(array $rawResponseData): array
$result['order_id'] = $vposMessage['MerchantOrderId'];
$result['remote_order_id'] = (string) $rawResponseData['OrderId'];
$result['status'] = $status;
$result['currency'] = $this->mapCurrency($vposMessage['FECCurrencyCode']);

if (self::TX_APPROVED !== $status) {
$result['error_code'] = $procReturnCode;
Expand Down Expand Up @@ -315,8 +314,6 @@ public function mapOrderHistoryResponse(array $rawResponseData): array
}
}

$mappedTransactions = \array_reverse($mappedTransactions);

$result = [
'proc_return_code' => $procReturnCode,
'order_id' => $orderId,
Expand Down Expand Up @@ -494,12 +491,21 @@ private function mapSingleOrderHistoryTransaction(array $rawTx): array
$defaultResponse['installment_count'] = $this->mapInstallment($rawTx['InstallmentCount']);
$defaultResponse['masked_number'] = $rawTx['CardNumber'];
$defaultResponse['first_amount'] = (float) $rawTx['FirstAmount'];
$defaultResponse['capture_amount'] = isset($rawTx['TranAmount']) ? (float) $rawTx['TranAmount'] : 0;
$defaultResponse['capture'] = $defaultResponse['first_amount'] === $defaultResponse['capture_amount'];
$defaultResponse['order_status'] = $rawTx['LastOrderStatusDescription'];

if ($defaultResponse['capture']) {
$defaultResponse['capture_time'] = $defaultResponse['transaction_time'];
/**
* OrderStatus
* 1 => Satis
* 6 => Iptal
*/
if ('1' === $rawTx['OrderStatus']) {
$defaultResponse['capture_amount'] = isset($rawTx['TranAmount']) ? (float) $rawTx['TranAmount'] : 0;
$defaultResponse['capture'] = $defaultResponse['first_amount'] === $defaultResponse['capture_amount'];
if ($defaultResponse['capture']) {
$defaultResponse['capture_time'] = $defaultResponse['transaction_time'];
}
} elseif ('6' === $rawTx['OrderStatus']) {
$defaultResponse['cancel_time'] = $defaultResponse['transaction_time'];
}
}

Expand Down Expand Up @@ -546,7 +552,7 @@ private function map3DPaymentPaymentResponse(array $rawPaymentResponseData, stri
}

/** @var array<string, string> $vPosMessage */
$vPosMessage = $rawPaymentResponseData['VPosMessageContract'];
$vPosMessage = $rawPaymentResponseData['VPosMessage'];

// ProvisionNumber: Başarılı işlemlerde kart bankasının vermiş olduğu otorizasyon numarasıdır.
$result['order_id'] = $rawPaymentResponseData['MerchantOrderId'];
Expand All @@ -555,7 +561,8 @@ private function map3DPaymentPaymentResponse(array $rawPaymentResponseData, stri
$result['ref_ret_num'] = $rawPaymentResponseData['RRN'];
// Stan: Pos bankası tarafında verilen referans işlem referans numarasıdır.
$result['transaction_id'] = $rawPaymentResponseData['Stan'];
$result['auth_code'] = $rawPaymentResponseData['ProvisionNumber'] ?? null;
$result['batch_num'] = $vPosMessage['BatchId'];
$result['auth_code'] = $rawPaymentResponseData['ProvisionNumber'] ?? null;
$result['masked_number'] = $vPosMessage['CardNumber'] ?? null;
$result['currency'] = isset($vPosMessage['CurrencyCode']) ? $this->mapCurrency($vPosMessage['CurrencyCode']) : $order['currency'];
$result['amount'] = $this->formatAmount($vPosMessage['Amount']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ public function testCreate3DEnrollmentCheckRequestData(array $order, string $txT
$txType,
$card
);
$this->assertEquals($expectedData, $actualData);

ksort($actualData);
ksort($expectedData);
$this->assertSame($expectedData, $actualData);
}

/**
Expand Down Expand Up @@ -416,6 +419,7 @@ public static function create3DEnrollmentCheckRequestDataDataProvider(): array
'TransactionSecurity' => '3',
'InstallmentCount' => '0',
'Amount' => 1001,
'DisplayAmount' => 1001,
'FECCurrencyCode' => '0949',
'MerchantOrderId' => '2020110828BC',
'OkUrl' => 'http://localhost/finansbank-payfor/3d/success.php',
Expand Down
Loading