@@ -30,11 +30,11 @@ function StripeCheckoutView(config) {
30
30
self . createCheckoutSession = function ( ) {
31
31
var priceId = document . getElementById ( self . levelId ) . value ;
32
32
// One-time donation fields
33
- var name = document . getElementById ( 'id_name' ) . value ;
34
- var email = document . getElementById ( 'id_email' ) . value ;
35
- var logoUrl = document . getElementById ( 'id_logo_url' ) . value ;
36
- var siteUrl = document . getElementById ( 'id_site_url' ) . value ;
37
- var public = document . getElementById ( 'id_public' ) . checked ;
33
+ var name = document . getElementById ( 'id_name' ) ;
34
+ var email = document . getElementById ( 'id_email' ) ;
35
+ var logoUrl = document . getElementById ( 'id_logo_url' ) ;
36
+ var siteUrl = document . getElementById ( 'id_site_url' ) ;
37
+ var public = document . getElementById ( 'id_public' ) ;
38
38
39
39
return fetch ( self . checkoutSessionUrl , {
40
40
method : "POST" ,
@@ -44,11 +44,11 @@ function StripeCheckoutView(config) {
44
44
} ,
45
45
body : JSON . stringify ( {
46
46
priceId : priceId ,
47
- name : name ,
48
- email : email ,
49
- logoUrl : logoUrl ,
50
- siteUrl : siteUrl ,
51
- public : public ,
47
+ name : name ? name . value : null ,
48
+ email : email ? email . value : null ,
49
+ logoUrl : logoUrl ? logUrl . value : null ,
50
+ siteUrl : siteUrl ? siteUrl . value : null ,
51
+ public : public ? public . checked : null ,
52
52
} )
53
53
} ) ;
54
54
} ;
0 commit comments