Princewil / flutter_paystack_plus

A package for Implement payment using paystack - Compatible on Android, iOS and Web
Apache License 2.0
6 stars 8 forks source link

Duplicate transaction reference error #15

Closed devbeedotdev closed 2 months ago

devbeedotdev commented 4 months ago

Getting a response code of 400 and a body message of duplicate transaction reference , on any transaction , i verify that i am using a unique reference. it happens immediately the text form is clicked using a life secret key - android .

Princewil commented 4 months ago

Can you share a screenshot of your code?

On Wed, 10 Jul 2024 at 18:06, Abolaji Ayeni @.***> wrote:

Getting a response code of 400 and a body message of duplicate transaction reference , on any transaction , i verify that i am using a unique reference. it happens immediately the text form is clicked using a life secret key - android .

— Reply to this email directly, view it on GitHub https://github.com/Princewil/flutter_paystack_plus/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJWWTE2XT3RLGTWIB57C76LZLVSXZAVCNFSM6AAAAABKVKHJSCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYDCMRXGMZDANY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

devbeedotdev commented 4 months ago

sure this is my code -

intiatePaystackPayment( context, ) { final uniqueTransRef = const Uuid().v4();

PayWithPayStack().now(
    context: context,
    secretKey: "sk_live_**************",
    customerEmail: "ayenibolaji07@gmail.com",
    reference: uniqueTransRef,
    callbackUrl: "setup in your paystack dashboard",
    currency: "NGN",
    paymentChannel: ["card"],
    amount: '20000',
    transactionCompleted: () {
      print("Transaction Successful");
    },
    transactionNotCompleted: () {
      print("Transaction Not Successful!");
    });

} }

Princewil commented 4 months ago

Hmm this is quite unprecedented🤔

Can you try using DateTime.now().millsecondsSinceEpoch instead of the Uuid package for your unique refs

devbeedotdev commented 4 months ago

Yes I firstly did that, i got the same error message, so i turned to the Uuid package.

Did you try it to see if you can recreate the problem ?

On Sun, Jul 14, 2024 at 12:32 AM Dr. Princewill @.***> wrote:

Hmm this is quite unprecedented🤔

Can you try using DateTime.now().millsecondsSinceEpoch instead of the Uuid package

— Reply to this email directly, view it on GitHub https://github.com/Princewil/flutter_paystack_plus/issues/15#issuecomment-2227137268, or unsubscribe https://github.com/notifications/unsubscribe-auth/A53DHHMWVCFRAOH4XL6SKY3ZMG2IVAVCNFSM6AAAAABKVKHJSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXGEZTOMRWHA . You are receiving this because you authored the thread.Message ID: @.***>

Princewil commented 4 months ago

No I haven't. Maybe I should I will give you a feedback when I do

Meanwhile, you can clone the example code, link on the package docs. You don't have to change anything, just input your secret and public key and then run the code, let's see if you still have the issue.

Princewil commented 2 months ago

First my apologies for the late feedback. I have gone through the issue and I couldn't replicate the issue. Pls clone this example code and try again.