Closed fabioportieri closed 1 year ago
can be closed, this is the correct syntax
export async function createSaleTransactionForOrder(
admin: AdminApiContext,
session: Session,
order: Order
): Promise<Transaction> {
const transaction: Transaction = new admin.rest.resources.Transaction({
session
});
transaction.order_id = order.id;
transaction.kind = 'sale'; // Specify the transaction type as 'sale;
transaction.amount = order.total_price;
transaction.currency = order.currency;
transaction.gateway = "Cash on Delivery (COD)";
transaction.user_id = order.customer!.id;
await transaction.save({
update: true,
});
return transaction;
}
Issue summary
@shopify/shopify-api
version: 7.6.0Expected behavior
save the transaction with no errors
Actual behavior
the error