Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Paynow

Document Feature

Title

Pay Now

Description / Background

There has been an increase in recent requests from Customers to prepay for the bookings and currently the OPS team is handling this manually which causes unnecessary extra tasks and a risk for human error. Also based on the recent force for full prepayment upon using discount codes and points, the high number of users willing to pay in advance has proved the prepayment trend.

Objectives

  • User member and guest can use it
  • User can pick option Paynow when creating booking(available for all payment method)
  • User can see paynow option when payment type is using paynow and prepayment (but user can’t click the paynow option but its disable)
  • User can get points after 24 hours from booking time (member only)
  • Admin can know which users use paynow (booking report and clevertap)
  • Admin can turn on/off the paynow feature at package level
  • Although "Earn Points" is not checked by admin, if user uses PayNow, user will get the point.

Scope

  • All platforms

Sequence Diagram / Flow

Paynow flow checkout page (1).drawio

ERD

paynow (1).drawio

DB Schema / Database Migration

Column NameData TypeDescription
pay_nowbooleanAdd pay_now column on all package type table

API Blueprint

MethodPathURLDescriptionPayload
POST{{ base_api }}/reservations.jsonadd pay_now true or false on reservation object
"reservation": {
"restaurant_id": 837,
"date": "2020-10-01",
"start_time": "17:00",
"adult": 1,
"kids": 0,
"special_request": "adasd jasd adj",
"voucher_code": "HADIAH",
"service_type": "delivery",
"distance_to_restaurant": 13.4,
"pay_now": false
}

New Query

💡 change package attr to be optional belongs_to :package_attr, class_name: 'HhPackage::PackageAttr', foreign_key: 'hh_package_package_attr_id', optional: true

1. Only pay on-site

  • require_cc: false
  • pay_now: false
  • is_temporary: false 2. Require pre-payment
  • require_cc: true
  • pay_now: false
  • is_temporary: true 3. Option to Pay-Now
  • require_cc: false
  • pay_now: true
  • is_temporary: true Booking report : a.Requires pre-payment column
  • Yes (if that package setting is “Requires pre-payment”)
  • No (if that package setting is **not “**Requires pre-payment”) b.PayNow column
  • Yes (if user chose to pay now for that booking)
  • No (if user didn’t choose to pay now or if the setting is “Requires pre-payment” or “Pay on-site”)

Notes, Constraints & Assumptions

  1. Requires pre-payment = setting by package
  2. Option to PayNow = for packages not forced for payment via setting so we offer the payment by user’s choice. PayNow always requires a prepayment (i.e. 100% of the total booking price)
  3. Pay on-site = No PayNow option shows up on client side
  4. For tracking purposes, add 2 new columns in the booking report list. So we know % of users using this feature after a month of release
    1. Requires pre-payment column
  • Yes (if that package setting is “Requires pre-payment”)
  • No (if that package setting is **not “**Requires pre-payment”)
  1. PayNow column
  • Yes (if user chose to pay now for that booking)
  • No (if user didn’t choose to pay now or if the setting is “Requires pre-payment” or “Pay on-site”)

TODO / Task List / Action Items

[

3.basecamp.com

https://3.basecamp.com/5190892/buckets/30696659/todosets/5662070561

](https://3.basecamp.com/5190892/buckets/30696659/todosets/5662070561)

References

https://www.figma.com/file/iZf1pRlP4ptnLQP9tURtsI/Pay-now-update?node-id=0%3A1&t=gjUpZPIbTCKCXAqu-0

[

docs.google.com

https://docs.google.com/spreadsheets/d/1GuGIKg-VSLWOeFqb3DdofI_CLHKgbUpNxC1LjLP8eE0/edit?usp=drivesdk

](https://docs.google.com/spreadsheets/d/1GuGIKg-VSLWOeFqb3DdofI_CLHKgbUpNxC1LjLP8eE0/edit?usp=drivesdk)

Change History

NODate TimeWhat ChagedDescription
120 Jan 2023-Initial Document
223 Jan 2023Update ERD and query
324 Jan 2023Update API blueprint
425 Jan 2023Update payment now flow on checkout page