Banktransfer shows up as failed
mrksmts opened this issue · 6 comments
When paying through a banktransfer the transaction shows up as failed while it should be pending.
This is the JSON MSP returns:
"success": true,
"data": {
"transaction_id": 3101735,
"order_id": "05c8ea21ed7400b0adf7ee4bc431ad62",
"created": "2018-11-08T10:21:52",
"currency": "EUR",
"amount": 45980,
"description": "Order #1587",
"var1": null,
"var2": null,
"var3": null,
"items": "",
"amount_refunded": 0,
"status": "initialized",
"financial_status": "initialized",
"reason": "",
"reason_code": "",
"fastcheckout": "NO",
"modified": "2018-11-08T10:21:52",
"customer": {
"locale": "en_GB",
"first_name": "",
"last_name": "",
"address1": "",
"address2": null,
"house_number": ,
"zip_code": "",
"city": "",
"state": null,
"country": "NL",
"country_name": null,
"phone1": ,
"phone2": "",
"email": ""
},
"payment_details": {
"recurring_id": null,
"type": "BANKTRANS",
"account_id": null,
"account_holder_name": "",
"external_transaction_id": 9201831131017350
},
"shopping_cart": {
"items": [
{
"name": "",
"description": "",
"unit_price": "380.00",
"currency": "EUR",
"quantity": 1,
"merchant_item_id": "",
"tax_table_selector": "",
"cashback": "",
"image": "",
"product_url": "",
"weight": {
"unit": null,
"value": null
},
"options": []
},
{
"name": "21% BTW",
"description": "21%",
"unit_price": 79.8,
"currency": "EUR",
"quantity": 1,
"merchant_item_id": "",
"tax_table_selector": "",
"cashback": "",
"image": "",
"product_url": "",
"weight": {
"unit": null,
"value": null
},
"options": []
}
]
},
"costs": [
{
"transaction_id": 1360421,
"description": "0.39 For Bank Transfer Transactions",
"type": "SYSTEM",
"amount": 0.39
}
],
"related_transactions": null,
"payment_methods": [
{
"account_holder_name": "",
"amount": 45980,
"currency": "EUR",
"description": "Order #1587",
"external_transaction_id": 9201831131017350,
"payment_description": "Bank Transfer",
"status": "initialized",
"type": "BANKTRANS"
}
]
}
}```
Currently, MSP does not support async transactions (where you initialize a transaction that is verified later.)
Another thing to note that the test account I have access to does not have the bank transfer payment option - perhaps this is geofenced?
Keeping this open, though, as this is something we might support down the road.
I was testing this on a local environment, also tested this on a staging environment which can be accessed by MSP.
When choosing BankTransfer and completing this the url MSP calls: /index.php?p=actions/commerce/payments/complete-payment&commerceTransactionHash=3c87b5f9adc0a5ec40193ecba7715164&transactionid=3c87b5f9adc0a5ec40193ecba7715164×tamp=1541681703
with the same data provided earlier.
After that the user gets redirected to the cancelled url.
I assume once you wired the money MSP will call the same with the value that payment has been completed.
The payment method can be found under Settings > Payment Methods
If it is not available to you I can create an API key for you in our account to test with. Send me a DM in Slack if you like.
Bank transfer will not be instant. The data you posted earlier has the status set to initialized
. It's still undetermined and can go either way. If you go to https://www.multisafepay.com/documentation/doc/Test%20Integration/, all the bank transfer test scenarios involve at least one minute delay. Which means that to take advantage of this, webhooks need to be implemented for this gateway, since it's not implemented at the moment.
We're having the same issue
and the biggest concern is that a user is redirected to the cancel url and the cart is not converted to an order.
The customer has he feeling something failed, and in the worst case, tries another payment or the logic cancels his order.
I think it's resolved by implementing the isPending
method in the Omnipay\MultiSafepay\Message\RestCompletePurchaseResponse
which make it follows the flow in
craft\commerce\services\Payments -> completePayment()
This makes sure it converts the cart into an actual order with status 'new' and paidStatus 'unpaid' because that's what the user acually did. He completed this order, but still needs to pay (offline).
/**
* {@inheritdoc}
*/
public function isPending()
{
return parent::isInitialized();
}
I think it's resolved by implementing the isPending method in the
Omnipay\MultiSafepay\Message\RestCompletePurchaseResponse
That is a 3rd party library, unfortunately. You can ask them to implement that or open a pull request to address that.
Hi @angrybrad Is the fix above somewhere on the roadmap for this plugin? We have a cliënt that is experiencing problems because of this. Thanks in advance!