Paypal购物车自定义创建订单对象和用户详细信息 [英] Paypal shopping cart custom create order objects and user details

查看:393
本文介绍了Paypal购物车自定义创建订单对象和用户详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个购物车,里面有一个数组或我的物品。我将所有客户用户详细信息序列化为表单和jQuery。我想从我的用户详细信息表单中插入用户数据(也许我使用付款人或payer_info?对象。我也想将我的物品插入PayPal



I have a shopping cart that holds an array or my objects. I have all my customer user details serialized with a form and jQuery. I would like to insert the user data I got from my user details form (maybe I use payer or payer_info? Object. Also I would like to insert my items to the paypal

CreateOrder:        actions.order.create({



我猜这样做是这样的吗?




I am guessing I do it like this?

"item_list": {
"items": [
{
"name": "hat",
"description": "Brown color hat",
"quantity": "5",
"price": "3",
"tax": "0.01",
"sku": "1",
"currency": "USD"
},
{
"name": "handbag",
"description": "Black color hand bag",
"quantity": "1",



或者在




OR maybe in

"data": {



我可以为paypal订单类拥有自己的自定义对象。任何人都可以给我一个例子或更多的输入,我将如何做到这一点。在developer.paypal.com/docs中,我一直在阅读javascript / php的所有不同的项目SDK我想使用我的javascript来插入信息



这就是我所拥有的


and I can have my own custom objects for the paypal order class. Could any one give me an example or more input on how I will do this. In the developer.paypal.com/docs I been reading pretty much all the different project SDKs for javascript / php I would like to use my javascript to insert the information

This is what I have

$fname = $_POST['txtFirstname'];
    $lname = $_POST['txtLastname'];
    $email = $_POST['txtEmail'];
var totalPrice = <?php echo $newTotal; ?>

paypal.Buttons({
    createOrder: function(data, actions) {
        // setup transaction
        return actions.order.create({
            payer: {
                name:
            },
            purchase_units: [{
               amount: {
                   value: totalPrice
               } 
            }]
        });
    },





我的尝试:



我尝试了多种不同的方式将我的项目插入到创建顺序中。我一直在阅读paypal开发文档,我只需要更多一点参考1个自定义项目并从我的自定义变量中插入用户详细信息并生成它



What I have tried:

I have tried multiple different ways to insert my items into the create order. I been reading the paypal development docs and i just need a little bit more just a reference for 1 custom item and to insert the user details from my custom variables and ill have it

推荐答案

fname =


_POST [' txtFirstname'];
_POST['txtFirstname'];


lname =


这篇关于Paypal购物车自定义创建订单对象和用户详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆