diff --git a/samples/clone_stored_card.php b/samples/clone_stored_card.php index 73ccc40..c01c78a 100644 --- a/samples/clone_stored_card.php +++ b/samples/clone_stored_card.php @@ -3,9 +3,9 @@ require_once('config/sample_config.php'); $request = array( - 'sourceCardUserKey' => 'fac377f2-ab15-4696-88d2-5e71b27ec378', - 'sourceCardToken' => '11a078c4-3c32-4796-90b1-51ee5517a212', - 'targetMerchantId' => 1, + 'sourceCardUserKey' => 'fac377f2-ab15-4696-88d2-5e71b27ec378', + 'sourceCardToken' => '11a078c4-3c32-4796-90b1-51ee5517a212', + 'targetMerchantId' => 1, ); $response = SampleConfig::craftgate()->payment()->cloneCard($request); diff --git a/samples/create_member_as_buyer_and_sub_merchant.php b/samples/create_member_as_buyer_and_sub_merchant.php index b27da24..f0baed0 100644 --- a/samples/create_member_as_buyer_and_sub_merchant.php +++ b/samples/create_member_as_buyer_and_sub_merchant.php @@ -3,7 +3,6 @@ require_once('config/sample_config.php'); use Craftgate\Model\MemberType; -use Craftgate\Model\SettlementEarningsDestination; use Craftgate\Util\Guid; $request = array( diff --git a/samples/create_merchant.php b/samples/create_merchant.php index 02891f4..b070e27 100644 --- a/samples/create_merchant.php +++ b/samples/create_merchant.php @@ -2,10 +2,6 @@ require_once('config/sample_config.php'); -use Craftgate\Model\MemberType; -use Craftgate\Model\SettlementEarningsDestination; -use Craftgate\Util\Guid; - $request = array( 'name' => "newMerchant", 'legalCompanyTitle' => "legalCompanyTitle", diff --git a/samples/delete_merchant_pos.php b/samples/delete_merchant_pos.php index bde0aba..63110ba 100644 --- a/samples/delete_merchant_pos.php +++ b/samples/delete_merchant_pos.php @@ -1,13 +1,5 @@ ApmType::PAPARA, diff --git a/samples/init_bizum_apm_payment.php b/samples/init_bizum_apm_payment.php index e06b6c2..684b603 100644 --- a/samples/init_bizum_apm_payment.php +++ b/samples/init_bizum_apm_payment.php @@ -28,7 +28,7 @@ ) ), 'additionalParams' => array( - 'buyerPhoneNumber' => "34700000000", + 'buyerPhoneNumber' => "34700000000", ) ); diff --git a/samples/init_iwallet_apm_payment_with_card_password.php b/samples/init_iwallet_apm_payment_with_card_password.php index b79dfbd..8c99326 100644 --- a/samples/init_iwallet_apm_payment_with_card_password.php +++ b/samples/init_iwallet_apm_payment_with_card_password.php @@ -18,7 +18,7 @@ 'callbackUrl' => 'https://www.your-website.com/craftgate-apm-callback', 'apmUserIdentity' => '1111222233334444', 'additionalParams' => array( - "otpCode" => "1122" + "otpCode" => "1122" ), 'items' => array( array( diff --git a/samples/init_juzdan_payment.php b/samples/init_juzdan_payment.php index 39e0d4f..72cce0f 100644 --- a/samples/init_juzdan_payment.php +++ b/samples/init_juzdan_payment.php @@ -2,10 +2,10 @@ require_once('config/sample_config.php'); +use Craftgate\Model\ClientType; use Craftgate\Model\Currency; use Craftgate\Model\PaymentGroup; use Craftgate\Model\PaymentPhase; -use Craftgate\Model\ClientType; use Craftgate\Util\Guid; $request = array( @@ -47,6 +47,6 @@ 'loanCampaignId' => 1 ); -$response = SampleConfig::craftgate()->juzdan()-> initJuzdanPayment($request); +$response = SampleConfig::craftgate()->juzdan()->initJuzdanPayment($request); print_r($response); diff --git a/samples/init_metropol_apm_payment.php b/samples/init_metropol_apm_payment.php index 0f96d1b..945731b 100644 --- a/samples/init_metropol_apm_payment.php +++ b/samples/init_metropol_apm_payment.php @@ -8,28 +8,28 @@ use Craftgate\Util\Guid; $request = array( - 'apmType' => ApmType::METROPOL, - 'price' => 1, - 'paidPrice' => 1, - 'currency' => Currency::TL, - 'paymentGroup' => PaymentGroup::LISTING_OR_SUBSCRIPTION, - 'conversationId' => 'myConversationId', - 'externalId' => 'optional-externalId', - 'items' => array( - array( - 'externalId' => Guid::generate(), - 'name' => 'Item 1', - 'price' => 0.40 - ), - array( - 'externalId' => Guid::generate(), - 'name' => 'Item 2', - 'price' => 0.60 - ) + 'apmType' => ApmType::METROPOL, + 'price' => 1, + 'paidPrice' => 1, + 'currency' => Currency::TL, + 'paymentGroup' => PaymentGroup::LISTING_OR_SUBSCRIPTION, + 'conversationId' => 'myConversationId', + 'externalId' => 'optional-externalId', + 'items' => array( + array( + 'externalId' => Guid::generate(), + 'name' => 'Item 1', + 'price' => 0.40 ), - 'additionalParams' => array( - 'cardNumber' => '6375780115068760' + array( + 'externalId' => Guid::generate(), + 'name' => 'Item 2', + 'price' => 0.60 ) + ), + 'additionalParams' => array( + 'cardNumber' => '6375780115068760' + ) ); $response = SampleConfig::craftgate()->payment()->initApmPayment($request); diff --git a/samples/init_paymob_apm_payment.php b/samples/init_paymob_apm_payment.php index 0584823..61d9268 100644 --- a/samples/init_paymob_apm_payment.php +++ b/samples/init_paymob_apm_payment.php @@ -30,7 +30,7 @@ ), 'additionalParams' => array( 'integrationId' => '11223344' - ), + ), ); $response = SampleConfig::craftgate()->payment()->initApmPayment($request); diff --git a/samples/init_ykb_world_pay_pos_apm_payment.php b/samples/init_ykb_world_pay_pos_apm_payment.php index e9d0562..a34381e 100644 --- a/samples/init_ykb_world_pay_pos_apm_payment.php +++ b/samples/init_ykb_world_pay_pos_apm_payment.php @@ -3,8 +3,8 @@ require_once('config/sample_config.php'); use Craftgate\Model\Currency; -use Craftgate\Model\PosApmPaymentProvider; use Craftgate\Model\PaymentGroup; +use Craftgate\Model\PosApmPaymentProvider; use Craftgate\Util\Guid; $request = array( diff --git a/samples/retrieve_merchant_pos.php b/samples/retrieve_merchant_pos.php index 381efe5..5383145 100644 --- a/samples/retrieve_merchant_pos.php +++ b/samples/retrieve_merchant_pos.php @@ -1,12 +1,5 @@ Currency::USD, diff --git a/samples/update_merchant_pos_status.php b/samples/update_merchant_pos_status.php index ec38e8a..7287585 100644 --- a/samples/update_merchant_pos_status.php +++ b/samples/update_merchant_pos_status.php @@ -1,12 +1,6 @@ '584' ); -$isVerified = SampleConfig::craftgate()->hook()->isWebhookVerified($merchantHookKey,$incomingSignature, $webhookData); +$isVerified = SampleConfig::craftgate()->hook()->isWebhookVerified($merchantHookKey, $incomingSignature, $webhookData); print_r($isVerified); diff --git a/src/Adapter/MasterpassPaymentAdapter.php b/src/Adapter/MasterpassPaymentAdapter.php index bbbbe16..96ed3bc 100644 --- a/src/Adapter/MasterpassPaymentAdapter.php +++ b/src/Adapter/MasterpassPaymentAdapter.php @@ -2,9 +2,6 @@ namespace Craftgate\Adapter; -use Craftgate\Util\QueryBuilder; -use Craftgate\Util\Signature; - class MasterpassPaymentAdapter extends BaseAdapter { public function checkMasterpassUser(array $request) diff --git a/src/Adapter/PaymentAdapter.php b/src/Adapter/PaymentAdapter.php index 8e3b2b5..f305549 100644 --- a/src/Adapter/PaymentAdapter.php +++ b/src/Adapter/PaymentAdapter.php @@ -219,13 +219,13 @@ public function initBnplPayment(array $request) public function approveBnplPayment($paymentId) { - $path = "/payment/v1/bnpl-payments/" . $paymentId . "/approve"; + $path = "/payment/v1/bnpl-payments/" . $paymentId . "/approve"; return $this->httpPost($path); } public function verifyBnplPayment(array $request) { - $path = "/payment/v1/bnpl-payments/verify"; + $path = "/payment/v1/bnpl-payments/verify"; return $this->httpPost($path, $request); } diff --git a/src/Adapter/SettlementAdapter.php b/src/Adapter/SettlementAdapter.php index 327291f..a42c647 100644 --- a/src/Adapter/SettlementAdapter.php +++ b/src/Adapter/SettlementAdapter.php @@ -18,7 +18,7 @@ public function createPayoutAccount(array $request) return $this->httpPost($path, $request); } - public function updatePayoutAccount($id,array $request) + public function updatePayoutAccount($id, array $request) { $path = "/settlement/v1/payout-accounts/" . $id; return $this->httpPut($path, $request); diff --git a/src/Adapter/WalletAdapter.php b/src/Adapter/WalletAdapter.php index 8f2c063..c1cc7da 100644 --- a/src/Adapter/WalletAdapter.php +++ b/src/Adapter/WalletAdapter.php @@ -27,7 +27,7 @@ public function searchWalletTransactions($walletId, array $request) public function updateMemberWallet($memberId, $walletId, array $request) { - $path = "/wallet/v1/members/" . $memberId . "/wallets/". $walletId; + $path = "/wallet/v1/members/" . $memberId . "/wallets/" . $walletId; return $this->httpPut($path, $request); } diff --git a/src/Craftgate.php b/src/Craftgate.php index f025cfc..fe97815 100644 --- a/src/Craftgate.php +++ b/src/Craftgate.php @@ -125,6 +125,7 @@ public function juzdan() { return new JuzdanPaymentAdapter($this->options); } + public function bkmExpress() { return new BkmExpressPaymentAdapter($this->options); diff --git a/src/Util/Signature.php b/src/Util/Signature.php index e3f828b..bd8a802 100644 --- a/src/Util/Signature.php +++ b/src/Util/Signature.php @@ -22,6 +22,6 @@ public static function generateHash($hashString) public static function generateWebhookSignature($merchantHookKey, $hashString) { - return base64_encode(hash_hmac('sha256', $hashString, $merchantHookKey,true)); + return base64_encode(hash_hmac('sha256', $hashString, $merchantHookKey, true)); } }