@ -82,7 +82,7 @@ import Stripe
paymentContext . hostViewController = self . viewController
}
customerContext . clearCache dCustomer ( )
customerContext . clearCache ( )
}
@ -235,19 +235,20 @@ import Stripe
print ( " [StripePaymentsPlugin].paymentContextDidChange: \( resultMsg ) " )
successCallback ( paymentStatusCallback , resultMsg , keepCallback : true )
}
// T h i s c a l l b a c k i s t r i g g e r e d w h e n r e q u e s t P a y m e n t ( ) c o m p l e t e s s u c c e s s f u l l y t o c r e a t e a S o u r c e .
// T h i s S o u r c e c a n t h e n b e u s e d b y t h e a p p t o p r o c e s s a p a y m e n t ( c r e a t e a c h a r g e , s u b s c r i p t i o n e t c . )
func paymentContext ( _ paymentContext : STPPaymentContext , didCreatePaymentResult paymentResult : STPPaymentResult , completion : @ escaping STP Error Block) {
func paymentContext ( _ paymentContext : STPPaymentContext , didCreatePaymentResult paymentResult : STPPaymentResult , completion : @ escaping STP PaymentStatus Block) {
// C r e a t e c h a r g e u s i n g p a y m e n t r e s u l t
let resultMsg : [ String : Any ] = [
" status " : " PAYMENT_CREATED " ,
" source " : paymentResult . source . stripeID
" source " : paymentResult . paymentMethod . stripeId
// " s o u r c e " : p a y m e n t R e s u l t . s o u r c e . s t r i p e I D
]
print ( " [StripePaymentsPlugin].paymentContext.didCreatePaymentResult: \( resultMsg ) " )
successCallback ( paymentStatusCallback , resultMsg , keepCallback : true )
completion ( nil )
completion ( STPPaymentStatus . success , nil )
}
// T h i s c a l l b a c k t r i g g e r s d u e t o :
@ -313,4 +314,3 @@ import Stripe
}
}