Arkadaşlar, bir projede kullanmak istediğim bir servis var. Mobil operatorle ilgili.
Kullanıcıya verilen şifreyi servis kullanarak doğrulamak gerekiyor. Doğruladığı taktirde ürünün fiyatında yüzde 10 indirim yapması lazım.
bu konuda yardımcı olabilecek biri var mı acaba?
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 10:02:29 -->-> Daha önceki mesaj 09:54:20 --
We have 3 web service methods :
- Calculate
- Complete
- Cancel
- Calculate Method
* Parameters are : authentication key, identical code, terminal code, amount
* Response is complex type(CalculateResult). CalculateResult has 3 fields. CalculateStatus,discountPercent and discountedAmount.
Note : İf Calculate status is SUCCESS then discount percent and discounted Amount fields are bigger than zero. For other statuses please ignore discount percent and discounted amount fields.
- Complete Method
* Parameters are : authentication key, identical code, terminal code, payment type
* Response is LoyaltyProgramResultStatus status.
Note : Payment type is either CASH or CREDİT_CARD
- Cancel Method
* Parameters are : authentication key, identical code, terminal code, payment type
* Response is LoyaltyProgramResultStatus status.
Elimde bu var. ve bir de servis linki tabiki
PHP ile wsdl servisten veri karşılaştırma doğrulama
1
●346
- 01-10-2013, 11:02:29
- 01-10-2013, 11:25:54Kabala karaladım, doğruluğuna garanti veremem, servis adresini düzeltip dene, verdiğin bilgilere göre bu şekilde olması lazım.
<?php /* * Sinan Turgut * * Test usage * $svc = new anarsamadov(); * $rezult = $svc->Calculate('xx','yy','zz','mm'); * $rezultStatus = $rezult['CalculateStatus']; * $rezultdiscountPercent = $rezult['discountPercent']; * */ class anarsamadov{ protected $client; public function __construct() { $this->client = new SoapClient( "http://servis.asmx?WSDL", array( 'trace'=>true, 'encoding'=>'UTF-8' ) ); } public function __destruct() { unset($this->client); } public function Calculate($AuthenticationKey, $IdenticalCode, $TerminalCode, $Amount){ try { $rezult = $this->client->Calculate($AuthenticationKey, $IdenticalCode, $TerminalCode, $Amount); } catch ( Exception $e ) { throw new Exception("Unable to send Calculate request: ".$e->getMessage() ); } $r = (array)$rezult; $t = (array)$r['CalculateResult']; return $t; } } ?>