Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠️ The plugin will be discontinued soon ⚠️ #50

Open
pr-Mais opened this issue Jan 5, 2023 · 15 comments
Open

⚠️ The plugin will be discontinued soon ⚠️ #50

pr-Mais opened this issue Jan 5, 2023 · 15 comments

Comments

@pr-Mais
Copy link
Collaborator

pr-Mais commented Jan 5, 2023

I’m taking a hard decision to discontinue this plugin, unfortunately. 😞

Many reasons include that I built it originally cause I was working on an app that uses HyperPay for payments, but since 2021 I’m no longer working on it. So I don’t have access anymore to any useful resources to fully test and troubleshoot the native SDK/API issues.

Currently, if the plugin is working for you then it will probably stay this way for a period of time, but make sure to find a solution before a breaking change in the gateway happens.

I’m sorry in advance for anyone who is using it in production, I'm proposing that you fork the project, it will stay public, make edits internally and keep using it.

Thanks to everyone who contributed to building this project, I had fun and learned a lot.

@pr-Mais pr-Mais changed the title The plugin will be discontinued soon ⚠️ The plugin will be discontinued soon ⚠️ Jan 5, 2023
@pr-Mais pr-Mais pinned this issue Jan 5, 2023
@shadyaziza
Copy link

Sorry to hear that and thanks for your effort. We are in a similar situation now where we need to integrate payment through hyperpay. We currently rely on webview implementation of COPYandPAY, this has its own drawbacks of course. So I wanted to ask you if you can clarify how did you manage to integrate the mobile sdk. I am specifically asking about this part of the documentation

For iOS

Install the SDK
Drag and drop OPPWAMobile.xcframework & ipworks3ds_sdk.xcframework to the "Frameworks" folder of your project.
Make sure "Copy items if needed" is checked.

For Android

Install the SDK
Add the Mobile SDK for Android.
Drag and drop oppwa.mobile.aar & ipworks3ds_sdk.aar (use ipworks3ds_sdk_deploy.aar for production) to the "libs" folder >of the module where you plan to integrate Mobile SDK. In the build.gradle file of this module add:
implementation fileTree(dir: "libs", include: ["*.aar"])

How one can actually have access to these resources ?

@pr-Mais
Copy link
Collaborator Author

pr-Mais commented Jan 6, 2023

I was in your situation and the WebView in a mobile app seemed so wrong to me, which was the motivation behind creating this plugin. I genuinely wish to get co-maintainers who can keep this project going, I would be happy to resume supporting it.

It's implemented, both SDKs are bundled with the plugin and you don't need to do any of these steps, check the Getting Started guide here.

The last update was regarding 3DS (check the merged PR here), and it's supposedly working on the client side as I tested the last time, but in my case, the backend always rejected the payment, I'm not fully sure whether it's a backend issue or some bug in the SDK. I tried contacting HypertPay and we haven't gotten to any solution.

As of the time of writing this comment, the plugin is up to date with the latest mobile SDK from HyperPay.

@shadyaziza
Copy link

I was not asking about the Flutter package itself, rather I was asking about where did you manage to pull the SDK from? if I were to try to develop my own dart wrapper around the native implementation. I understand that this is already what the package is doing but unfortunately I have not been able to get it to work refer to this. So I decided to look deeper into the native implementation since our current webview implementation is delivering poor UX and it became more apparent that we should swap the implementation as soon as possible.

It is interesting what you said about the situation where the payment gets executed from the client but for some reason it fails, we actually ran in a similar situation when we tried to serve a custom payment template (not using the script directly) and the payment would fail without any kind of useful feedback.

As I am now in a situation similar to yours in the past. I have the motivation to investigate this further, in fact I have to get to the bottom of this but I am faced with this blackbox where the doc says I have to add the SDK while not pointing out where exactly are they.

I think it is beneficial for everyone if this project is maintained, and I may be able to contribute to it once the ambiguity I see around SDK integration is cleared up. On a side note though, I may have to promote another payment solution to the stakeholders if I find troubleshooting HyperPay api is consuming more time than I would like to give.

@pr-Mais
Copy link
Collaborator Author

pr-Mais commented Jan 7, 2023

Correct me if I'm wrong please, you're looking into how the SDK communicates with Flutter?

I can provide as many details about the internals as I can in this issue, in case anyone else wants to carry on maintenance.

TL;DR

The native SDK is provided by HyperPay, I was working on a project where the technical support sends us the SDK via email (which I no longer work on hence I don't have any updates from them). Unfortunately, you cannot find it online or via MVN/Pod.

Currently, the plugin has 2 sides, Android and iOS.

  1. iOS: I pushed the iOS SDK into another repo, it's a separate one from the plugin, and you need to depend on it in your project's podfile so the plugin can see it. I couldn't bundle it with the plugin to prevent the extra step because the SDK size is larger than the pub.dev upload limit. Find the native iOS SDK here, which the current published version of the plugin depends on.
  2. Android: it's bundled with the Flutter plugin, though you need a similar step as in iOS to get your app to see it. Find it here.

In short, if you want the newest version of the native SDK, contact HyperPay's support.

On a side note though, I may have to promote another payment solution to the stakeholders if I find troubleshooting HyperPay api is consuming more time than I would like to give.

I agree with this. If you're not familiar with the integration of native APIs with Flutter, or with native Android/iOS, it's quite a learning curve, but IMHO is necessary for every Flutter developer to learn. I do encourage you though to check this article (part 1, part 2), it could be useful to understand how this plugin was built.

But, AFAIK no other payment solution in MENA supports Flutter, probably there's one I'm not aware of, so keep this point in your mind when you look into other solutions. The point is, you would have to build your own plugin for any other gateway if they don't provide it.

If you choose to give a try to this existing plugin, which is already built and integrated, it might be much easier. I discontinued the project cause none of its consumers were interested in co-maintaining it, nevertheless, if you are, I can help answer all your questions.

@shadyaziza
Copy link

Thank you for the detailed explanation and the resources. Yes I was confused about how to get access to the SDK specially when I compared HyperPay docs with other services like Moyasar PayTabs.

I understand that creating your own plugin for any payment services in MENA is inevitable. My comment about moving away from HyperPay was rather about my personal experience with their documentation so far, it is really discouraging specially when comparing other solutions I have linked above. Nevertheless, I will be looking into it more before deciding to move to another solution and your comment is a great starting point to help me indulge in this. Thanks for the info.

@shadyaziza
Copy link

I have a question, we already have separate endpoints for getting the checkout id and the status of the payment. So I am confused about the necessity of having this config

class TestConfig implements HyperpayConfig {
  @override
  String? creditcardEntityID = '';
  @override
  String? madaEntityID = '';
  @override
  String? applePayEntityID = '';
  @override
  Uri checkoutEndpoint = _checkoutEndpoint;
  @override
  Uri statusEndpoint = _statusEndpoint;
  @override
  PaymentMode paymentMode = PaymentMode.test;
}

I only want to use the mobile SDK to be able to build Flutter UI, and submit the payment with my checkout id. Basically, the payment workflow would look like something like this:

  1. Make a basic rest request to our backend to get the checkout id
  2. When the request succeed, we navigate to payment form built with Flutter
  3. Submitting the payment only uses the SDK to pay using our checkout id
  4. Followed by that a basic rest request to our backend to know about the status of the payment

In this way, we do not need any kind of configuration done from the mobile. The mobile only submits the payment to HyperPay api and that is it. Can this be achieved in any way ?

@pr-Mais
Copy link
Collaborator Author

pr-Mais commented Jan 11, 2023

The status endpoint is unnecessary, but the checkout endpoint is necessary because each payment to be submitted needs a checkoutId in the mobile SDK, there's no way to initialize a payment session for the user without first creating a checkoutId.

I forgot to mark the statusEndpoint as optional when I removed the check for status from the plugin.

@pr-Mais
Copy link
Collaborator Author

pr-Mais commented Jan 11, 2023

These steps are totally achievable with the plugin and this is how I used it, the only problem is that you have to make a dummy Uri for the statusEndpoint cause it's required. Unless you fork or submit a PR to fix this.

For the step number 4, there is a function which uses the statusEndpoint to check for the status, paymentStatus and this is why you provide it in the config object.

@shadyaziza
Copy link

shadyaziza commented Jan 11, 2023

The status endpoint is unnecessary, but the checkout endpoint is necessary because each payment to be submitted needs a checkoutId in the mobile SDK, there's no way to initialize a payment session for the user without first creating a checkoutId.

I forgot to mark the statusEndpoint as optional when I removed the check for status from the plugin.

From my understanding the checkout endpoint is needed to obtain a checkout id. We already have this implemented using the web implementation. After hitting our checkout endpoint we get the checkout id, what is confusing to me is why do we need to provide our endpoint to HyperpayConfig. I already have access to my checkout id and I can pass it to the SDK payment step (with credit card, card holder, cvv, expiration date), our mobile application does not have access to configuration details such as entity ids. It only can request a checkout id from the backend and then trigger a payment using this id without any further configuration.

@pr-Mais
Copy link
Collaborator Author

pr-Mais commented Jan 11, 2023

I see your point, you're right, entities shouldn't be included in the client. I remember trying to fix it but it was going to be a big breaking change for all users so I postponed.
Unfortunately, this is how I designed it initially, it can be avoided from the Dart side (no need to play with the native part) so you could fix it, if you make a PR I will review it.

@azharkhan1
Copy link

Hello, we are updating our sdk to support threeDS payments with updated SDK of hyperpay. I am having issue regarding the redirect in asynchronous payments, in previous SDKs I used to submit transaction and I used to receive redirectURL from which I could do the payment in webview and return back to my application.

But with new updated SDK, when I submit the transaction onThreeDSChallengeRequired this function gets triggered first and I know we can open view controller within its completion block. But still we liked the way it was working with redirectURL instead of opening payment form in modal. So is there anyway to do it the old fashioned way with redirectURL?

Also even with Modal its not working as its supposed to be.

Thanks in advance

@pr-Mais
Copy link
Collaborator Author

pr-Mais commented May 19, 2023

Dear @azharkhan1, as the title of this issue suggests, I've discontinued work on this plugin.

If you have any solutions you would like to merge, open a PR and would be happy to review.

@azharkhan1
Copy link

Dear @pr-Mais , I know that the work is discontinued. I only wanted to know if you know something about the issue that I am having as I can see this package was updated to latest SDK. Please let me know if you could provide me info about my following issue. If i am able to come up with my solution sure I will be more than happy to create PR for it :)

@obayit
Copy link

obayit commented Aug 27, 2023

Thank you gal, I was able to get my react-native ios module working thanks to the code in this repo.
Update: dude to gal :)

@pr-Mais
Copy link
Collaborator Author

pr-Mais commented Aug 27, 2023

@obayit happy to hear that! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants