Save Stripe Receipt number

main
Ashelyn Dawn 4 years ago
parent 47f128e692
commit 15c7bed4de

@ -75,7 +75,7 @@ module.exports = [{
mapId: 'paymentStripeMap',
idProperty: 'payment_intent_id',
properties: [
'reciept_email'
'receipt_email'
]
},{
mapId: 'deliveryMap',

@ -247,7 +247,8 @@ order.addPayment = async function(transaction, paymentIntent){
transaction.uuid,
paymentIntent.amount_received,
paymentIntent.id,
paymentIntent.receipt_email
paymentIntent.receipt_email,
paymentIntent.charges.data[0].receipt_number
],
returnType: 'order',
single: true

@ -215,7 +215,8 @@ create table sos."payment_stripe" (
foreign key (payment_uuid, payment_type) references sos."payment" (payment_uuid, payment_type),
stripe_payment_intent_id text unique not null,
stripe_reciept_email citext not null
stripe_receipt_email citext not null,
stripe_receipt_number text NULL
);
create table sos."shipment" (

@ -81,7 +81,7 @@ create or replace view sos.v_payment as
select
payment.*,
payment_stripe.stripe_payment_intent_id,
payment_stripe.stripe_reciept_email
payment_stripe.stripe_receipt_email
from sos."payment"
left join sos."payment_ks_reward" on payment_ks_reward.payment_uuid = payment.payment_uuid and payment_ks_reward.payment_type = payment.payment_type
left join sos."payment_stripe" on payment_stripe.payment_uuid = payment.payment_uuid and payment_stripe.payment_type = payment.payment_type;

@ -747,7 +747,7 @@ begin
where "transaction".transaction_uuid = _transaction_uuid;
end; $function$;
create or replace function sos.add_stripe_payment_to_transaction(_transaction_uuid uuid, _payment_value_cents integer, _stripe_intent_id text, _stripe_reciept_email citext)
create or replace function sos.add_stripe_payment_to_transaction(_transaction_uuid uuid, _payment_value_cents integer, _stripe_intent_id text, _stripe_receipt_email citext, _stripe_receipt_number text)
returns setof sos.v_order
language plpgsql
as $function$
@ -779,12 +779,14 @@ begin
payment_uuid,
payment_type,
stripe_payment_intent_id,
stripe_reciept_email
stripe_receipt_email,
stripe_receipt_number
) values (
_payment_uuid,
'stripe',
_stripe_intent_id,
_stripe_reciept_email
_stripe_receipt_email,
_stripe_receipt_number
);
select

@ -19,7 +19,7 @@ export default function CheckoutComplete({order}){
const stripePayment = latestTransaction.payments.find(p => p.stripe !== null)
if(stripePayment)
email = stripePayment.stripe.reciept_email
email = stripePayment.stripe.receipt_email
return (
<>

Loading…
Cancel
Save