Skip to content

Commit

Permalink
Added CSRF field output for Laravel compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Hall committed Nov 11, 2016
1 parent 06ccdf4 commit 0ca9771
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Objects/SimpleStripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ private function getPaymentForm($type)
$filename = basename($type).'.html';
$html = file_get_contents($this->paymentFormDirectory.$filename);
$html = str_replace('[[SIMPLESTRIPE_PUBLISHABLE_KEY]]', $this->publishableKey, $html);
$html = str_replace('[[CSRF_FIELD]]', function_exists("csrf_field") ? csrf_field() : '', $html);
return $html;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Resources/PaymentForms/Simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
</label>
</div>

[[CSRF_FIELD]]

<input type="submit" class="submit" value="Submit Payment">
</form>

Expand Down

0 comments on commit 0ca9771

Please sign in to comment.