PayU\Client::makePayment PHP Method

makePayment() public method

public makePayment ( PaymentRequest $request ) : PaymentResponse
$request Payu\Request\PaymentRequest
return Payu\Response\PaymentResponse
    public function makePayment(PaymentRequest $request)
    {
        $rawResponse = $this->sendRequest($request, $this->configuration->getPaymentEndpointUrl());
        $parser = new ResponseParser(new PaymentResponseParser(), $rawResponse);
        return $parser->parse();
    }

Usage Example

 public function testMakePayment()
 {
     $request = $this->client->createPaymentRequestBuilder()->buildCard('4282209027132016', '123', 5, 2019)->buildOrder('ORDERNO123456', '127.0.0.1')->buildBilling('John', 'Smith', '*****@*****.**', '05321231212')->buildAndAddProduct('The Product', 'PR1', 1, 10)->build();
     $result = $this->client->makePayment($request);
     $this->assertTrue($result instanceof PaymentResponse);
 }