public function setUp() { $configuration = new Configuration(); $configuration->setMerchantId('MY_MERCHANT_01')->setSecretKey('SECRET_KEY')->setPaymentEndpointUrl('https://secure.payu.com.tr/order/alu/v3')->setLoyaltyInquiryEndPointUrl('https://secure.payu.com.tr/api/loyalty-points/check'); $this->configuration = $configuration; $this->client = new Client($configuration); }
protected function calculateHash($rawData) { ksort($rawData); $buffer = ''; foreach ($rawData as $key => $value) { $buffer .= strlen($value) . $value; } return hash_hmac('md5', $buffer, $this->configuration->getSecretKey()); }
public function testTokenEndPointUrl() { $this->configuration->setTokenEndPointUrl('TestTokenEndPointUrlSetter'); $this->assertEquals('TestTokenEndPointUrlSetter', $this->configuration->getTokenEndPointUrl()); }
public function testSet3DReturnUrl() { $this->configuration->setReturnUrl('Test3DReturnUrlSetter'); $this->assertEquals('Test3DReturnUrlSetter', $this->configuration->getReturnUrl()); }
/** * @param LoyaltyInquiryRequest $request * @return Response\LoyaltyInquiryResponse */ public function makeLoyaltyInquiry(LoyaltyInquiryRequest $request) { $rawResponse = $this->sendRequest($request, $this->configuration->getLoyaltyInquiryEndPointUrl()); $parser = new ResponseParser(new LoyaltyInquiryResponseParser(), $rawResponse); return $parser->parse(); }
public function testSetLoyaltyInquiryEndPointUrl() { $this->configuration->setLoyaltyInquiryEndPointUrl('TestLoyaltyInquiryEndPointUrlSetter'); $this->assertEquals('TestLoyaltyInquiryEndPointUrlSetter', $this->configuration->getLoyaltyInquiryEndPointUrl()); }