0

私のomnipay laravel 4とPayfastの統合を完了しようとしています。トランザクションを正常に実行できるようになりましたが、notify_url を機能させるのに問題があります。

$gateway = Omnipay::create('PayFast');
    $gateway->setMerchantId = '10000100';
    $gateway->setMerchantKey = '46f0cd694581a';

    $response = $gateway->purchase([
            'merchant_id' => '10000100',
            'merchant_key' => '46f0cd694581a', 
            'return_url' => 'http://signup.areweup.co.za/return',
            'cancel_url' => 'http://signup.areweup.co.za/cancel',
            'notify_url' => 'http://signup.areweup.co.za/notify',
            'name_first' => 'Warren',
            'name_last'  => 'Hansen',
            'm_payment_id' => '8542',
            'amount' => '39.00', 
            'item_name' => 'Are We Up',
            'description' => 'Peace of mind at just R39 a month.'
            ])->send();

    if ($response->isSuccessful()) {
        // payment was successful: update database
        print_r($response);
    } elseif ($response->isRedirect()) {
        // redirect to offsite payment gateway
        $response->redirect();
    } else {
        // payment failed: display message to customer
        echo $response->getMessage();
    }

ITN 応答を受信するための POST ルート設定があります

                $gateway = Omnipay::create('PayFast');
            $gateway->setMerchantId = '10000100';
            $gateway->setMerchantKey = '46f0cd694581a';

            $response = $gateway->CompletePurchase([
                    'merchant_id' => '10000100',
                    'merchant_key' => '46f0cd694581a', 
                    'return_url' => 'http://signup.areweup.co.za/return',
                    'cancel_url' => 'http://signup.areweup.co.za/cancel',
                    'notify_url' => 'http://signup.areweup.co.za/notify',
                    'name_first' => 'Warren',
                    'name_last'  => 'Hansen',
                    'm_payment_id' => '8542',
                    'amount' => '39.00', 
                    'item_name' => 'Are We Up',
                    'description' => 'Peace of mind at just R39 a month.'
                    ])->send();

            if ($response->isSuccessful()) {
                // payment was successful: update database
                print_r($response);
            } elseif ($response->isRedirect()) {
                // redirect to offsite payment gateway
                $response->redirect();
            } else {
                // payment failed: display message to customer
                echo $response->getMessage();
            }   

notify_url の唯一の違いは、CompletePurchase メソッドを呼び出していることです。ここで何か助けていただければ幸いです。ITN Payfast のドキュメントはこちら: payfast itn documentation

4

1 に答える 1

0

Payfast は、returnUrl支払いの返品と通知の両方に を使用します。

https://github.com/omnipay/payfast/blob/master/src/Omnipay/PayFast/Message/PurchaseRequest.php#L52

したがってcompletePurchase()、リターン URL にリクエストを配置し、通知 URL を削除するだけです。

于 2014-01-29T08:18:24.150 に答える