wilburx9 / rave_flutter

A Flutter plugin for Flutterwaves's rave.
Apache License 2.0
31 stars 58 forks source link

Error after switching to live key #47

Open mopilo opened 3 years ago

mopilo commented 3 years ago

RaveResult{status: RaveStatus.error, rawResponse: null, message: ER_CANT_AGGREGATE_2COLLATIONS: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='}

how can I solve this?

mopilo commented 3 years ago

@wilburt

mopilo commented 3 years ago

this happens when stage is false

wilburx9 commented 3 years ago

"ER_CANT_AGGREGATE_2COLLATIONS" sounds like an error from MariaDB. I believe this is coming from Rave backend.

mopilo commented 3 years ago

Yea, seems rave updated their url to version 3, please can you check that?

mopilo commented 3 years ago

@wilburt

wilburx9 commented 3 years ago

Yea, seems rave updated their url to version 3, please can you check that?

Please, where did you get this information?

mopilo commented 3 years ago

Yea, seems rave updated their url to version 3, please can you check that?

Please, where did you get this information?

Flutterwave has a new plugin for flutter and has information about the new url version. the plugin is buggy and not as clean as urs. https://pub.dev/packages/flutterwave

wilburx9 commented 3 years ago

Do you mean this "https://api.ravepay.co/v3/sdkcheckout/"? I can't seem to find any public information about it.

mopilo commented 3 years ago

Do you mean this "https://api.ravepay.co/v3/sdkcheckout/"? I can't seem to find any public information about it.

Yes. the new url it requires authorization bearer to be public or secret key. Please were you able to replicate the error I had?

wilburx9 commented 3 years ago

No, I didn't. I no longer have access to live keys. Please, can you send paste the construction of the Charge object?

mopilo commented 3 years ago

for this https://pub.dev/packages/flutterwave ?

wilburx9 commented 3 years ago

Nope, for this package.

mopilo commented 3 years ago

static final String basePath = "/flwv3-pug/getpaidx/api"; final String _chargeEndpoint = "$basePath/charge";

Future charge(ChargeRequestBody body) async { try { final response = await this ._httpService .dio .post(_chargeEndpoint, data: body.toJson()); return ChargeResponseModel.fromJson(response.data); } on DioError catch (e) { throw RaveException(data: e?.response?.data); } catch (e) { throw RaveException(); } }

class ChargeResponseModel extends Equatable { final String status; final String message; final String validateInstructions; final String validateInstruction; final String suggestedAuth; final String chargeResponseCode; final String authModelUsed; final String flwRef; final String txRef; final String chargeResponseMessage; final String authUrl; final String appFee; final String currency; final String chargedAmount; final String redirectUrl; final bool hasData; final Map rawResponse;

ChargeResponseModel({ @required this.status, @required this.message, @required this.validateInstructions, @required this.suggestedAuth, @required this.chargeResponseCode, @required this.authModelUsed, @required this.flwRef, @required this.txRef, @required this.chargeResponseMessage, @required this.authUrl, @required this.appFee, @required this.currency, @required this.chargedAmount, @required this.redirectUrl, @required this.hasData, @required this.rawResponse, @required this.validateInstruction, });

factory ChargeResponseModel.fromJson(Map<String, dynamic> json) { Map<String, dynamic> data = json["data"] ?? {}; return ChargeResponseModel( status: json["status"], message: json["message"], hasData: data.isNotEmpty, suggestedAuth: data["suggested_auth"], chargeResponseCode: data["chargeResponseCode"], authModelUsed: data["authModelUsed"], flwRef: data["flwRef"], validateInstruction: data["validateInstruction"], validateInstructions: data.containsKey("validateInstructions") ? data["validateInstructions"]["instruction"] : null, txRef: data["txRef"], chargeResponseMessage: data["chargeResponseMessage"], authUrl: data["authurl"], appFee: data["appFee"], currency: data["currency"], chargedAmount: data["charged_amount"].toString(), redirectUrl: data["redirectUrl"], rawResponse: json); }

Map<String, dynamic> toJson() => rawResponse;

@override List get props => [ status, message, validateInstructions, validateInstruction, suggestedAuth, chargeResponseCode, authModelUsed, flwRef, chargeResponseMessage, authUrl, appFee, currency, chargedAmount, redirectUrl, hasData, ]; }

wilburx9 commented 3 years ago

I actually asked for the way you're calling this plugin to make the payment.

However, I am currently in a conversation with Flutterwave on this issue and I will revert when I have more information.

mopilo commented 3 years ago

I actually asked for the way you're calling this plugin to make the payment.

However, I am currently in a conversation with Flutterwave on this issue and I will revert when I have more information.

okay, I'm calling it the same way you did from the example project. the only difference is the ..staging which false, and the test keys were changed to live keys

mopilo commented 3 years ago

any update?