mohammeddawida / moyasar_payment

Flutter library for Moyasar. Supports Apple Pay, STC Pay and Credit Card.
https://pub.dev/packages/moyasar_payment
MIT License
13 stars 7 forks source link

Validation Error with CreditCard #4

Closed AhmedAbogameel closed 2 years ago

AhmedAbogameel commented 2 years ago

i'm getting message "Validation Error" i can not get where the error

my payload is :

I/flutter ( 4379): svfdsb dfvfdb // name
I/flutter ( 4379): 4111111111111111 // card number
I/flutter ( 4379): 123 // cvv
I/flutter ( 4379): 12 // month
I/flutter ( 4379): 24 // year
I/flutter ( 4379): 10.0 // amount
I/flutter ( 4379): Validation Failed // error message

This is my code :

    print(creditModel.cardHolderName);
    print(creditModel.cardNumber);
    print(creditModel.cvv);
    print(creditModel.month);
    print(creditModel.year);
    print(amount);
    PayModel res = await _moyasarPayment.creditCard(
      description: 'Paying for a service with Credit/Mastercard.',
      amount: amount,
      publishableKey: _publishableKey,
      cardHolderName: creditModel.cardHolderName,
      cardNumber: creditModel.cardNumber,
      cvv: creditModel.cvv,
      expiryManth: creditModel.month,
      expiryYear: creditModel.year,
      callbackUrl: 'https://example.com/orders',
    );
    print(res.message);
farhioussama1969 commented 2 years ago

i faced the same error. "Validation Error" its because something wrong in the function parameters, and i think that the function messing the "company" parameter, for more details: https://drive.google.com/file/d/1XYDBkbGuRN4qGo3fvhZtmMPUqslDsCf_/view?usp=sharing

mohammeddawida commented 2 years ago

@farhioussama1969 Thank you, I will add it in the next update

AhmedAbogameel commented 2 years ago

@mahmmd @farhioussama1969

Hello guys, i have fixed this issue in this pull request

https://github.com/mahmmd/moyasar_payment/pull/5