FinalFormBillingAddress

This commit is contained in:
DavidBelisle
2022-12-12 13:47:44 -05:00
parent ef70c2b453
commit 4bf0e7ca45
2 changed files with 15 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ const PaymentForm = ({ cost, invoice }) => {
const onSubmit = async (e) => {
e.preventDefault();
//e.preventDefault();
setIsLoading(true);
const { error } = await stripe.createPaymentMethod({
type: "card",
@@ -129,8 +129,16 @@ const PaymentForm = ({ cost, invoice }) => {
invoice.email = cardEmail;
invoice.phone = cardPhone;
invoice.lastFourDigits = result.token.card.last4;
invoice.billCivicNumber = currentAdress.civicNumber;
invoice.billAppartment = currentAdress.appartment;
invoice.billStreet = currentAdress.street;
invoice.billCity = currentAdress.city;
invoice.billProvince = currentAdress.province;
invoice.billCountry = currentAdress.country;
invoice.billPostalCode = currentAdress.postalCode;
const json = JSON.stringify(invoice);
console.log(invoice);
fetch(`https://localhost:7292/api/Invoice`, {
method: 'POST',