printdotio / pio.js

An embeddable widget that enables users to quickly and easily monetize a webpage by enabling photo-product sales of its images.
4 stars 0 forks source link

Order history and refund functionalities #98

Open rughvi opened 9 years ago

rughvi commented 9 years ago

Hi team, As part of WEB widget where can I find ORDER HISTORY and REFUND functionalities?

Many thanks, Venkat V R

rughvi commented 9 years ago

Hi team, Also as part of web widget, after placing an order and successful payment, how can I get the orderId / transactionId from web widget so as to store it in my server - is there an event where I can get the transactionId / orderId?

Ta, Venkat V R

micahasmith commented 9 years ago

hi @rughvi

if you look at http://print.io/platform-web-documentation#onEvent in the "onEvent" section, you'll see code for subscribing to that event--

            else if(key==="onOrderSubmit"){
                // contains data similar to analytics ecommerce events
                // == full order data
            }
rughvi commented 9 years ago

Hi @micahasmith Thanks for the update. I have tried to capture the onOrderSubmit event. The code is as below

   PIO.open({ 
            recipeId:'e61ea5a7-c0d2-46ab-9052-34f3ef77c4a3',    
            url:'http://staging.widget.print.io/widget/',
            fns:{
                onEvent:function(key, val){
                    if(key == ""onOrderSubmit"")
                    {
                        alert('onordersubmit');
                        var v = JSON.stringify(val);
                        alert(v);
                    }
                }
            },
            images:[
                'http://farm4.staticflickr.com/3731/11237222963_618e5bae33_o.jpg',
                { 
                  thumb: 'http://farm6.staticflickr.com/5499/11298896085_e02b32387d_o.jpg',
                  picture: 'http://farm6.staticflickr.com/5499/11298896085_e02b32387d_o.jpg',
                  printUrl: 'http://farm6.staticflickr.com/5499/11298896085_e02b32387d_o.jpg'
                }
            ],
        });

After payment the stringified value (val from above script) is as follows :

message {{"id":"10669-626734c3-548d-4f13-af37-b2683b5c6448","items":[{"SKU":"AcrylicPrint_1/8in_24x24","ShipCarrierMethodId":1,"Images":[{"Index":0,"ManipCommand":"{\"name\":\"canvas\",\"commands\":[{\"name\":\"combine\",\"args\":{\"map\":\"0=+0+0,\"},\"index\":0},{\"name\":\"convert\",\"args\":{\"format\":\"jpg\"},\"index\":999},{\"name\":\"quality\",\"args\":{\"value\":100},\"index\":0},{\"name\":\"resample2\",\"args\":{\"dpi\":300,\"units\":\"PixelsPerInch\"},\"index\":0}],\"layers\":[{\"name\":\"canvas\",\"commands\":[{\"name\":\"combine\",\"args\":{\"map\":\"0=-3188.166666666667+0\"},\"index\":0}],\"layers\":[{\"name\":\"image\",\"commands\":[{\"name\":\"resize\",\"args\":{\"height\":7238.000000000001,\"width\":13614.333333333334},\"index\":0}],\"layers\":[],\"settings\":{\"uri\":\"http://farm6.staticflickr.com/5499/11298896085_e02b32387d_o.jpg\",\"printUrl\":\"http://farm6.staticflickr.com/5499/11298896085_e02b32387d_o.jpg\"}}],\"settings\":{\"width\":7238.000000000001,\"height\":7238.000000000001,\"index\":0}}],\"settings\":{\"width\":7238,\"height\":7238}}"}],"Quantity":1,"Meta":[{"Key":"SKU","Value":"AcrylicPrint_1/8in_24x24"},{"Key":"TemplateName","Value":"Single"}]}],"discountAmount":0,"discountAmountFormatted":"£0.00","total":"£209.40","shipping":"£119.30"}}

But on the web widget the ORDER ID is : Your Order is t10669

Now I am confused about how to get the order Id after a successful checkout.

rughvi commented 9 years ago

Hi @micahasmith Also, for the web widget is there any config parameter to remember the shipping address and card details provided by the user for later use?

micahasmith commented 9 years ago

nope

rughvi commented 9 years ago

Hi team, @micahasmith , In the above config my recipeId for STAGING is 'e61ea5a7-c0d2-46ab-9052-34f3ef77c4a3'

When I place a successful order using this recipeId from web widget , I can't see the order in my admin portal / dashboard.

How can I see the orders placed using STAGING RECIPE ID on the admin portal / dash board?

Many thanks, Venkat V R

rughvi commented 9 years ago

Hi team, For flat cards, I can't add text on the image? Is this correct? ( I can add text on the image using iOS example.)

Thanks, Venkat.