solidusio / solidus_bolt

BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

Authorize Payment #30

Closed DanielePalombo closed 2 years ago

DanielePalombo commented 2 years ago

In order to create the Bolt transaction and store payment on solidus we should get the right information from the js API, and call the Checkout update API providing the right payment and source structure.

Then we have to implement the SolidusGateway::Gateway#authorize method. This method will receive the amount, payment_source, and gateway_options and should create Spree::Payment. The PaymentSource should have the credit card info tokenized on the payment source, so that calling Authorize Service it will give back the transaction reference to store on the response_code. It would be nice to store even the credit_card_id on the SolidusBolt::PaymentSource, so by providing a method SolidusBolt::PaymentSource#reusable? which returns true, the payment source will be shown to the user for further payment.

This is dependent on https://github.com/nebulab/solidus_bolt/issues/13