File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ export const paypalListPayments = async (modBody: AppModuleBody<'list_payments'>
105105 if ( ! ( await docRef . get ( ) ) . exists ) {
106106 await createPaypalWebhook ( ) ;
107107 const paypalProfile = await createPaypalProfile ( ) ;
108- await docRef . set ( paypalProfile ) ;
108+ if ( paypalProfile ) {
109+ await docRef . set ( paypalProfile ) ;
110+ }
109111 }
110112 paypalPayment = await createPaypalPayment ( parseToPaypalPayment ( params ) ) ;
111113 } catch ( _err : any ) {
Original file line number Diff line number Diff line change @@ -112,7 +112,8 @@ export const executePaypalPayment = async (
112112export const createPaypalProfile = async ( ) => {
113113 const { settingsContent } = config . get ( ) ;
114114 const { domain } = settingsContent ;
115- return ( await getPaypalAxios ( ) ) . post ( '/v1/payment-experience/web-profiles/' , {
115+ const paypalAxios = await getPaypalAxios ( ) ;
116+ const { data } = await paypalAxios . post ( '/v1/payment-experience/web-profiles/' , {
116117 name : `EComPlus_${ Date . now ( ) } ` ,
117118 presentation : {
118119 brand_name : settingsContent . name || 'Loja Virtual' ,
@@ -133,6 +134,7 @@ export const createPaypalProfile = async () => {
133134 : 'http://www.yeowza.com' ,
134135 } ,
135136 } ) ;
137+ return data ;
136138} ;
137139
138140export const createPaypalWebhook = async ( ) => {
You can’t perform that action at this time.
0 commit comments