You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.
This application is not handling the case where the transaction fails.
The Paymill Bridge will accept the credit card, but the transaction itself will get rejected.
So the tokenization will be successful as the credit card number format (the checksum, first digit ..) is correct but when you try to create a transaction you will receive an error.
You can for instance make a payment with the test cards like 4111 1111 1111 1111. It will go through the tokenization process, but when the transaction is made, Paymill will return something like this.
In your save_with_payment method, you only check if for api errors not transaction errors.
you could do something like this
defsave_with_paymentifvalid?client=Paymill::Client.createemail: email,description: namepayment=Paymill::Payment.createtoken: paymill_card_token,client: client.idsubscription=Paymill::Subscription.createoffer: plan.paymill_id,client: client.id,payment: payment.idifcheck_transaction?(client)self.paymill_id=subscription.idsave!endendrescuePaymill::PaymillError=>elogger.error"Paymill error while creating customer: #{e.message}"errors.add:base,"There was a problem with your credit card. Please try again."falseenddefcheck_transaction?(client)casePaymill::Transaction.all({client: client.id,order: "created_at_desc"})[0].response_codewhen20000then;returntrue# all the possible errors should be listed with translations. For instancewhen40104thenerrors.add:base,"Card invalid.";returnfalse#40104 is the response_code you get when using a test cardelseerrors.add:base,"Something whent wrong.";returnfalseendend
The text was updated successfully, but these errors were encountered:
I am sorry. I really do not have the time for it. Maybe you could add a link to this issue on the info page. New users should be warned about this issue.
This application is not handling the case where the transaction fails.
The Paymill Bridge will accept the credit card, but the transaction itself will get rejected.
So the tokenization will be successful as the credit card number format (the checksum, first digit ..) is correct but when you try to create a transaction you will receive an error.
You can for instance make a payment with the test cards like 4111 1111 1111 1111. It will go through the tokenization process, but when the transaction is made, Paymill will return something like this.
Your app have to handle this.
In your save_with_payment method, you only check if for api errors not transaction errors.
you could do something like this
The text was updated successfully, but these errors were encountered: