twilio php:从用户收集信息

时间:2016-06-10 19:16:47

标签: twilio-php

我想使用twilio存储用户的信用卡信息。 我已经使用这些代码这样做了。 一旦用户输入卡号,我想在收集16位数后,它应该转移到用户询问cvv

代码:

<?php

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>


<Response>
 <Gather numdigits="16" action="gather1.php" method="GET">
   <Say>
            Please enter your account number,
            followed by the pound sign
    </Say>
    </Gather>

    <Gather numdigits="3" action="gather2.php" method="GET">
   <Say>
            Please enter your cvv  number,
            followed by the pound sign
    </Say>
    </Gather>


    <Gather numdigits="2" action="gather3.php" method="GET">
   <Say>
            Please enter your card expiration month,
            followed by the pound sign
    </Say>
    </Gather>
    <Gather numdigits="4" action="gather4.php" method="GET">
   <Say>
            Please enter your card expiration year,
            followed by the pound sign
    </Say>
    </Gather>

    <Say>We didn't receive any input. Goodbye!</Say>


</Response>

收集:PHP

      <?php

    // page located at http://example.com/process_gather.php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<Response><Say>You entered " . $_REQUEST['Digits'] . "</Say>        </Response>";
?> 
<response>
<say> 
<Gather numDigits="1"  action="gather_handle.php" method="POST">
If the above information is correct, please press 1."
If the above information is not correct,please press 2.
</Gather>
</say>
</response>

0 个答案:

没有答案