0

現在、ユーザーをペイパルに直接リダイレクトして支払いを行っているショッピング カートがあります。顧客がサイトにクレジット カードを入力し、paypal で処理できるようにしたいと考えています。Paypal Pro アカウントを持っていますが、使用できません。Omnipay 経由で Paypal Pro パッケージを使用する方法がわかりません。私のvendorsフォルダにはExpressGateway.phpとがありますが、ページProgateway.phpを呼び出す方法がわかりません。Progateway.php私がそれを設定する唯一の方法は、Omnipay::getway('paypal')私が現在エクスプレスで行っているものを使用することです。Paypal Pro を使用するために必要なプロセスは何ですか?

        $gateway = Omnipay::gateway('paypal');

        if(Auth::user() != NULL && Auth::user()->super_user == 1) {

            //sandbox

            $gateway->setUsername('#######');
            $gateway->setPassword('#######');
            $gateway->setSignature('#######');

            $gateway->setTestMode('true');
        } else {

            //production

            $gateway->setUsername('#######');
            $gateway->setPassword('#######');
            $gateway->setSignature('######');
        }

        $cardInput = array(
            'firstName' => $info['first_name_bill'],
            'lastName' => $info['last_name_bill'],
            'billingAddress1' => $info['street_address_1_bill'],
            'billingAddress2' => $info['street_address_2_bill'],
            'billingPhone' => $info['phone_bill'],
            'billingCity' => $info['city_bill'],
            'billingState' => $info['state_bill'],
            'billingPostCode' => $info['zip_bill'],
            'shippingAddress1' => $info['street_address_1_ship'],
            'shippingAddress2' => $info['street_address_2_ship'],
            'shippingPhone' => $info['phone_ship'],
            'shippingCity' => $info['city_ship'],
            'shippingState' => $info['state_ship'],
            'shippingPostCode' => $info['zip_ship'],
        );

        $card = Omnipay::creditCard($cardInput);

        $response = Omnipay::purchase(
            array(
                'cancelUrl' => URL::to('cart'),
                'returnUrl' => URL::action('CartController@getSuccessPayment', array('id' =>$invoice->id)),
                'amount' => Input::get('total'),
                'currency' => 'USD',
                'card' => $card,
                'description' => '#####'
            )
        )->send();`
4

1 に答える 1

0

ゲートウェイを次のように設定します。

$gateway = Omnipay::gateway('Paypal_Pro');
于 2015-01-18T14:19:50.387 に答える