Welcome Guest! To enable all features please try to register or login.
Options
Go to last post Go to first unread
Offline Paras Daryanani  
#1 Posted : Friday, May 17, 2019 12:21:57 PM(UTC)
Paras Daryanani

Rank: Newbie

Reputation:

Groups: Registered, Registered Users, Subscribers
Joined: 6/9/2017(UTC)
Posts: 6

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
I want to use the Hotcakes REST API to create an order, process the payment using credit card information that is supplied to the endpoint, followed by marking the order as complete and sending the user an email receipt.

So far I've used the OrderCreate and OrderTransactionsCreate endpoints, assuming that these will create the order with the specified line items, followed by applying the payment transaction and carry out all related workflow tasks, i.e. charge for the payment using the credit card specified in the OrderTransactionDTO object, update the order and send out an email receipt.

It looks like my assumption is incorrect, because the workflow tasks don't seem to execute on their own. How would I go about implementing the above specified logic using the Hotcakes REST API?

Edited by user Tuesday, May 21, 2019 5:06:26 PM(UTC)  | Reason: Rephrased to make more sense.

Paras Daryanani
Co-founder & CTO @ Celestial Sites
paras@celestialsites.com
Offline Will Strohl  
#2 Posted : Thursday, May 23, 2019 12:35:16 PM(UTC)
Will Strohl

Rank: Administration

Reputation:

Groups: Administrators, HCC-Employee-Store-Manager, HCC-Employee-Support, HCC-Partner, Moderators, Partners, Registered, Registered Users, Subscribers
Joined: 12/22/2016(UTC)
Posts: 342
United States

Thanks: 78 times
Was thanked: 59 time(s) in 57 post(s)
There is a great deal of work and logic that goes into the checkout process (above and beyond the workflow). Could you please provide additional details about how and why you're going around the checkout process so we can best understand how to respond with assistance?
Will Strohl, Upendo Ventures
Hotcakes Cloud | Get Support | Code Support
Official Cloud & Support provider for Hotcakes
Offline Paras Daryanani  
#3 Posted : Thursday, May 23, 2019 2:18:42 PM(UTC)
Paras Daryanani

Rank: Newbie

Reputation:

Groups: Registered, Registered Users, Subscribers
Joined: 6/9/2017(UTC)
Posts: 6

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
My objective is to create a scheduled task places recurring orders for customers in a Hotcakes website. The scheduled job uses an external database to fetch customer details, including the customer billing address, shipping address, credit card info (number, expiry and cvc). After fetching the customer details, an order should be created in Hotcakes and the customer credit card should be charged.

I expect all relevant workflow tasks to take place, i.e. assign order number, set order status to 'placed', apply a transaction and charge the credit card, set order status to paid if successful etc ( just as the website usually works when a user places an order through the Hotcakes frontend).

At the moment, this is what actually happens:
1. Using the OrderCreate endpoint, an order record is saved in the Hotcakes database (but doesn't show up in the Hotcakes sales dashboard)
2. Using the OrderTransactionsCreate endpoint, a transaction record is saved in the Hotcakes database. This does not however charge the credit card. The order is still invisible in the Hotcakes sales dashboard.

Bottom line: The order is not actually processed in Hotcakes. Only a db row is inserted in the orders table and another db row is inserted in the transactions table. Credit cards are not charged and orders are not confirmed.

My questions is, how can I implement the end-to-end ordering process in my scheduled task, i.e.:
1. create order
2. assign order number
3. charge credit card and apply transaction to order
4. if step 3 is successful, set order to complete (it's a non-shipping product) and email the customer
5. if step 3 is not successful (e.g. card declined), set order to unpaid and email the customer
Paras Daryanani
Co-founder & CTO @ Celestial Sites
paras@celestialsites.com
thanks 1 user thanked Paras Daryanani for this useful post.
Will Strohl on 5/27/2019(UTC)
Offline Will Strohl  
#4 Posted : Monday, May 27, 2019 12:52:57 PM(UTC)
Will Strohl

Rank: Administration

Reputation:

Groups: Administrators, HCC-Employee-Store-Manager, HCC-Employee-Support, HCC-Partner, Moderators, Partners, Registered, Registered Users, Subscribers
Joined: 12/22/2016(UTC)
Posts: 342
United States

Thanks: 78 times
Was thanked: 59 time(s) in 57 post(s)
Ah... That makes sense. Do you think you're going to be able to submit that as a pull request? :)

You're going to need to duplicate much of the logic highlighted in the link below, in order to get this to work as you expect.

https://github.com/hotca...ontroller.cs#L1104-L1173
Will Strohl, Upendo Ventures
Hotcakes Cloud | Get Support | Code Support
Official Cloud & Support provider for Hotcakes
thanks 1 user thanked Will Strohl for this useful post.
Paras Daryanani on 7/1/2019(UTC)
Offline Paras Daryanani  
#5 Posted : Monday, July 1, 2019 8:36:17 AM(UTC)
Paras Daryanani

Rank: Newbie

Reputation:

Groups: Registered, Registered Users, Subscribers
Joined: 6/9/2017(UTC)
Posts: 6

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Thanks Will, that was indeed very helpful. I've implemented this in the form of a new "CheckoutHandler" that has its own API endpoint + a new CheckoutDTO class that's analogous to a slimmed down version of the CheckoutViewModel class.

I'm currently cleaning up useless code and doing some testing, after which I'm happy to submit an issue and a pull request on Github.
Paras Daryanani
Co-founder & CTO @ Celestial Sites
paras@celestialsites.com
thanks 1 user thanked Paras Daryanani for this useful post.
Will Strohl on 7/1/2019(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.251 seconds.

Notification

Icon
Error

Loading
  • Sign-up for the Hotcakes Community Newsletter: