Save Stripe Receipt number

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

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

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

@ -215,7 +215,8 @@ create table sos."payment_stripe" (
foreign key (payment_uuid, payment_type) references sos."payment" (payment_uuid, payment_type), foreign key (payment_uuid, payment_type) references sos."payment" (payment_uuid, payment_type),
stripe_payment_intent_id text unique not null, 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" ( create table sos."shipment" (

@ -81,7 +81,7 @@ create or replace view sos.v_payment as
select select
payment.*, payment.*,
payment_stripe.stripe_payment_intent_id, payment_stripe.stripe_payment_intent_id,
payment_stripe.stripe_reciept_email payment_stripe.stripe_receipt_email
from sos."payment" 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_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; 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; where "transaction".transaction_uuid = _transaction_uuid;
end; $function$; 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 returns setof sos.v_order
language plpgsql language plpgsql
as $function$ as $function$
@ -779,12 +779,14 @@ begin
payment_uuid, payment_uuid,
payment_type, payment_type,
stripe_payment_intent_id, stripe_payment_intent_id,
stripe_reciept_email stripe_receipt_email,
stripe_receipt_number
) values ( ) values (
_payment_uuid, _payment_uuid,
'stripe', 'stripe',
_stripe_intent_id, _stripe_intent_id,
_stripe_reciept_email _stripe_receipt_email,
_stripe_receipt_number
); );
select select

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

Loading…
Cancel
Save