How to integrate Skrill in CodeIgniter?

时间:2016-04-07 10:50:46

标签: php codeigniter payment-integration moneybookers

I am using codeigniter and looking for integration of Skrill payment gateway but didn't get exact information from anywhere. I have already follow steps from example but it's not going to redirect on my status-url (outside of CodeIgniter).

I have tried one another example with below code but it's also not working

    $config['pay_to_email']="abcdef@gmail.com";
    $config ['status_url'] = 'http://myserver/response.php';
    $config ['language'] = 'EN';
    $config ['amount'] = '1';
    $config ['currency'] = 'USD';
    $config ['return_url_text'] = 'Return to response.php';
    $config ['return_url'] = 'http://myserver/response.php';
    $config ['cancel_url'] = 'http://myserver/response.php';
    $config ['detail1_description'] = 'Membership';
    $url='https://www.moneybookers.com/app/payment.pl?';
    $vars=http_build_query($config);
    header('LOCATION:' . $url. $vars);

If I run above file on server then also it's not working as well as not redirect to response.php.

1 个答案:

答案 0 :(得分:0)

创建视图并发送数据......这只是一个示例

<html>
    <head>
        <title> Payment</title>
    </head>
    <body>
        <center>
        <?php
            $vars['pay_to_email']="abcdef@gmail.com";
            $vars['status_url'] = 'http://myserver/response.php';
            $vars['language'] = 'EN';
            $vars['amount'] = '1';
            $vars['currency'] = 'USD';
            $vars['return_url_text'] = 'Return to response.php';
            $vars['return_url'] = 'http://myserver/response.php';
            $vars['cancel_url'] = 'http://myserver/response.php';
            $vars['detail1_description'] = 'Membership';
        ?>
            <form action="https://www.moneybookers.com/app/payment.pl" method="post">
            <?php foreach($vars as $key=>$var){ ?>
              <input type="hidden" name="<?=$key?>" value="<?=$var?>"/>
              <?php } ?>
              <input type="submit" value="Pay!"/>
            </form>
        </center>
        <script language='javascript'>document.redirect.submit();</script>
    </body>
</html>