1

Onmipay-MollieBarryvdh-Laravel-Omnipayを使用して、Web サイトで支払いシステムを作成しようとしています。

「支払い」を行いたい場合、支払いに使用するフォームを送信します。エラーが発生します:

Omnipay \ Common \ Exception \ RuntimeException

This response does not support redirection.

マイ ルート ファイル:

Route::get('mollietest', ['uses'=>'PurchaseController@index','as'=>'purchase.index']);
Route::get('paymenturl', ['uses'=>'PurchaseController@create','as'=>'purchase.create']);
Route::post('paymenturl', ['uses'=>'PurchaseController@store','as'=>'purchase.store']);
Route::get('checkout', ['uses'=>'PurchaseController@show','as'=>'purchase.show']);

そして私の PurchaseController:

public function index()
    {
        return View::make('mollie');
    }

public function create()
{
    // get list of issuers
    $gateway = Omnipay::create('Mollie');
    $gateway->setApiKey(mytestapi);

    $payment = $gateway->fetchPaymentMethods()->send();
    if($payment->isSuccessful()){
        $pay = $payment->getPaymentMethods();
    }


    $henk = $gateway->fetchIssuers()->send();
    if($henk->isSuccessful()){
        $issuers = $henk->getIssuers();
    }

    return View::make('gewoonbetalen')
        ->with(['issuers'=>$issuers,'pay'=>$pay]);
}

public function store()
{
    // make payment
    $gateway = Omnipay::create('Mollie');
    $gateway->setApiKey(mytestapi);

    $order_id = time();
    $params = array(
                    'amount'=>'10.00',
                    'description'=> time(),
                    'method'=>Input::get('paymentmethod'),
                    'returnUrl'=>URL::route('purchase.show'),
                    'redirectUrl'=>URL::route('purchase.show'),
                    'metadata'=> array(
                                    'order_id' => $order_id,
                                ),
                    'issuer'=>Input::get('issuer'),
                    );
    $response = $gateway->purchase($params)->send();

    Log::error('blablalllll');

    if($response->isRedirect()){
         $response->redirect(); 
    } elseif($reponse->isPending()) {
        return "Pending, Reference: ". $response->getTransactionReference();
    } else {
        return "Error " .$response->getCode() . ': ' .$response->getMessage();
    }
}

public function show($id)
{
    $gateway = Omnipay::create('Mollie');
    $gateway->setApiKey(mytestapi);
    $response = $gateway->completePurchase()->send();

    $data = $response->getData();

    print_r($data);

}

paymenturl ビュー:

{{Form::open(array('action'=>'purchase.store','method'=>'POST'))}}

    <select name="paymentmethod">
        @foreach($pay as $payment)
            <option value="{{$payment->getId() }}">{{$payment->getName()}}</option>
        @endforeach
    </select>

    <select name="issuer">
        @foreach($issuers as $issuer)
        <option value="{{ $issuer->getId() }}" name="issuer">{{$issuer->getName();}}</option>
        @endforeach
        <option value="1">of wat anders</option>
    </select>

    {{Form::submit()}}
{{Form::close()}}

何か足りないものはないか、それとも何か?私はこの週末ずっと忙しかったのですが、成功していません。何が悪いのか教えてくれる人はいますか?

参考までに: 私は自分のローカルホストでこれを行っています。これが問題かどうかはわかりません (問題はないはずです)

4

1 に答える 1