FinalFormBillingAddress
This commit is contained in:
@@ -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',
|
||||
|
Reference in New Issue
Block a user