1

CI-Merchant と 3D セキュアを使用して Cardsave の統合に成功した人はいますか?

これで、3D セキュアが自分の Web サイトに応答するようになりました (他の問題が発生した場合は、パラメーターとして「return_url」をパラメーターとして追加する必要があるようです)。認証に成功した実際のカードまたはテスト 3D セキュア カード。

残念ながら、CI-Merchant Web サイトには Cardsave ドライバーのドキュメントはなく、Paypal の例のみです。

失敗したトランザクションは Cardsave アカウントのどこにも表示されないため、その時点で CI-Merchant が Cardsave と通信しているかどうかさえわかりません。

テストに使用しているコードの例を次に示します。

public function test_live_payment()
    {
        $this->load->library('merchant');

        $creditcard = $this->input->post('creditcard');
        $creditcardtype = $this->input->post('creditcardtype');
        $cardmonth = $this->input->post('cardmonth');
        $cardyear = $this->input->post('cardyear');
        $cardsecurecode = $this->input->post('cardsecurecode');
        $cardnameon = $this->input->post('cardnameon');
        $address1 = $this->input->post('address1');
        $address2 = $this->input->post('address2');
        $city = $this->input->post('city');
        $postcode = $this->input->post('postcode');


        $data['status'] = '';
        $data['message'] = '';

        $test = TRUE;

            if ($test) :

                  $settings = array (
                    'merchant_id' => 'TEST ACCOUNT',
                    'password' => 'XXXX'
                );



            else :

                $settings = array (
                    'merchant_id' => 'LIVE ACCOUNT',
                    'password' => 'XXXX'
                );


            endif;


        if ($_POST) :

            $this->merchant->load('cardsave');


            $this->merchant->initialize($settings);

            $data['transaction_id'] = '999' . rand(1, 999);

            $params = array(
                            'amount' => '1.00',
                            'currency' => 'GBP',
                            'card_no' => $creditcard,
                            'name' => $cardnameon,
                            'exp_month' => $cardmonth,
                            'exp_year' => 20 . $cardyear,
                            'csc' => $cardsecurecode,
                            'transaction_id' => $data['transaction_id'],
                            'description' => 'Test payment',
                            'address1' => $address1,
                            'address2' => $address2,
                            'city' => $city,
                            'postcode' => $postcode,
                            'return_url' => site_url('/test-payment')
                 );

                 $response = $this->merchant->purchase($params);


                if ($response->success()) :
                    $gateway_reference = $response->reference();

                    $data['status'] = 'Success';
                    $data['message'] = 'The transaction was successfully processed';

                else :

                    $message = $response->message();

                    $data['status'] = 'Failed';

                    if ( ! empty($message)) :
                        $data['message'] = $message;
                    else :
                        $data['message'] = 'Transaction failed. No further details received.';
                    endif;

                endif;



        endif;


        $this->load->view('test_payment_form', $data);


    }
4

1 に答える 1

1

1.リターンURLを渡していることを確認し、2. purchase_return() 関数を含む新しい関数にリターンURLを送信することで、私自身の問題を解決したようです。これが私の完全な(テスト)コードです:

public function test_live_payment()
    {
        $this->load->library('merchant');

        $creditcard = $this->input->post('creditcard');
        $creditcardtype = $this->input->post('creditcardtype');
        $cardmonth = $this->input->post('cardmonth');
        $cardyear = $this->input->post('cardyear');
        $cardsecurecode = $this->input->post('cardsecurecode');
        $cardnameon = $this->input->post('cardnameon');
        $address1 = $this->input->post('address1');
        $address2 = $this->input->post('address2');
        $city = $this->input->post('city');
        $postcode = $this->input->post('postcode');


        $data['status'] = '';
        $data['message'] = '';

        $test = TRUE;

            if ($test) :

                  $settings = array (
                    'merchant_id' => 'TEST ACCOUNT',
                    'password' => 'XXXX'
                );



            else :

                $settings = array (
                    'merchant_id' => 'LIVE ACCOUNT',
                    'password' => 'XXXX'
                );


            endif;


        if ($_POST) :

            $this->merchant->load('cardsave');


            $this->merchant->initialize($settings);

            $data['transaction_id'] = '999' . rand(1, 999);

            $data['transaction_id'] = '999' . rand(1, 999);

            $newdata = array(
                   'transaction_id'  => $data['transaction_id']
                   );

           $this->session->set_userdata($newdata);

            $params = array(
                            'amount' => '1.00',
                            'currency' => 'GBP',
                            'card_no' => $creditcard,
                            'name' => $cardnameon,
                            'exp_month' => $cardmonth,
                            'exp_year' => 20 . $cardyear,
                            'csc' => $cardsecurecode,
                            'transaction_id' => $data['transaction_id'],
                            'description' => 'Test payment',
                            'address1' => $address1,
                            'address2' => $address2,
                            'city' => $city,
                            'postcode' => $postcode,
                            'return_url' => site_url('/test-payment-response')
                 );

                 $response = $this->merchant->purchase($params);


                if ($response->success()) :
                    $gateway_reference = $response->reference();

                    $data['status'] = 'Success';
                    $data['message'] = 'The transaction was successfully processed';

                else :

                    $message = $response->message();

                    $data['status'] = 'Failed';

                    if ( ! empty($message)) :
                        $data['message'] = $message;
                    else :
                        $data['message'] = 'Transaction failed. No further details received.';
                    endif;

                endif;



        endif;


        $this->load->view('test_payment_form', $data);


    }



    public function test_response()
    {
        $settings = array (
                    'merchant_id' => 'TEST ACCOUNT',
                    'password' => 'XXXX'
                );


        $this->load->library('merchant');
        $this->merchant->load('cardsave');
        $this->merchant->initialize($settings);

        $data['transaction_id'] = $this->session->userdata('transaction_id');


        $params = array(
                            'amount' => '1.00',
                            'currency' => 'GBP',
                            'transaction_id' => $data['transaction_id']

                 );

        $response = $this->merchant->purchase_return($params);

        if ($response->success()) :
                    $gateway_reference = $response->reference();

                    $data['status'] = 'Success';
                    $data['message'] = 'The transaction was successfully processed';

                else :

                    $message = $response->message();

                    $data['status'] = 'Failed';

                    if ( ! empty($message)) :
                        $data['message'] = $message;
                    else :
                        $data['message'] = 'Transaction failed. No further details received.';
                    endif;

                endif;


        $this->load->view('test_payment_form', $data);



    }
于 2014-06-11T07:46:59.873 に答える