Documentation: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest
key = "OpBmGrJ5i03KBAq8pstw-4ZHX5YyyaOaGgmoV2zfcHK"
encoded_key = Base64.strict_encode64 key
table_url = "https://api.resos.com/v1/tables"
bookings_url = "https://api.resos.com/v1/bookings?fromDateTime=2020-10-30T00%3A00%3A00%2B01%3A00&toDateTime=2020-10-30T23%3A59%3A59%2B01%3A00&limit=2&skip=1"
RestClient.get(url, headers={})
ResOs.configure do |config|
config.api_key = "OpBmGrJ5i03KBAq8pstw-4ZHX5YyyaOaGgmoV2zfcHK"
end
ResOs.bookings
ResOs.bookings(date: '2020-12-01')
You can also pass in :limit
and :skip
.
ResOs.bookings(id: 'CRJE9Bbrqz2L8NbjT')
ResOs.bookings(type: :post, <pass in bookings details>)
ResOs.bookings(
type: :put,
id: 'ip2ynBTToxvBGSdou'
<pass in bookings details>
)
The voucher code is generated at create
.
A voucher must be activated (set activated
to true
)
voucher = Voucher.last
doc = CardGenerator.new(voucher)
file = File.open(doc.path)
voucher.pdf_card.attach(io: file, filename: 'test.pdf')
This generator takes more options and can be configured with several templates.
There are currently 3 templates available.
# CustomCardGenerator.new(<voucher obj>, <render:boolean/default: true>, <variant:integer>, <locale:symbol/default: :sv>)
CustomCardGenerator.new(voucher, true, 1, :sv)
An interesting solution is the MJML gem. A PR with good examples can be found here
Previewing emails:
Halt the execution of a spec using binding.pry
. Make sure that current_email
is available and open the email in the browser using current_email.save_and_open
. Preview the source of the email in the browser. Copy the source and head over to https://mjml.io/try-it-live/ to generate a preview with styling included.
One way to gather data of usage, but also to track att activities of a vendor, could be to make use of Public Activity gem.
The affiliation set-up is influenced by this gist. Not sure if this the way to go, but I don't want to spend to much time onn this ;-)
Int the MVP, the VAT lookup is done using the ValVat gem. The problem with this solution is the input mechmanizm on the fronmt end. Business owners in Sweden are used to enter their identification numbers (Organisationsnummer issued by the tax Swedish Tax Agency - Skatteverket), rather than VAT-numbers. The upside is that we can go more international with this solution. Of course, only within bounds on the European Union.
This app is in production using fly.io
LOGS:
fly logs
CONSOLE:
fly ssh console -C "/app/bin/rails console"
SWISH Payments In order to take payments with Swidish instant payment system SWISH, we need to implement a solution based on https://github.com/tochman/swish_api
- Mark the vendor as able to accept swish by adding an attribute
- Store the Vendors SWISH number
- Display a Button for swish payment.
- open a form and input the customers phone number (or generate a QR code)
- once the payment clears, activate th voucher with the customer as owner.