forked from shetabit/payment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b995318
commit 745f5a7
Showing
4 changed files
with
194 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
return [ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Default Driver | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This value determines which of the following gateway to use. | ||
| You can switch to a different driver at runtime. | ||
| | ||
*/ | ||
'default' => 'zarinpal', | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| List of Drivers | ||
|-------------------------------------------------------------------------- | ||
| | ||
| These are the list of drivers to use for this package. | ||
| You can change the name. Then you'll have to change | ||
| it in the map array too. | ||
| | ||
*/ | ||
'drivers' => [ | ||
'zarinpal' => [ // set urls to https://sandbox.zarinpal.com/pg/rest/WebGate/ for using sandbox | ||
'apiPurchaseUrl' => 'https://www.zarinpal.com/pg/rest/WebGate/PaymentRequest.json', | ||
'apiPaymentUrl' => 'https://www.zarinpal.com/pg/StartPay/', | ||
'apiVerificationUrl' => 'https://www.zarinpal.com/pg/rest/WebGate/PaymentVerification.json', | ||
'merchantId' => '', | ||
'callbackUrl' => 'http://yoursite.com/path/to', | ||
'description' => 'payment in '.config('app.name'), | ||
], | ||
'irankish' => [ | ||
'apiPurchaseUrl' => 'https://ikc.shaparak.ir/XToken/Tokens.xml', | ||
'apiPaymentUrl' => 'https://ikc.shaparak.ir/TPayment/Payment/index/', | ||
'apiVerificationUrl' => 'https://ikc.shaparak.ir/XVerify/Verify.xml', | ||
'merchantId' => '', | ||
'sha1Key' => '', | ||
'callbackUrl' => 'http://yoursite.com/path/to', | ||
'description' => 'payment in '.config('app.name'), | ||
], | ||
], | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Class Maps | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This is the array of Classes that maps to Drivers above. | ||
| You can create your own driver if you like and add the | ||
| config in the drivers array and the class to use for | ||
| here with the same name. You will have to extend | ||
| Shetabit\Payment\Abstracts\Driver in your driver. | ||
| | ||
*/ | ||
'map' => [ | ||
'zarinpal' => \Shetabit\Payment\Drivers\Zarinpal::class, | ||
'irankish' => \Shetabit\Payment\Drivers\Irankish::class, | ||
] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Forwarding to secure payment provider</title> | ||
<style> | ||
.text-center { | ||
text-align: center; | ||
} | ||
.mt-2 { | ||
margin-top: 2em; | ||
} | ||
.spinner { | ||
margin: 100px auto 0; | ||
width: 70px; | ||
text-align: center; | ||
} | ||
.spinner > div { | ||
width: 18px; | ||
height: 18px; | ||
background-color: #333; | ||
border-radius: 100%; | ||
display: inline-block; | ||
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both; | ||
animation: sk-bouncedelay 1.4s infinite ease-in-out both; | ||
} | ||
.spinner .bounce1 { | ||
-webkit-animation-delay: -0.32s; | ||
animation-delay: -0.32s; | ||
} | ||
.spinner .bounce2 { | ||
-webkit-animation-delay: -0.16s; | ||
animation-delay: -0.16s; | ||
} | ||
@-webkit-keyframes sk-bouncedelay { | ||
0%, 80%, 100% { -webkit-transform: scale(0) } | ||
40% { -webkit-transform: scale(1.0) } | ||
} | ||
@keyframes sk-bouncedelay { | ||
0%, 80%, 100% { | ||
-webkit-transform: scale(0); | ||
transform: scale(0); | ||
} 40% { | ||
-webkit-transform: scale(1.0); | ||
transform: scale(1.0); | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body onload="submitForm();"> | ||
<div class="spinner"> | ||
<div class="bounce1"></div> | ||
<div class="bounce2"></div> | ||
<div class="bounce3"></div> | ||
</div> | ||
<form class="text-center mt-2" method="{{ $method }}" action="{{ $action }}"> | ||
<p>Forwarding to secure payment provider.</p> | ||
<p> | ||
If you are not automatically redirected to the payment website with in | ||
<span id="countdown">10</span> | ||
seconds... | ||
</p> | ||
|
||
@foreach($inputs as $name => $value) | ||
<input type="hidden" name="{{ $name }}" value="{{ $value }}"> | ||
@endforeach | ||
|
||
<button type="submit">Click here</button> | ||
</form> | ||
<script> | ||
// Total seconds to wait | ||
var seconds = 10; | ||
function submitForm() { | ||
document.forms[0].submit(); | ||
} | ||
function countdown() { | ||
seconds = seconds - 1; | ||
if (seconds <= 0) { | ||
// submit the form | ||
submitForm(); | ||
} else { | ||
// Update remaining seconds | ||
document.getElementById("countdown").innerHTML = seconds; | ||
// Count down using javascript | ||
window.setTimeout("countdown()", 1000); | ||
} | ||
} | ||
// Run countdown function | ||
countdown(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters