当前位置: 首页 > 知识库问答 >
问题:

拉维全向支付莫利错误

羊舌墨一
2023-03-14

我试图在我的网站上与Onmipay Mollie和Barryvdh Laravel Omnipay建立一个支付系统

当我想付款时,提交用于付款的表格。我得到一个错误:

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()}}

有什么东西不见了吗?我整个周末都在忙这个,但没有成功。有人能告诉我出了什么事吗?

仅供参考:我正在本地主机上执行此操作。不知道这是否有问题(不应该)

共有1个答案

司寇正志
2023-03-14

我也有同样的问题。它确实在重定向部分,我建议更改$响应-

返回重定向::离开($response)-

这会将用户从您的网站重定向到mollie支付URL,因为这将在打开并指定网关时生成。至少,这是我设法修复它的方式。

 类似资料:
  • 我的代码是: 结果是: 致命错误:未捕获异常'Mollie\Api\Exceptions\ApiExc0019',消息'执行API调用错误(422:不可处理实体):没有找到适合客户的任务。字段: CusterId. 我错过了什么吗??

  • 我使用realex支付与iframe我可以加载支付页面正确,但一旦我点击立即支付它返回错误: 508消息:处理您的请求发生了错误。请联系您购买的商品或服务引用以下错误代码的商家: 61,754(大多数时候它返回正确的响应字符串成功或拒绝),但有时它返回以上错误代码)任何想法是什么意思以及如何解决这个问题?

  • 我正在尝试使用PaymentIntent执行带区支付。我在stripe网站上读到了以下内容(链接) 在服务器上使用金额和货币创建PaymentIntent。始终要决定在服务器端(一个受信任的环境)而不是客户端收取多少费用。这就防止了恶意客户能够自行选择价格。 我不明白如何决定在服务器端收取多少费用。我的应用程序有一系列的项目要买,每一个项目都有价格应用程序是一个市场和价格清单在客户端,所以我决定多

  • 说明 用于门店结账时生成桌台微信二维码(2015-07-01新增) 使用时将返回的code_url内容直接生成二维码。 请求地址 http://api.dc78.cn/Api/cash_qr_wxpay 请求方式 GET 请求参数 参数 参数名称 必填 描述 范例 table 桌台 bzid 结算业务单号 amt 结账金额 type 支付通道 wx=微信支付,ali=支付宝支付 返回 { "sta

  • 用于生成微信/支付宝支付二维码。(微信即将停用此接口,建议使用2.9代替) 请求参数说明 参数 描述 必填 示例值 类型 最大长度 action 接口参数组 是 object └action 需要调用的接口名称 是 cash_qr_wxpay string get GET参数组,本组参数需要参与签名 是 object └type 类型, wx=微信,ali=支付宝 是 wx string └amt

  • 下面的代码在javascript工作,它返回的响应的付款方式,例如'PM_1HZDPTHMQMK5H2YU0KAI****',我用这个付款方式收取付款,下面是条带的响应。 “提供的PaymentMethod以前与没有客户附件的PaymentIntent一起使用,与没有客户附件的连接帐户共享,或者与客户分离。它不能再次使用。若要多次使用PaymentMethod,必须先将其附加到客户”。 问题是,我