Merge branch 'chrisjrn/stripe'
This commit is contained in:
		
						commit
						3c06914656
					
				
					 4 changed files with 32 additions and 4 deletions
				
			
		|  | @ -230,6 +230,7 @@ PINAX_BOXES_HOOKSET = "pinaxcon.hooks.PinaxBoxesHookSet" | |||
| 
 | ||||
| PINAX_STRIPE_PUBLIC_KEY = os.environ.get("STRIPE_PUBLIC_KEY", "your test public key") | ||||
| PINAX_STRIPE_SECRET_KEY = os.environ.get("STRIPE_SECRET_KEY", "your test secret key") | ||||
| PINAX_STRIPE_SEND_EMAIL_RECEIPTS = False | ||||
| 
 | ||||
| # Registrasion Attendee profile model | ||||
| ATTENDEE_PROFILE_MODEL = "pinaxcon.registrasion.models.AttendeeProfile" | ||||
|  |  | |||
|  | @ -16,7 +16,8 @@ | |||
|     You can give this URL to your accounts department to pay your registration.</p> | ||||
| 
 | ||||
|   <div> | ||||
|     <a class="btn btn-default" href="{% url "demopay" invoice.id invoice.user.attendee.access_code %}">Pay this invoice</a> | ||||
|     <a class="btn btn-default" href="{% url "demopay" invoice.id invoice.user.attendee.access_code %}">Pay this invoice (dummy)</a> | ||||
|     <a class="btn btn-default" href='{% url "registripe_card" invoice.id %}'>Pay this invoice with Stripe</a> | ||||
|     {% if user.is_staff %} | ||||
|       <a class="btn btn-default" href="{% url "manual_payment" invoice.id %}">Apply manual payment</a> | ||||
|     {% endif %} | ||||
|  |  | |||
|  | @ -35,13 +35,14 @@ | |||
|     function stripeResponseHandler(status, response) { | ||||
|       // Grab the form: | ||||
|       var $form = $('#payment-form'); | ||||
|       var $submit = $form.find('input[type=submit]') | ||||
|       if (response.error) { // Problem! | ||||
|         console.log(response.error.message); | ||||
| 
 | ||||
|         // Show the errors on the form: | ||||
|         $form.find('#payment-errors').text(response.error.message); | ||||
|         $form.find('#payment-errors-outer').show(); | ||||
|         $form.find('input[type=submit]').prop('disabled', false); // Re-enable submission | ||||
|         $submit.prop('disabled', false); // Re-enable submission | ||||
| 
 | ||||
|       } else { // Token was created! | ||||
|         console.log(response); | ||||
|  | @ -53,8 +54,11 @@ | |||
|         $form = $form.append($('<input type="hidden" name="stripe_token" />').val(token)); | ||||
| 
 | ||||
|         // Submit the form: | ||||
|         $form.find('input[type=submit]').prop('disabled', false); | ||||
|         $form.find('input[type=submit]').click(); | ||||
| 
 | ||||
|         $submit.prop('disabled', false); | ||||
|         $submit.click(); | ||||
|         $submit.prop('disabled', true); | ||||
|         $form.append($('<p>').text("Processing your payment. Please do not refresh.")); | ||||
|       } | ||||
|     }; | ||||
|   </script> | ||||
|  |  | |||
							
								
								
									
										22
									
								
								pinaxcon/templates/registrasion/stripe/refund.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								pinaxcon/templates/registrasion/stripe/refund.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| {% extends "site_base.html" %} | ||||
| {% load bootstrap %} | ||||
| {% load registrasion_tags %} | ||||
| 
 | ||||
| {% block body %} | ||||
| 
 | ||||
|   <h2>Stripe refunds for credit note #{{ credit_note.id}}</h2> | ||||
| 
 | ||||
|   <p>This credit note is valued at ${{ credit_note.value }}.</p> | ||||
| 
 | ||||
|   <h3>Available refunds</h3> | ||||
| 
 | ||||
|   <p>Currently credit notes can only be cashed out in full in a single | ||||
|     transaction. If you need to cash out to multiple small payments, you will | ||||
|     need to manually invoke the refunds from the Stripe Dashboard.</p> | ||||
| 
 | ||||
|   <form method="post"> | ||||
|     {% csrf_token %} | ||||
|     {{form|bootstrap}} | ||||
|     <input id="submit" class="btn btn-primary" type="submit" value="Refund {{ credit_note.value }} to payment source" /> | ||||
|   </form> | ||||
| {% endblock %} | ||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer