diff --git a/samples/search_bank_account_tracking_records.php b/samples/search_bank_account_tracking_records.php new file mode 100644 index 0000000..87d7afc --- /dev/null +++ b/samples/search_bank_account_tracking_records.php @@ -0,0 +1,20 @@ + 'My YKB Card', + 'cardBankName' => 'YAPI VE KREDİ BANKASI A.Ş.', + 'cardBrand' => 'World', + 'cardAssociation' => CardAssociation::MASTER_CARD, + 'cardToken' => 'd9b19d1a-243c-43dc-a498-add08162df72', + 'cardUserKey' => 'c115ecdf-0afc-4d83-8a1b-719c2af19cbd', + 'cardType' => CardType::CREDIT_CARD +); + +$response = SampleConfig::craftgate()->payment()->searchStoredCards($request); + +print_r($response); diff --git a/src/Adapter/BankAccountTrackingAdapter.php b/src/Adapter/BankAccountTrackingAdapter.php new file mode 100644 index 0000000..3fc6d12 --- /dev/null +++ b/src/Adapter/BankAccountTrackingAdapter.php @@ -0,0 +1,214 @@ +httpPost($path, $request); + } + + public function retrievePayment($paymentId) + { + $path = "/payment/v1/card-payments/" . $paymentId; + return $this->httpGet($path); + } + + public function postAuthPayment($paymentId, array $request) + { + $path = "/payment/v1/card-payments/" . $paymentId . "/post-auth"; + return $this->httpPost($path, $request); + } + + public function init3DSPayment(array $request) + { + $path = "/payment/v1/card-payments/3ds-init"; + return $this->httpPost($path, $request); + } + + public function complete3DSPayment(array $request) + { + $path = "/payment/v1/card-payments/3ds-complete"; + return $this->httpPost($path, $request); + } + + public function initCheckoutPayment(array $request) + { + $path = "/payment/v1/checkout-payments/init"; + return $this->httpPost($path, $request); + } + + public function retrieveCheckoutPayment($token) + { + $path = "/payment/v1/checkout-payments/" . $token; + return $this->httpGet($path); + } + + public function createDepositPayment(array $request) + { + $path = "/payment/v1/deposits"; + return $this->httpPost($path, $request); + } + + public function init3DSDepositPayment(array $request) + { + $path = "/payment/v1/deposits/3ds-init"; + return $this->httpPost($path, $request); + } + + public function complete3DSDepositPayment(array $request) + { + $path = "/payment/v1/deposits/3ds-complete"; + return $this->httpPost($path, $request); + } + + public function createFundTransferDepositPayment(array $request) + { + $path = "/payment/v1/deposits/fund-transfer"; + return $this->httpPost($path, $request); + } + + public function initApmDepositPayment(array $request) + { + $path = "/payment/v1/deposits/apm-init"; + return $this->httpPost($path, $request); + } + + public function initGarantiPayPayment(array $request) + { + $path = "/payment/v1/garanti-pay-payments"; + return $this->httpPost($path, $request); + } + + public function initApmPayment(array $request) + { + $path = "/payment/v1/apm-payments/init"; + return $this->httpPost($path, $request); + } + + public function completeApmPayment(array $request) + { + $path = "/payment/v1/apm-payments/complete"; + return $this->httpPost($path, $request); + } + + public function createApmPayment(array $request) + { + $path = "/payment/v1/apm-payments"; + return $this->httpPost($path, $request); + } + + public function initPosApmPayment(array $request) + { + $path = "/payment/v1/pos-apm-payments/init"; + return $this->httpPost($path, $request); + } + + public function completePosApmPayment(array $request) + { + $path = "/payment/v1/pos-apm-payments/complete"; + return $this->httpPost($path, $request); + } + + public function retrieveLoyalties(array $request) + { + $path = "/payment/v1/card-loyalties/retrieve"; + return $this->httpPost($path, $request); + } + + public function refundPaymentTransaction(array $request) + { + $path = "/payment/v1/refund-transactions"; + return $this->httpPost($path, $request); + } + + public function retrievePaymentTransactionRefund($refundTransactionId) + { + $path = "/payment/v1/refund-transactions/" . $refundTransactionId; + return $this->httpGet($path); + } + + public function refundPayment(array $request) + { + $path = "/payment/v1/refunds"; + return $this->httpPost($path, $request); + } + + public function retrievePaymentRefund($refundId) + { + $path = "/payment/v1/refunds/" . $refundId; + return $this->httpGet($path); + } + + public function storeCard(array $request) + { + $path = "/payment/v1/cards"; + return $this->httpPost($path, $request); + } + + public function updateCard(array $request) + { + $path = "/payment/v1/cards/update"; + return $this->httpPost($path, $request); + } + + public function searchStoredCards(array $request) + { + $path = "/payment/v1/cards" . QueryBuilder::build($request); + return $this->httpGet($path); + } + + public function deleteStoredCard(array $request) + { + $path = "/payment/v1/cards/delete"; + return $this->httpPost($path, $request); + } + + public function approvePaymentTransactions(array $request) + { + $path = "/payment/v1/payment-transactions/approve"; + return $this->httpPost($path, $request); + } + + public function disapprovePaymentTransactions(array $request) + { + $path = "/payment/v1/payment-transactions/disapprove"; + return $this->httpPost($path, $request); + } + + public function checkMasterpassUser(array $request) + { + $path = "/payment/v1/masterpass-payments/check-user"; + return $this->httpPost($path, $request); + } + + public function updatePaymentTransaction($paymentTransactionId, array $request) + { + $path = "/payment/v1/payment-transactions/" . $paymentTransactionId; + return $this->httpPut($path, $request); + } + + public function is3DSecureCallbackVerified($threeDSecureCallbackKey, $params) + { + $hash = $params["hash"]; + $hashString = $threeDSecureCallbackKey . + "###" . $this->extractParam('status', $params) . + "###" . $this->extractParam('completeStatus', $params) . + "###" . $this->extractParam('paymentId', $params) . + "###" . $this->extractParam('conversationData', $params) . + "###" . $this->extractParam('conversationId', $params) . + "###" . $this->extractParam('callbackStatus', $params); + + $hashed = Signature::generateHash($hashString); + return $hash == $hashed; + } + + private function extractParam($key, $params){ + return isset($params[$key]) ? $params[$key] : ''; + } +}