贝宝付款表单,可将​​客户信息发送到我的电子邮件并同时进行付款

如何解决贝宝付款表单,可将​​客户信息发送到我的电子邮件并同时进行付款

我在这里想要做的是请客户以表格形式填写其姓名,地址,邮政编码等,这将把他带到贝宝付款(“立即付款”按钮)并发送我输入的输入值。

我要这些东西的原因是因为这项工作意味着要清洁窗户,留下标价的文件,客户要去网站并通过贝宝付款,但是要确认他的付款,我需要地址。贝宝和电子邮件之间的付款确认主要是发送时间和金额,不列颠哥伦比亚贝宝没有提供任何客户信息。

我有一个想法,只在付款完成后才发送电子邮件,但这是在Paypal上的,所以我对此一无所知。

我尝试过使用脚本调用两个动作,但是只有一个动作发生。我还尝试过将 inputs 设置在另一种形式上,但是该按钮使用脚本来调用它们,但是仍然只有一个可以执行操作。

我真的很需要这个,这对于网站来说是必不可少的,我只是无法做到这一点,我一直在努力寻找任何可行的方法,虽然确实找到了类似的问题,但是我的问题仍然存在。

HTML:


<form target="_blank"  action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" >
    <input type="hidden" name="cmd" value="_xclick">

    <input type="hidden" name="business" value="example@hotmail.com">
    
    <!-- Payment Info -->
    <input type="hidden" name="item_name" value="Window Cleaning">
    <input type="hidden" name="item_number" value="1">
    <input type="hidden" name="currency_code" value="GBP">
    <input type="hidden" name="tax" value="0.50">
    
    <input name="shipping" type="hidden" value="0.00">
    <input name="cancel_return" type="hidden" value="http://localhost/Window_Cleaner/menu/payment_confirmation/cancel.html" >

    <!-- Client Data -->
    <!-- Set variables that override the address stored with PayPal. -->
    <div id="divContainer" style="width: 90%;">
        
        <input  name="amount" placeholder="Amount">.50£<br>
        <input  name="first_name" placeholder="First Name" required>
        <input  name="last_name" placeholder="Last Name" required><br>
        <input  style="width: 72%; padding: 10px; margin: 5px;" name="address" placeholder="Address" required><br>
        <input  name="city" placeholder="City" >
        <input  name="zip" placeholder="Post Code" required><br>
    </div>
    <br>
    <!-- Button Pay Now -->
    
    <button class="paypalpaybutton" name="submit" >
        <input  style="width: 70px; height: 18px;" type="image"  src="http://localhost/Window_Cleaner/pictures/paypal/pp.png" border="0" alt="PayPal – The safer,easier way to pay online!">
    </button>
</form >

PHP:

<?php //For paypal Form

    if(isset($_POST['submit'])) {
        $amount=$_POST["amount"];
        $fname=$_POST["first_name"];
        $lname=$_POST["last_name"];
        $address=$_POST["address"];
        $city=$_POST["city"];
        $zip=$_POST["zip"];
        
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        function sanitize_my_email($field) {
            $field = filter_var($field,FILTER_SANITIZE_EMAIL);
            if (filter_var($field,FILTER_VALIDATE_EMAIL)) {
                return true;
            } else {
                return false;
            }
        }   
        $to_email = 'example@gmail.com';
        $subject = 'Payment of Marco\'s Window Cleaning Service';
        //$message;
        $headers = "From: $fname $lname <example@hotmail.com>";//this email is actually my own,as i dont ask for a email,not needed
        $message = "I'm your client,$fname $lname and I have paid $amount £ for the Window Cleaning service you have provided me with.
        
        Address: $address
        City: $city
        Post Code: $zip
        
    **Always confirm the payment and its value on your own paypal account.
        
        
    Regards,Marco's Window Cleaning";
            
        mail($to_email,$subject,$message,$headers);
        ////////////////////////////////////////////////////////////////////////////////////////////////////
    }
?>

CSS:

    #divContainer input{
        width: 35%;
        padding: 10px; 
        margin: 6px;
        border-radius: 25px;
        border: 0,1px solid black;
        font-size: 16px;
    }
        
    #divContainer input:active{
        border-radius: 15px;
    }
    #divContainer input:focus{
        border-radius: 15px;
    }

    .paypalpaybutton{
        cursor: pointer;
        background-color: #3671b0;
        border-radius: 35px;
        width: 370px;
        height: 40px;
        border: none;
    }
    
    .paypalpaybutton:hover{
        background-color: #3c7dc3;
    }

解决方法

一次只能执行一项操作。

哪种选择最先发生,以及它如何可靠地触发第二种发生,是一种设计选择。这样做有多种方法,各有其自身的复杂性和权衡点。

最简单的解决方案是创建向您发送电子邮件的表单,然后在结果页面上(或在提交数据的ajax / XHR / fetch调用之后)具有一个按钮,以便用户付款。您会收到有关用户尚未付款的邮件,并且他们可能会也可能不会成功进行付款,原因可能是用户未点击付款或付款被拒。

让他们在填写表格之前提交付款也有弊端,因为您可能会收到付款,然后无法获得所需的信息。

要避免上述任何一个缺点并以可靠的方式跟踪这两件事,您需要一台具有数据库和编程逻辑的服务器,而这需要编写。

如果您不想自己编写,则第三方工具/插件可能会提供一种现成的解决方案,您可以搜索该解决方案。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-