diff --git a/samples/purchase.php b/samples/purchase.php index e776aa9..8182b7c 100644 --- a/samples/purchase.php +++ b/samples/purchase.php @@ -21,7 +21,31 @@ $gateway->setMerchantUser('test@yasinkuyu.net'); $gateway->setMerchantPassword('Paratika123'); $gateway->setSecretKey('QOClasdJUuDDWasdasdasd'); -$gateway->setBank('ISBANK'); + +$gateway->setBin("545616"); +$gateway->setMode("api"); +try { + $cardNetwork = 'UNKNOWN'; + $options = [ + 'queryAction' => 'QUERYBIN' + ]; + + $response = $gateway->query($options)->send(); + if ($response->isSuccessful()) { + $details = $response->getQueryDetails(); + if($details['responseCode'] = "00"){ + $cardNetwork = $details['bin']['cardNetwork']; + } + + } else { + exit($response->getMessage()); + } + + +} catch (\Exception $e) { + echo $e->getMessage(); +} +$gateway->setBank($cardNetwork); $gateway->setMode("NonDirectPost3D"); //Diğer paremetreler: api DirectPost3D NonDirectPost3D