Omnipay\PayPal\ExpressGatewayTest::testCompletePurchaseCustomOptions PHP Method

testCompletePurchaseCustomOptions() public method

    public function testCompletePurchaseCustomOptions()
    {
        $this->setMockHttpResponse('ExpressPurchaseSuccess.txt');
        // Those values should not be used if custom token or payerid are passed
        $this->getHttpRequest()->query->replace(array('token' => 'GET_TOKEN', 'PayerID' => 'GET_PAYERID'));
        $response = $this->gateway->completePurchase(array('amount' => '10.00', 'currency' => 'BYR', 'token' => 'CUSTOM_TOKEN', 'payerid' => 'CUSTOM_PAYERID'))->send();
        $httpRequests = $this->getMockedRequests();
        $httpRequest = $httpRequests[0];
        parse_str((string) $httpRequest->getBody(), $postData);
        $this->assertSame('CUSTOM_TOKEN', $postData['TOKEN']);
        $this->assertSame('CUSTOM_PAYERID', $postData['PAYERID']);
    }