Automatic stripe customers; address

This commit is contained in:
Sebastian Rindom
2020-07-14 08:10:09 +02:00
parent cd989c56a7
commit 44c7177e43
7 changed files with 24 additions and 18 deletions
+7 -4
View File
@@ -21,10 +21,13 @@ class OrderSubscriber {
this.eventBus_.subscribe("order.placed", async order => {
await this.customerService_.addOrder(order.customer_id, order._id)
await this.customerService_.addAddress(
order.customer_id,
order.shipping_address
)
const address = {
...order.shipping_address,
}
delete address._id
await this.customerService_.addAddress(order.customer_id, address)
})
this.eventBus_.subscribe("order.placed", async order => {