Giter Site home page Giter Site logo

responsive_checkout's Introduction

Wait! Don't use this library yet!

This entire checkout can be created within a StoreFront using our Visual Builder. Why not try that?

  • Rapid development - 10x faster than coding a javascript checkout
  • Zero coding
  • Hardened code base
  • Fast to create, fast to change

This video shows an entire checkout created in little over an hour.
Imagine how fast you could create UltraCart checkouts after using the Visual Builder a few times?

https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/514064431/Live+Visual+Building+Tru+Energy+Single+Page+Checkout

Introduction

This shopping cart is a vanilla javascript shopping cart using the latest UltraCart API.

Requirements

For development, you will need:

Getting Started

To Use:

  1. Download or clone this project.
  2. From the base directory, run 'npm install'.
  3. Edit index.html and provide your own browser key (for more on this, read the docs). The one provided will not work. You'll find the key around line 536 of index.html. uc.browserKey = "d7f38666b17e60016306f071d41e3700";
  4. Right below the browser key, set your storefront server name. This is needed to provide proper branding for receipts. uc.storeFront = "demo.ultracartstore.com"
  5. From the base directory, run 'gulp'. The default action will build the .js and .css file.
  6. Deploy or test your checkout!
  7. An easy way to add an item to your checkout is by adding ?ADD=YourItemId to the end of the checkout url.

Changes

Version 2.0

Complete overhaul.

  • Switched to latest API (www.ultracart.com/api/)
  • Removed all external libraries. The hosted fields still uses jQuery, but the entire shopping cart is now vanilla javascript. This makes it much easier to trace action and extend as needed. If you wish to use a library such as backbone.js, angular, or reactjs, it should be easy to incorporate.
  • Removed the backbone/handlebars implementation. The learning curve was too high, so we chose not to upgrade that to the new API.
Version 1.4
  • Removed rest_proxy.php
  • Added CORS support
  • This version will run on any web server.
Version 1.3

This release is also a mandatory upgrade. (Sorry guys) To achieve PCI 3.0 Compliance, all credit card numbers and cvv numbers must go through Hosted Fields. This checkout was updated to do that. Prior to this, the storeCard method was used to send sensitive credit card information to the vault (token.ultracart.com). That solution was acceptable for PCI 2.0, but the Hosted Fields must be used for 3.0.

Full list of Changes (all deal with the cart_implementation/backbone):

  • Hosted Fields support added see http://docs.ultracart.com/display/ucdoc/UltraCart+Hosted+Credit+Card+Fields
  • Added localization support for all supported currencies (you'll see references to LocalizedFormatted fields everywhere, such as subtotal -> subtotalLocalizedFormatted
  • Upgrade jQuery and JSON libraries
  • Removed accounting.js library. This is no longer needed with the localized formatted variables being used. The only gap caused by this removal was filled by the app.commonFunctions.formatMoney function, which is used to format dynamic javascript values.
  • Updated handlebars to 3.0.3
  • Updated grunt and bower to latest versions
  • Added jshint to the Gruntfile to perform additional syntax checking. numerous fixes recommended by jshint were performed.
Version 1.2

This release is considered a mandatory upgrade. Of this release, the changes in the rest_proxy.php script are most important. Please upgrade your rest_proxy.php scripts as soon as possible. Doing so will prevent issues with your site. Additionally, we've added a proxy version header that will allow us to track which merchants might have out of date proxy scripts in the future. This could prove vital to rapidly addressing any compatibility issues that might arise from future server updates.

rest_proxy.php changes:

  • Fixes for content-length being sent down when original response was gziped. Would cause the client problem if the server running the proxy wasn't gziping it as well
  • We have disabled gzip upstream until 4/15/2015 at which point everyone should have their proxy scripts upgraded.
  • Added a flag that can be set to enable debugging to the error_log instead of having to uncomment all the statements.
  • Change SSL certificate verify flag.
  • Set an empty Expect header in the request to prevent curl from sending the Expect: 100-Continue header.
  • Simplify the HTTP 100 Continue header trimming and allow for multiple of them
  • Close out the curl handle sooner.
  • Add a proxy version number to the header so we can tell from the server side if people are running out of date proxies
Version 1.1

An UltraCart Javascript checkout designed to render well on all displays, especially mobile devices.

This checkout using the UltraCart REST API. The documentation for the REST API is found on docs.ultracart.com. http://docs.ultracart.com/display/ucdoc/UltraCart+REST+Checkout+API

backbone cart implementation:

  • Updated all javascript libraries to their latest versions.
  • Moved all handlebar templates into separate files and pre-compile them. The makes development an extra step, but solves strange errors we were seeing with the latest browsers doing aggressive javascript optimization and causing strange random errors with the handlebar templates.
  • replaced underscore.js with lodash.js

If you aren't using the precompiled handlebar templates, you should upgrade to avoid any issues with the latest round of browsers. See https://github.com/UltraCart/responsive_checkout/blob/master/cart_implementations/backbone/scripts/handlebars/readme_precompiling.txt for tips on setting up the precompiler using nodejs.

Architecture


Everything is fairly standard to a backbone.js/handlebars.js javascript application, with the exception of the Cart model. We created a mix between the DeepModel and a Nested Model. Had we used the standard backbone.js, we would have lost fine-grained management of 1) nested objects such as the Cart.CustomerProfile object and 2) collection properties such as items. We really wanted row level event notification for the items. So, within https://github.com/UltraCart/responsive_checkout/blob/master/scripts/backbone-uc-common-functions-1.3.js you'll see the models defined to give us detailed control of every part of the Cart object.

With a normal backbone.js model, all properties are access via the model.get('property') method. With our model, we follow this convention, but we also map the items as a direct property of the cart.

So, you'll see within the code app.data.cart.get('shipToFirstName') as well as app.data.cart.items where it lives as a backbone collection of CartItems instead of a normal array of CartItems. This allows for event binding, etc.

Just a head's up.

Release Notes:


11/01/2013 We're releasing this software as version 1.0. We've added the login/logout/register functionality, along with fields to display all customer information. Numerous bugs were fixed with the latest commit.

responsive_checkout's People

Contributors

johnsontb avatar jyork03 avatar macbookandrew avatar perrytew avatar ucjonathan avatar yagerrealty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

responsive_checkout's Issues

Login request with no email...

I don't know if this is so much a bug as it is unexpected behavior from my perspective. I accidentally sent a login request (/rest/cart/login) the other day with no email address or password values included in the cart variable and found that I received a 200 response code from the server with no errors. I've coded something up in the javascript on my end to take care of this possibility (send a value of "none" in place of the email address if the email field is blank--this throws the expected error I want to show), but it seems to me that the more appropriate place to catch this error would be on the server side.

I haven't verified the behavior of the myaccount api in this regard

Dan

Shipping validation checks not working with rest_proxy.php

Hi,

I'm following the validation example from https://secure.ultracart.com/merchant/integrationcenter/checkoutapi_v3/demo1.html#demo07

The only difference is that I'm using the rest_proxy script on my server. I am attempting to validate the following checks:

[ 'Billing Validate City State Zip', 'Billing Phone Numbers Provided', 'Billing State Abbreviation Valid', 'Billing Address Provided', 'Email provided if required', 'Item Quantity Valid', 'Shipping Address Provided', 'Shipping State Abbreviation Valid', 'Shipping Validate City State Zip' ]

No matter what checks I specify in the url (including no checks), the only errors returned from validation are:

[
"Please specify your billing first name.",
"Please specify your billing last name.",
"Please specify your billing address.",
"Please specify your billing city.",
"Please specify your billing state.",
"Please specify your billing zip code.",
"Please specify your billing country.",
"Please specify your email."
]

(No shipping info is ever validated, even if all of the billing validations pass.)

The same thing happens if I skip validation and let validation be handled by /rest/cart/checkout. I have verified that shipping info is saved on successful orders.

Here is the actual url that the ajax call from my checkout page is using:

http://myserver.local/rest_proxy.php?_url=/rest/cart/validate&check=Billing%20Validate%20City%20State%20Zip&check=Billing%20Phone%20Numbers%20Provided&check=Billing%20State%20Abbreviation%20Valid&check=Billing%20Address%20Provided&check=Email%20provided%20if%20required&check=Item%20Quantity%20Valid&check=Shipping%20Addres%20Provided&check=Shipping%20State%20Abbreviation%20Valid&check=Shipping%20Validate%20City%20State%20Zip

Adding some logging to the rest_proxy.php script I see that the url it is hitting is:

https://secure.ultracart.com/rest/cart/validate?_url=/rest/cart/validate&check=Billing%20Validate%20City%20State%20Zip&check=Billing%20Phone%20Numbers%20Provided&check=Billing%20State%20Abbreviation%20Valid&check=Billing%20Address%20Provided&check=Email%20provided%20if%20required&check=Item%20Quantity%20Valid&check=Shipping%20Addres%20Provided&check=Shipping%20State%20Abbreviation%20Valid&check=Shipping%20Validate%20City%20State%20Zip

And I see that the POST data contains all of the shipping fields.

Other requests, such as /rest/cart, and /rest/site/items are working fine.

Am I doing something wrong? Is there some option in the merchant portal that I need to turn on to allow validation or to validate shipping fields?

Thanks very much.

Free promotional item being added again in each response

If my cart has an item that is set up to get a free promotional item, the promotional item is added again every time I get a response from Ultracart, so I end up having a bunch of the free item added to the cart.

Is there some type of flag I can look for in the item that lets me know if it was added as a free promotional item? The way I've gotten around this for now is I just set the maximum quantity of the free item to 1. Seems like there should be a better way though.

Hand-off cookie not being destroyed...

This one's been giving me fits for about the last day or so.

The behavior that I'm seeing with the checkout api is that, for logged-in users only, shopping carts and the items within them are persisting past a successful checkout event. Not something I was expecting to see. I first noticed the behavior on the site I'm building (nutricost.com) which is requiring an account creation for every non-logged-in cart purchase, but I have also duplicated this behavior on another site of ours (esupplements.com) that allows for user accounts as an option.

The reason I've been chasing this down for so long is that a previous developer of ours for these api carts was setting a cookie within the cart code with a name identical to one of those that UC uses in their checkout progression. Once I had finally stripped all references to custom cookies in our api cart code, and found that the cookie I was trying to change was STILL there, I knew to look elsewhere. Aaand 5 minutes later, I'm writing this ticket.

So, what I'm seeing is this:

There's a response cookie that the browser is getting after a cart is submitted to the checkout process. The call is to:

https://secure.nutricost.com/cgi-bin/UCCheckoutHandoff?operation=checkout&merchantId=NCOST&shoppingCartId=87F75549020C62014643E7266D051400&returnOnErrorUrl=https%3A%2F%2Fsecure.nutricost.com%2Ffree-trial%2F&errorMessageParameterName=error&r=1401298635343

The response cookie I'm getting is:

name: UltraCartShoppingCartID
value: 87F75549020C62014643E7266D051400
domain: .nutricost.com
path: /
expires: session
http: checked

The issue comes in when there's a logged in customer, because after the checkout process this session cookie persists (destroyed when the browser closes), and it can be used as an access credential for a customer account. (When combined with a corresponding merchantid cookie or api call with the appropriate header). So, all of my loggedIn api calls for our main sites are coming back as positive with a cart that shouldn't be in existence any more.

I'm thinking that either this cookie needs to be set as expired or the cart id on the UC servers needs to be cleared after the checkout process completes, to avoid these issues. I could be grossly oversimplfying things though based on the little I know about how UC does things behind the scenes. I could just be wrong as well.

Please feel free to steer me in the right direction.

Thanks.

Dan

Cart REST API - Logged in user

I'm having a bit of difficulty understanding how the cart login mechanism
works with maintaining a user's cart.

I can use /cart/login and pass in the users credentials to get back a cart
with those credentials applied to it, but it doesn't link with the related
Customer Profile, the cart.loggedIn property showing as false.

I tried to understand it via the API v3 demo - "place order using stored
credit card" example, but was not able to get it successfully returning a
result or example code.

How can I go about logging in a user (creating one if it doesn't exist),
getting a cart, load it up with items, use a stored credit card, and
finalize the transaction?

Add To Cart Button

In the item.html demo file you use a function to add the a single product to a cart and then presumably a user would click a "view cart" link and check out.

Given that this is likely to go into a mobile (e.g. responsive ) environment is it possible to skip the adding to cart and instead take them straight to the cart page with the item already in place?

Some itemID's not returning item

Hello,
When calling an itemID that contains hyphens or underscores the item does not display on the item page. Other itemID's display perfectly.

Thanks,

PB

estimateShipping changes?

the estimateShipping rest API call is suddenly returning wrong/improper values for the shipToCountry provided. Code has not changed on my end, and I rolled back to code known to produce correct values from API yesterday. Did anything change just now??

Pls email if you'd like specifics.

Preorder Warning/Error Preceding/Overriding real cart errors

Hey--

I've noticed that, when adding a preorder item to the cart and sending through checkout, if there are any errors on the order (say, bad CC# or something) the error I always get back is the preorder warning message, and no other error text.

Is this something changeable, or is there a workaround?

Populating customer account on register...

Hi Perry,

After looking through this new version of the rest api, I've gotten the "register" function to create an account correctly. Right now, the account is only being created though and is not populated with the rest of the information that is contained in the customerCart that I'm passing to it.

Essentially, we're creating new customer accounts only when a successful order is made (and the customer has requested it, via a checkbox on the checkout page). So, the customerCart that is passed to the register function in our case has lots of good information that we'd like to automatically insert into the account (things like First Name, Last Name, Address, City, etc.)

I've essentially just used your code from the demo cart to access the register function. After setting the password value for the customerCart, I pass it like such:

jQuery.ajax({
    url: '/rest/cart/register',
    type: 'POST', // Notice
    headers: { "cache-control": "no-cache" },
    contentType: 'application/json; charset=UTF-8',
    data: JSON.stringify(customerCart),
    dataType: 'json'
}).done(function (loggedInCart) {
    customerCart = loggedInCart;
});

Am I missing something in my call, or is this functionality to add the other customerCart information/values just not currently built into the register function? If not, would it be possible to suggest that it be added?

Thanks for all the help you've given. Your team is doing a great job of keeping abreast of all of this.

Load current cart based on UltraCartShoppingCartId cookie

I just recently started looking at the REST API. I tried the responsive_checkout last week and it seemed to work quite nicely. Just yesterday, I was trying it again and there seemed to be an issue with a new cart getting generated if I reload the item.html page or if add to cart from the item.html page and then go to the cart.html page, it tells me "Your cart is empty, good sir."

I thought that if there is a UltraCartShoppingCartId cookie set that this cart would automatically get loaded when it does the GET /rest/cart

I'm using the rest_proxy.php if that makes a difference.

Thanks,
Tom

Creating new account upon checkout completion...

Hey there,

Couple of things:

  1. I'm having a small issue with the Register method of the UltraCart REST Checkout API. For some reason, a call to this method is passing through without any errors if I give it an email and password for an account that has already been made. It doesn't make another account or anything. It just comes back as if the account registration happened for a new account.

I'm trying to set up a new site (www.nutricost.com) that will have customer accounts and a free, limited trial period. I'm registering each new account when the "purchase" of the free trial is made (Just prior to the checkout call, actually). Naturally, we don't want a customer to be able to purchase an additional "Free Trial" once their initial purchase of the Free Trial has expired.

(I understand that we'll have to do some finagling to somehow limit a user from creating a new Free Trial account with a new email address, or even deleting their account and then making a new one with the same email address, but we'll figure those out when we get there.)

I thought that the Register method should fail if I passed it an email address for a current account, but it doesn't. Is this expected behavior, and I'm just thinking wrong?

  1. It says in the documentation for the Checkout API that accounts created via the Checkout API are created after the purchase is completed (Guessing that this is tracked by CartID somehow). Regardless, I've noticed that an account will show up in the back end of UltraCart (Home --> Customer Profiles --> Manage) immediately after the Register method successfully completes. If a customer registers an account, and then for some reason doesn't complete the checkout process, how long will the "quasi-account" stick around in the system? In the interim, will it be a viable account to which they could feasibly log in and do anything a normal "completed" account could do?

Thanks.

Dan

Need access to inventory count for items that have a tracked inventory...

Hi,

The item object documented here:

http://docs.ultracart.com/display/ucdoc/UltraCart+REST+Checkout+API#UltraCartRESTCheckoutAPI-Item

has a field:

inventoryTracked (boolean)

We'd like to be able to access the actual remaining inventory for a given item that has a tracked inventory.

Essentially, I'm trying to build a page for our site that has special deals on it, each with a limited inventory. Right now I have it working by using the Advanced Links option documented here:

http://docs.ultracart.com/display/ucdoc/Advanced+Links+-+JavaScript#AdvancedLinks-JavaScript-ShowInventory:

and then reloading the page using the various sort options available. What I'd like to do is get the page to work with an ajax refresh, but trying to get it to work has had me jumping through lots of hoops for nearly a day now. I found one method that seems to work (javascript postscribe plugin) while using the Advance Links option but it's super slow with the number of offers that we have on a page. So a colleague of mine thought it might be better (and likely faster on the page) to access this information through the rest api instead.

Any chance we could get this into the queue?

Thanks.

Dan

cart shipping amount doesn't update when a shipping method is assigned

From a merchant:

I have a rest cart pretty much working, but it does not seem to add up the shipping correctly. When selecting the method "UPS Express: 2 days" (which I get from the cart/estimateShipping action), the shippingHandling amount remains zero. It should add 14.95 to the total, as it does in the UC cart.

Auto Responder Campaigns

How can I subscribe someone to an autoresponder campaign? I'm talking about the campaigns you can create in the ultracart back end - /merchant/autoresponder/campaignListLoad.do.

It doesn't look like /rest/cart/subscribeToAutoResponder will work out because all it takes are the lists and autoResponderName.

Paypal + UC Api

Hi Perry,
I'm using the ultracart API v 3.5, now I wanna integrate paypal with my site, I was reading some issues on ultracart site and I added a new payment method (Paypal method).
My question is how can I add the paypal button to my site? is there any paypal or UC script that I have to add too?

Thnks.

Items not being added to cart in IE11...

So, I just spent seven hours trying to figure out why IE is ridiculous once again, after having a customer complain about bogus behavior in one of our API carts. Surprise, surprise. Anyhow, I found something interesting that I thought I might pass along to you just in case it will help someone, somewhere, along the way:

I found that IE11 was caching all of my ajax requests.

Up front, this wasn't an issue for any other browsers that I've yet come across.

So, to the behavior:

When a brand new cart is made using the Checkout API everything is hunky dory and you can add an item to your cart. But if you decide to go shopping some more, and then add something else to your cart, IE11 decides that you've already requested the cart data from the Ultracart servers at that url before, and instead of going out anew to the Ultracart servers and returning what comes back, it returns the cached content from the previous request where the cart is empty.

Oddly enough, if one of the core files for a checkout page (say index.html, or master.js) is changed after a cart has already been initialized and populated with that one item, IE11 will realize that the files have changed and not used cached content for the next ajax request. So, if there's a cart that's currently populated with one item, and a core cart file is changed, then the cart with that one item will be the starting point for every successive visit to the cart page. Thus, you will only ever be able to add one new item to the cart (as above).

I found that the fix for this annoying issue is to tell jQuery to never cache ajax requests, as thus:

$.ajaxSetup ({
'cache' : false
});

inside the master.js file.

Thank you, IE.

Although I haven't verified that the basic cart implementation you have hosted here responds in the same manner, the setup of the problem seems to imply that it would. This might also be complete overkill as far as "solutions to the problem" go. Caching should probably be decided on a case-by-case basis. There might also be a more appropriate fix by using a backbone or underscore setting. Regardless, I thought I'd pass the info along. Just in case.

Dan

Upsells & Receipts

When we do "upsells" (via responsive checkout) and if the client closes the browser in the middle of the upsells, still the main order isn't captured and the "card" isn't charged.

However, when the "user" goes through all the upsells and finally lands on the receipt page, then the "order" is captured and so the "card" is charged.

Do you have any thoughts on how to handle the intermediate steps if the client closes in the middle.

Continue Shopping link for the receipt page

How can I set where this link goes? I use the javascript checkout for a single page checkout, then redirect customers to a normal theme for upsells and receipt.

For normal carts, I think it just uses the page I came from, but for my javascript checkout, it's using the link configured under Configuration -> Merchant Profile.

Error using "/rest/cart/checkout"

Hello,
I'm using this
http://docs.ultracart.com/display/ucdoc/UltraCart+REST+Checkout+API#UltraCartRESTCheckoutAPI-Item
on my web site but when I'm make the AJAX is giving this error:
POST domain.com?_url=/rest/cart/checkout 413 (Request Entity Too Large)

I'm using the same data as the example, I just changed the merchantId, cartId and the items.

var cart = {
'merchantId': 'DEMO',
'cartId': '', // will be populated by call

"customField1": 'blah blah blah',
"customField2": 'perhaps an affiliate id here?',
"coupons": [
  {couponCode: '10OFF'}
], // here is a coupon for $10 off the order
"advertisingSource": "Radio",
"screenBrandingThemeCode": "CSTM", // The demo account has a second them set up using the code CSTM
"shippingMethod": "FedEx: 2-Day",
"shipToFirstName": "Testy",
"shipToLastName": "Testerson",
"shipToTitle": "Sir",
"shipToCompany": "Ultra Trains",
"shipToAddress1": "55 Main Street",
"shipToAddress2": "Suite 101",
"shipToCity": "Duluth",
"shipToState": "GA",
"shipToPostalCode": "30097",
"shipToCountry": "United States",
"shipToPhone": "555-555-1212",
"shipToEveningPhone": "5555553434", // notice the different format?
"billToDayPhone": "555-555-1212",
"billToEveningPhone": "5555551212",
"billToFirstName": "Smith",
"billToLastName": "Joe",
"billToTitle": "Chief",
"billToCompany": "Widgets, INC",
"billToAddress1": "2000 Montana Dr",
"billToAddress2": "",
"billToCity": "Duluth",
"billToState": "GA",
"billToPostalCode": "30097",
"billToCountry": "United States",
"email": "[email protected]",
"emailConfirm": "[email protected]",
"paymentMethod": "Credit Card",
"creditCardType": "VISA",
"creditCardNumber": "4444333322221111",
"creditCardExpirationMonth": 12,
"creditCardExpirationYear": 2028,
"creditCardVerificationNumber": "123",
'items': [
  {'itemId': 'PDF', 'quantity': 1},
  {'itemId': 'Baseball', 'quantity': 2},
  {'itemId': 'BONE', 'quantity': 5}
]

};

Paypal payment Method validation issues

Experiencing ultracart validation issues when setting the paymentMethod to 'Paypal'.

I don't set any email, name or shipping address information but call the rest API to redirect to Paypal.

When I populate this data prior to triggering the paypal redirect then I reach Paypal without any problems.

So my question is are values needed for email, name or shipping address prior to sending the call or is there a setting that I have missed?

Validate shipping address with /rest/cart/validate

I'm looking at making a multi-page checkout process and using the /rest/cart/validate to do the validation. When I try to validate the shipping address by passing "check='Shipping Address Provided'" , it always comes back with no errors even if I leave all the shipping address fields blank. The demo at https://secure.ultracart.com/merchant/integrationcenter/checkoutapi_v3/demo1.html#demo07 seems to have the same behaviour. Is there another check flag that has to be passed in order to validate the shipping address?

Doing a /rest/cart/checkout responds with a large list of shipping address errors if I leave all the fields blank.

Wondering if I could get the local server time...

So, I'm trying to implement a countdown in a custom api cart to let customers know how long they have to complete their order before the cut off time for us to ship their package on that same business day.

I've found out via some brief Googling that Ultracart's servers are set to EST, but I couldn't find a way to actually access what that time is via any kind of api call. Is there something already present in the api that I could use to get this information? Having this server time just seems like a more accurate way of calculating my countdown instead of using javascript from a customer's local computer.

If there isn't something already built into the api, would adding the current ultracart server time/date to the cart variable be a viable option?

Thanks.

Dan

"Inactive" items being added to API cart...

Hi,

I'm having a fairly simple issue that I hope won't be too difficult to solve. Essentially, it involves the "inactive" setting of a given item within Ultracart. We use this functionality quite often to temporarily remove the option for a customer to buy an item, and it's been of great benefit to us. For some reason, however, the API cart doesn't seem to be honoring the "inactive" status.

I've looked into the Item object defined in the REST documentation but didn't find anything there that would tell me if the item was listed as "inactive" in the Ultracart back end. Is this information for items available somewhere else that I could accesses it? Or is this functionality (cart REST calls returning "inactive" items) what is to be expected, and I'm just missing something?

Thanks for the help.

Dan

Get Allowed Countries?

Hi, I'm having trouble getting the allowed countries. What is the best way to do that?

Tracing a Java error on UC side

Sporadically I'll get back something like the following error from a REST call:

Invalid JSON. java.lang.IllegalStateException: Expected a string but was NAME at line 1 column 3877

Would it be possible to make the returned messages for such errors a little more useful? Perhaps include 10-20 characters around the position where the JSON decoder choked? Right now it's nearly impossible to tell from the JSON I send where the error is. I tried the basics (look at what's going on at column 3877 in the JSON cart string I sent for example above) but that yielded nothing, it seemed like well-formed JSON at that point.

This is fairly urgent as the error is happening in the wild and I'd like to rectify the issue if I can, but don't have enough information from the error message to know where to begin looking.

Upsells

Hi Perry,

When we use "response_checkout" and with all the upsells, when redirecting to "receipt" page, again its triggering the "upsells" (its because, it is configured in the "in-built" ultracart upsell funnels). Is there a way we can suppress the "in-built" upsells (in ultracart) when coming along from the responsive checkout? Also it should continue to work, when it comes via a regular ultracart (in-built) shopping cart and it should trigger the "upsells".

Please do let me know your thoughts!

Thank you!

Returned item in wrong currency

Hi,

I have items configured in GBP (not USD). When adding these to the cart using API they are automatically converted into USD. So if an item is set in the item configuration for £39.95 the item in the cart shows $67.55.

When using the Ultracart themed pages this isn't an issue and GBP prices are shown.

How can this be resolved?

Cheers.

Automatic customer account logout upon checkout...

Just got a transaction to complete for me using a saved test credit card from a test customer account. Too cool! :)

Ahem.

Anyhow, after having the test transaction complete, I noticed that I had been logged out of my test customer account. I'm guessing that this is the default behavior for the system, and is honestly something that doesn't surprise me at all. However, I was curious if it would be possible to have a flag that I could set within the cart object prior to checkout that would skip the auto-logout process and keep the customer logged in, if they so desired. That way, we could have a checkbox or something on our checkout page that would allow it.

Thanks.

Dan

/rest/cart 500 internal Server error.

What could this mean? Here's the response.

Invalid JSON. java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 467

This just started happening. Everything was working perfectly just a little bit ago, and I don't think I've changed anything - if I have, I've already tried undoing my changes back to the point where it was working.

Return email link

My cart uses a custom URL for the main checkout, then redirects to a normal screen branding theme for upsells and the receipt. When someone is added to an abandon cart/autoresponder campaign, they are being linked back to a standard theme - which makes sense, it goes by the theme code I specify.

Instead of sending them to a cart based on the themecode, I want to send them back to the api checkout page. Is there anything I can do to make this work?

Missing merchant ID on cart.html page

Hi,

Downloaded and followed the instructions and ensured merchant ID has been placed into both item.html and cart.html.

After adding item to the basket from the item.html page, I visit the cart.html page and am not seeing the cart with the item in it, only the "Loading shopping cart. Please wait..." message.

Checking the console for "window.cart.merchantid" and says "undefined" and yet its set on the page (can see in the source code).

What am I missing?

Cheers

Pass Preorders through rest/checkout

Is there a way to order a preorder item through the checkout process? I noticed it's pushing back an error and not giving me a redirectUrl. It looks like I can through finalizeOrder, but I'd rather not implement all of that just to get preorders working.

Auto order item question

I noticed that if I have a free item that's set up to auto-order something else (for example, something like this http://docs.ultracart.com/display/ucdoc/Simple+Free+Trial+Tutorial), the javascript checkout won't require any credit card information. In the normal cgi-bin/UCEditor cart, it'll say to specify your credit card information if I try to finalize with the free auto-order item.

Is there something I need to set so UC knows I have an auto-order item?

How do you know when checkout is successful

After calling /rest/cart/checkout and handing off to the checkoutResponse.redirectToUrl, is there a way to tell if the checkout actually completes. For example, maybe the credit card gets declined. Also, how does this work for checkout with PayPal. Is there a common page that the checkout process will always return to with the results? Maybe the receipt page?

What I'm trying to do is put a record into our database for each user listing each item they have purchased.

Do you have any suggestions on how this can be done?

Duplicate Items/kits

When I add an item to the cart more than once (by refreshing the page or something while "&add" is there), a new line is added for that item. I'd like it to just check if the item is already there, and if so update the quantity. Otherwise someone could override our max quantity rules and add as many as they want of a particular item.

I've been messing with the items view code for a while now to try to do this, but I'm having some trouble actually removing the duplicates from the cart (I can stop it from displaying though). I'm really new to all of this - this is my first time working with backbone.js.

Do you have any suggestions?

Geolocation?

I'm trying to implement some geolocation in the cart page using the IP address. Is there an ajax call that I can make to get the approximate location using the IP address? I'm hosting this page on Ultracart servers.

I'd just use it to fill in some defaults and hopefully guess their location correctly.

Self hosted upsells with Amazon

Hi,

Would love to see the self-hosted upsells available in credit card and Paypal flows be available in the Amazon checkout routine with the REST api. How can I help you to get this feature rolled out?

jfh

Access to upsell information within cart rest API...

So, we're making an abysmally poor showing on upsells for one of our sites, and I was curious if there was currently a way to access the upsell information associated with a given product (product id) through the rest api. I couldn't find anything with a cursory search through the rest api documentation (some references to upsells, but mostly talking about how UC servers take over after the finalize action of the api cart).

Essentially, we'd like to try putting the upsells into the cart with single-click add functionality. Thus we'd need to be able to access the html blocks that make up the upsell (currently defined in the Ultracar back-end) and anything else necessary to add an upsell to the api cart.

Possibility?

Thanks.

Dan

How can I get more accurate shipping estimates?

For some reason, I'm having trouble getting good international shipping rates. When I post to /rest/cart/estimateShipping, it gives me standard shipping methods. If I wait to estimate shipping until I save first, it'll work better, but it's still not always accurate.

Here's an example of my JSON for estimateShipping:

{"merchantId":"RWAC","shipToCountry":"Brazil","items":[{"position":1,"length":{"value":0,"uom":"IN"},"attributes":[],"description":"2 Bottles of Abidexin + 1 FREE Bottle of Abidexin 72 Hour Cleanse","weight":{"value":0,"uom":"LB"},"options":[],"unitCostWithDiscount":79.95,"quantity":1,"kit":true,"preorder":false,"multimedias":[{"type":"Image","description":"","default":true,"code":null,"viewUrl":"http://secure.apidexin.com/itemmultimedia/RWAC/ABIDEXIN2/2bottles.jpg","imageHeight":92,"imageWidth":195,"excludeFromGallery":false,"thumbnails":[{"height":80,"width":80,"httpsUrl":"http://secure.ultracart.com/thumbs/1374611927620/RWAC/D/E/80-80-DE2860168D251D6E78F40A2E87DCBF7E.jpg","httpUrl":"https://secure.ultracart.com/thumbs/1374611927620/RWAC/D/E/80-80-DE2860168D251D6E78F40A2E87DCBF7E.jpg"}]}],"viewUrl":"http://abidexin.com/","manufacturerSuggestedRetailPrice":null,"minimumQuantity":1,"height":{"value":0,"uom":"IN"},"width":{"value":0,"uom":"IN"},"extendedDescription":"","maximumQuantity":null,"variations":{},"arbitraryUnitCost":null,"autoOrderSchedule":null,"itemId":"ABIDEXIN2","upsell":false,"autoOrderLastRebillDts":null,"unitCost":79.95,"kitComponentOptions":[],"itemOid":4401587,"defaultImageUrl":"http://secure.apidexin.com/itemmultimedia/RWAC/ABIDEXIN2/2bottles.jpg","defaultThumbnailUrl":"https://secure.ultracart.com/thumbs/1374611927620/RWAC/D/E/80-80-DE2860168D251D6E78F40A2E87DCBF7E.jpg"},{"position":2,"length":{"value":0,"uom":"IN"},"attributes":[],"description":"You're protected by our 90 day money back guarantee. We're that confident you'll be amazed by the results.","weight":{"value":0,"uom":"LB"},"options":[],"unitCostWithDiscount":0,"quantity":1,"kit":false,"preorder":false,"multimedias":[{"type":"Image","description":"","default":true,"code":null,"viewUrl":"http://secure.apidexin.com/itemmultimedia/RWAC/GUARANTEE/90day.jpg","imageHeight":80,"imageWidth":80,"excludeFromGallery":false,"thumbnails":[{"height":80,"width":80,"httpsUrl":"http://secure.ultracart.com/thumbs/1374611927780/RWAC/1/B/80-80-1B93D320E0ADAB3D30965FFB89A1FCB5.jpg","httpUrl":"https://secure.ultracart.com/thumbs/1374611927780/RWAC/1/B/80-80-1B93D320E0ADAB3D30965FFB89A1FCB5.jpg"}]}],"viewUrl":"http://www.abidexin.com/","manufacturerSuggestedRetailPrice":null,"minimumQuantity":1,"height":{"value":0,"uom":"IN"},"width":{"value":0,"uom":"IN"},"extendedDescription":"","maximumQuantity":1,"variations":{},"arbitraryUnitCost":null,"autoOrderSchedule":null,"itemId":"Guarantee","upsell":false,"autoOrderLastRebillDts":null,"unitCost":0,"kitComponentOptions":[],"itemOid":4472370,"defaultImageUrl":"http://secure.apidexin.com/itemmultimedia/RWAC/GUARANTEE/90day.jpg","defaultThumbnailUrl":"https://secure.ultracart.com/thumbs/1374611927780/RWAC/1/B/80-80-1B93D320E0ADAB3D30965FFB89A1FCB5.jpg"}],"total":75.95,"password":null,"email":"","errors":["Invalid item ID: null"],"buysafeBondAvailable":false,"buysafeBondWanted":false,"buysafeBondCost":null,"insureShipAvailable":false,"insureShipWanted":null,"insureShipCost":null,"subtotalDiscount":4,"tax":0,"giftEmail":null,"shipToTitle":"","shipOnDate":null,"screenBrandingThemeCode":"ABID","customField1":null,"customField2":null,"customField3":null,"customField4":null,"customField5":null,"subtotal":79.95,"shippingMethod":"USPS: Parcel Post","paymentMethod":"Unknown","advertisingSource":"","taxCounty":"","taxRate":0,"shipToCompany":"","shipToAddress1":"P O Box 612","shipToAddress2":"","shipToCity":"","shipToState":"","gift":false,"surcharge":0,"giftCharge":0,"giftWrapCost":0,"shipToFirstName":"","shipToLastName":"","shipToPhone":"80","deliveryDate":null,"giftMessage":null,"shipToResidential":true,"taxableSubtotalDiscount":4,"coupons":[{"couponCode":"IAMASMARTSHOPPER"}],"taxableSubtotal":79.95,"purchaseOrderNumber":"","giftCertificateAmount":0,"customerProfile":null,"shipToEveningPhone":"","customField6":null,"customField7":null,"insureShipSeparate":false,"ccEmail":null,"creditCardToken":null,"liftGate":false,"taxExempt":false,"threatMetrixParams":null,"emailConfirm":"","specialInstructions":"","affiliateId":null,"giftCertificate":null,"ipAddress":"65.181.61.122","loggedIn":false,"arbitraryTax":null,"arbitraryTaxableSubtotal":null,"arbitraryTaxRate":null,"arbitraryShippingHandlingTotal":null,"buysafeBondFree":false,"buysafeBondingSignal":null,"buysafeCartDisplayText":null,"buysafeCartDisplayUrl":null,"billToCountry":"Brazil","billToState":"","cartId":"FA1F4179C2D2720140E4CC2582051600","billToFirstName":"","billToLastName":"","billToTitle":"","billToCompany":"","billToAddress1":"P O Box 612","billToAddress2":"","billToCity":"","billToPostalCode":"","billToDayPhone":"","billToEveningPhone":"","shipToPostalCode":"","shippingHandling":0,"mailingListOptIn":true,"creditCardNumber":"","creditCardExpirationMonth":0,"creditCardExpirationYear":0,"creditCardType":"","creditCardVerificationNumber":"","hasGoogleCheckout":false,"googleCheckoutCompatible":false,"googleCheckoutButtonUrl":null,"googleCheckoutButtonAltText":null,"payPalButtonUrl":"https://www.paypal.com/en_US/i/btn/btn_xpressCheckoutsm.gif","payPalButtonAltText":"Fast, secure checkout with PayPal","hasPayPal":true,"payPalCompatible":true,"subtotalWithDiscount":75.95,"taxableSubtotalWithDiscount":75.95,"shippingHandlingDiscount":0,"shippingHandlingWithDiscount":0,"giftCertificateRemainingBalanceAfterOrder":null,"creditCardTypes":["AMEX","Discover","MasterCard","Visa"],"buysafeBondingSignalJavascript":null,"collectCreditCardVerificationNumber":true,"needShipping":true,"diagnostics":null,"customerProfileCreditCardId":null}

And the response from Ultracart:

[{"name":"USPS: Parcel Post","displayName":"Standard (4~5 days)","comment":"","tax":0,"cost":0.00,"discount":0.00,"costBeforeDiscount":0.00,"estimatedDelivery":"","defaultMethod":false,"totalTax":0.00,"discounted":false},{"name":"USPS: Priority Mail","displayName":"Priority (2~3 Days)","comment":"","tax":0,"cost":8.00,"discount":0.00,"costBeforeDiscount":8.00,"estimatedDelivery":"","defaultMethod":false,"totalTax":0.00,"discounted":false}]

Since the shipToCountry is set to Brazil, I should be getting international methods. Any ideas why it's not happening?

Issue on some versions of Android.

Android 2.3.3, 2.3.4, 2.3.5, and 2.3.6 don't seem to work with this cart implementation.

I've been trying to figure this one out for a while now, and I'm a little lost. I experience the same issue with the default responsive_checkout and my customized version.

To simplify things, I set up a standard implementation of this responsive_checkout here:
https://secure.oxytokin.com/standard/cart.html?add=OXYTOKIN-2S-7-SECOND&quantity=1&ClearCart=true

All I did was enter in my merchant ID, change the server name, and I set i_am_using_a_proxy to false. Besides that it's unmodified.

I'm using an Android emulator with Eclipse running Android 2.3.3. I can see it's making a request for /rest/cart/estimateShipping (which is just a normal $.ajax call) and receiving a response. But after that, it doesn't make any more requests and the cart shows up empty. I have some ideas as to what the issue could be, but are you even able to replicate the issue?

What are the password constraints for customer profile?

Hi Perry,

I'm trying to seamlessly integrate the cart register/login/checkout process into our service layer, and to do that I've had to have my service generate a password for each new customer profile since our users will never know it exists.

I went the route of creating a new GUID for each user when they first register a customer profile on a cart, but a GUID-formatted password (e.g. d2152ae1-b84e-4ac3-b957-c5c11c7fda8e) is not authenticating when calling cart/login. I receive a 200, but the cart errors show "Customer profile login failed. Please check the email and password that you entered and try again.".

When I change the password in the customer profile to something innocuous (e.g. "testpassword") and run the call, no errors are returned. When I manually set the password for a customer profile to a GUID string, I can save it without issue. If there was a password constraint, I would have expected a validation exception to be thrown.

Can you check this out when you get a sec?

Thanks,
Jason

PayPal & Upsells

Hello Perry,

Do have any thoughts/ideas how can we implement up-sells when the payment is made via PayPal? Is that possible? Can you guide me, please?

Please do let me know your thoughts!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.