mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 08:17:32 -05:00 
			
		
		
		
	Update .env vars for wepay
This commit is contained in:
		
							parent
							
								
									0bc3ec111d
								
							
						
					
					
						commit
						dc7f4507cd
					
				@ -149,7 +149,7 @@ return [
 | 
				
			|||||||
    'invoiceninja_hosted_pdf_generation' => env('NINJA_HOSTED_PDF', false),
 | 
					    'invoiceninja_hosted_pdf_generation' => env('NINJA_HOSTED_PDF', false),
 | 
				
			||||||
    'ninja_stripe_key' => env('NINJA_STRIPE_KEY', null),
 | 
					    'ninja_stripe_key' => env('NINJA_STRIPE_KEY', null),
 | 
				
			||||||
    'wepay' => [
 | 
					    'wepay' => [
 | 
				
			||||||
        'environment' => env('WEPAY_ENVIRONMENT', 'staging'),
 | 
					        'environment' => env('WEPAY_ENVIRONMENT', 'stage'),
 | 
				
			||||||
        'client_id' => env('WEPAY_CLIENT_ID', ''),
 | 
					        'client_id' => env('WEPAY_CLIENT_ID', ''),
 | 
				
			||||||
        'client_secret' => env('WEPAY_CLIENT_SECRET',''),
 | 
					        'client_secret' => env('WEPAY_CLIENT_SECRET',''),
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
 | 
				
			|||||||
@ -44,7 +44,7 @@
 | 
				
			|||||||
<script type="text/javascript" src="https://static.wepay.com/min/js/tokenization.4.latest.js"></script>
 | 
					<script type="text/javascript" src="https://static.wepay.com/min/js/tokenization.4.latest.js"></script>
 | 
				
			||||||
<script type="text/javascript">
 | 
					<script type="text/javascript">
 | 
				
			||||||
(function() {
 | 
					(function() {
 | 
				
			||||||
    WePay.set_endpoint("stage"); // change to "production" when live
 | 
					    WePay.set_endpoint({{ config('ninja.wepay.environment') }}); // change to "production" when live
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Shortcuts
 | 
					    // Shortcuts
 | 
				
			||||||
    var d = document;
 | 
					    var d = document;
 | 
				
			||||||
@ -63,7 +63,7 @@
 | 
				
			|||||||
    addEvent(d.id('card_button'), 'click', function() {
 | 
					    addEvent(d.id('card_button'), 'click', function() {
 | 
				
			||||||
        var userName = [valueById('cardholder_name')].join(' ');
 | 
					        var userName = [valueById('cardholder_name')].join(' ');
 | 
				
			||||||
            response = WePay.credit_card.create({
 | 
					            response = WePay.credit_card.create({
 | 
				
			||||||
            "client_id":        valueById('client_id'),
 | 
					            "client_id":        {{ config('ninja.wepay.client_id') }},
 | 
				
			||||||
            "user_name":        valueById('cardholder_name'),
 | 
					            "user_name":        valueById('cardholder_name'),
 | 
				
			||||||
            "email":            valueById('email'),
 | 
					            "email":            valueById('email'),
 | 
				
			||||||
            "cc_number":        valueById('card-number'),
 | 
					            "cc_number":        valueById('card-number'),
 | 
				
			||||||
@ -80,6 +80,11 @@
 | 
				
			|||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                // call your own app's API to save the token inside the data;
 | 
					                // call your own app's API to save the token inside the data;
 | 
				
			||||||
                // show a success page
 | 
					                // show a success page
 | 
				
			||||||
 | 
					                var token = response.credit_card_id;
 | 
				
			||||||
 | 
					                // Insert the token into the form so it gets submitted to the server
 | 
				
			||||||
 | 
					                $form.append($('<input type="hidden" name="source_token"/>').val(token));
 | 
				
			||||||
 | 
					                // and submit
 | 
				
			||||||
 | 
					                $form.get(0).submit();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user