Comments (2)
Hm, I checked my DB and there is no transaction_id since I use Stripe SCA.
from attendize.
Solved. We need to get our payment identifier from the payment_intent and initiate the refund via that.
Sorry for not doing a proper commit; we have it on our own version control system (svn), and I don't want to check it out.
StripeSCA.php:
public function refundTransaction($order, $refund_amount, $refund_application_fee)
{
$paymentIntentResponse = $this->gateway->fetchPaymentIntent([
'paymentIntentReference' => $order->payment_intent,
])->send();
if ($paymentIntentResponse->isSuccessful()) {
$data = $paymentIntentResponse->getData();
Log::debug($data);
$chargeId = $data['latest_charge'];
$request = $this->gateway->refund([
'transactionReference' => $chargeId,
'amount' => $refund_amount,
'refundApplicationFee' => $refund_application_fee
]);
$response = $request->send();
if ($response->isSuccessful()) {
$refundResponse['successful'] = true;
} else {
$refundResponse['successful'] = false;
$refundResponse['error_message'] = $response->getMessage();
}
} else {
$refundResponse['successful'] = false;
$refundResponse['error_message'] = $response->getMessage();
}
return $refundResponse;
}
Also, modify checkValidRefundState in OrderRefund.php so that it will not throw an exception (because originally it only checks for transaction_id, but we don't have that when using SCA, only the payment_intent field.
private function checkValidRefundState()
{
$errorMessage = false;
if (!$this->order->transaction_id && !$this->order->payment_intent) {
$errorMessage = trans("Controllers.order_cant_be_refunded");
}
if ($this->order->is_refunded) {
$errorMessage = trans('Controllers.order_already_refunded');
} elseif ($this->maximumRefundableAmount->isZero()) {
$errorMessage = trans('Controllers.nothing_to_refund');
} elseif ($this->refundAmount->isGreaterThan($this->maximumRefundableAmount)) {
// Error if the partial refund tries to refund more than allowed
$errorMessage = trans('Controllers.maximum_refund_amount', [
'money' => $this->maximumRefundableAmount->display(),
]);
}
if ($errorMessage) {
throw new OrderRefundException($errorMessage);
}
}
from attendize.
Related Issues (20)
- [BUG] Call to undefined function Superbalist\Money\bccomp() with ticket price 0 HOT 3
- [FEATURE] Disable User Sign Up via 'Sign Up form'
- when i click account setting option in profile menu , it showing internal server error(500)
- showing internal server error(500)
- Whoops!, it looks like the server returned an error. HOT 3
- [FEATURE] Adding field on registration form HOT 4
- [BUG] Stripe SCA payments with 3D Secure fail due to missing return url in confirm call
- API
- [BUG] Unable to Install HOT 4
- Cannot change event details.(Or delete it)
- How can I share entry control on several doors without giving the administrator password to those who support me? HOT 1
- validate email entry
- PHP Error installing Docker Container HOT 2
- "Whoops!, it looks like the server returned an error. Please try again, or contact the webmaster if the problem persists."/ WKHTML2PDF didn't return any data problem. HOT 2
- [BUG] Can't reset organiser user passwords - temp fix included
- No Support means free license ?
- Error on printing ticket HOT 3
- [BUG] Error building docker version HOT 1
- [BUG] Installer does not work with postgres HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from attendize.