public function setUp()
 {
     $this->processPaymentByCardRequest = new ProcessPaymentByCardRequest();
     $this->processPaymentByCardRequest->setRequestId("request_id");
     $this->processPaymentByCardRequest->setExtAuthSuccessUri("http://somewhere.com/success");
     $this->processPaymentByCardRequest->setExtAuthFailUri("http://somewhere.com/fail");
     $this->processPaymentByCardRequest->setMoneySource('1222233334444555');
     $this->processPaymentByCardRequest->setCsc("000");
 }
Exemplo n.º 2
0
    $params["property_2"] = "3020052";
    $params["sum"] = "2.00";
    $params["test_payment"] = "true";
    $params["test_result"] = "success";
    $apiFacade = YandexMoney::getApiFacade();
    $apiFacade->setLogFile(__DIR__ . '/ym.log');
    $response = null;
    try {
        $response = $apiFacade->requestPaymentShop($token, $params);
        $requestId = $response->getRequestId();
        $processPaymentByCardRequest = new ProcessPaymentByCardRequest();
        $processPaymentByCardRequest->setRequestId($requestId);
        $processPaymentByCardRequest->setMoneySource('1222233334444555');
        $processPaymentByCardRequest->setCsc('222');
        $processPaymentByCardRequest->setExtAuthSuccessUri('http://abracadabra.fafa.by/success');
        $processPaymentByCardRequest->setExtAuthFailUri('http://abracadabra.fafa.by/fail');
        $response = $apiFacade->processPaymentByCard($token, $processPaymentByCardRequest);
    } catch (\Exception $e) {
        echo $e->getMessage();
    }
    $result = 'Empty result';
    if ($response != null) {
        $result = $response->isSuccess() ? 'status=' . $response->getStatus() : 'error=' . $response->getError();
    }
    return new Response($result, 200);
});
/**
 *  app route
 */
$app->get('/incoming-transfer-accept', function (Request $request) use($app) {
    $token = $app['session']->get('token');