Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

First Attempt to implement Payment SDK for WebWorks. #455

Closed

Conversation

shamim1
Copy link

@shamim1 shamim1 commented Dec 10, 2012

Implemented API method for "Purchase" method in Payment Service.

(First Push attempt didn't have any changes as I forgot to check-in code before pushing to github.)

@nukulb
Copy link
Contributor

nukulb commented Dec 10, 2012

@rwmtse @Pagey - can we review this please?

@nukulb
Copy link
Contributor

nukulb commented Dec 10, 2012

there is an .so file in there too, please remove that. Thats a build time artifact and doesn't need to be a part of the repo

@ericpearson
Copy link
Contributor

we don't use cmake anymore, this need to be converted to use the qnx make system

@shamim1
Copy link
Author

shamim1 commented Dec 10, 2012

ok


paymentJNext.stopEvents();

//if (result === SUCCESS) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove commented code that is not used

@ericpearson
Copy link
Contributor

please use jake lint to fix your lint errors

if (extra_parameter_count)
{
//int i;
for (int i = 0; i > extra_parameter_count; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this loop is correct? What are the possible values of extra_parameter_count? I think it will be > 0 right? If so the loop will never be entered.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya... I see that. sorry. Will fix it.

@shamim1
Copy link
Author

shamim1 commented Dec 10, 2012

RE "please use jake lint to fix your lint errors"

I didn't understand what exactly I need to do to address that. Sorry.

@ericpearson
Copy link
Contributor

run jake lint in your framework folder to see the lint problems with your code, it will display which files and lines need to be fixed, this branch will not build on our CI server until the lint problems are fixed

@shamim1
Copy link
Author

shamim1 commented Dec 10, 2012

I found few code areas to fix....
I will submit a code review early tomorrow morning.

Thanks

@shamim1
Copy link
Author

shamim1 commented Dec 11, 2012

I made bunch of changes. But, I am having hard time to amend the commit on "'next-payment-sdk'" branch. Looks like that the "amend" worked fine locally. But, I can't seem to push the changes.

@nukulb
Copy link
Contributor

nukulb commented Dec 11, 2012

need to force push because you changed the history
but make sure you only push to your branch

so use

git push -f origin next-payment-sdk

@shamim1
Copy link
Author

shamim1 commented Dec 11, 2012

Ok, thanks. Not sure how I changed the history, I may have done it accidentally. I am still learning Git.

I made bunch of changes in the "amended version". I am still working on "make".

@nukulb
Copy link
Contributor

nukulb commented Dec 11, 2012

you change the history every time you do git commit --amend as you are changing an already pushed commit.

@shamim1
Copy link
Author

shamim1 commented Dec 11, 2012

ok, thanks.

@shamim1
Copy link
Author

shamim1 commented Dec 11, 2012

Seems like nobody is reviewing latest code. Do I need to do anything else or do I just need to wait?

Also, I am working on "make" and fixing few things found by "make".

@ericpearson
Copy link
Contributor

this code still doesn't pass lint

@shamim1
Copy link
Author

shamim1 commented Dec 11, 2012

well I don't see any payment problem. I haven't touched any other folder except "payment". The only thing I find is -

ext\Payment\index.js :
Unused Variables:
_methods(17), _exports(19), info(95)

But that doesn't show up in the "error" section.

@ericpearson
Copy link
Contributor

it's not passing cpplint, are you running this on windows?

@ericpearson
Copy link
Contributor

also missing unit tests

@shamim1
Copy link
Author

shamim1 commented Dec 11, 2012

yes... The only thing I can say is that "Payment" folder has upper case "P". It may need to be renamed as "payment" with lower case "p". Other than that I don't know.


purchase_arguments_t* args = NULL;
std::stringstream ss;
try{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the c++ exceptions, we do not use c++ exceptions

@rwmtse
Copy link
Contributor

rwmtse commented Jan 24, 2013

@Pagey @jeffheifetz I've removed all event trigger code. And here's the docs pull request: blackberry/WebWorks-API-Docs#447

@rwmtse
Copy link
Contributor

rwmtse commented Jan 25, 2013

@Pagey @jeffheifetz Please resume review. @nukulb is hoping to fold ASAP
@tracyli Can you please grab this CI build and test? You can find a test app in test-suite/Apps/Payment
http://wwci:8080/view/BB10-WebWorks-Framework/view/Jobs/job/BB10-WebWorks-Framework-next-payment-sdk/27/

@shamim1
Copy link
Author

shamim1 commented Jan 25, 2013

Our SV&V testing team uncovered a possible issue around purchase (while working on the extended test app) . We are going to investigate it today and find a solution. I grabbed the latest code from github. If any change are made, it will be around input validation.

return 1;
}

int PaymentBPS::onCancelSubscriptionSuccess(bps_event_t *event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ on next line

@ericpearson
Copy link
Contributor

everything looks good after comments

@rwmtse
Copy link
Contributor

rwmtse commented Jan 25, 2013

@shamim1 Please keep us posted regarding the issues found by your SV&V. This change needs to go in soon.

@shamim1
Copy link
Author

shamim1 commented Jan 25, 2013

While running jake unfortunately I still get the error. I got proper NDK and ran “C:\bbndk\bbndk-env_10_0_9_2270.bat” to make sure the proper NDK is used.

But, I just wonder where is “existsSync” method. It is called in bundler.js:93:17. It could be npm error. I may have to reinstall “fs” module (I guess). Here is the error –

TypeError: Object # has no method 'existsSync'
at Object.bundle (C:\GitRepo\blackberry-webworks\BB10-WebWorks-Framework\build\build\bundler.js:93:17)
at C:\GitRepo\blackberry-webworks\BB10-WebWorks-Framework\build\build\pack.js:94:26
at Object.pass (C:\GitRepo\blackberry-webworks\BB10-WebWorks-Framework\node_modules\jWorkflow\lib\jWorkflow.js:41:52)
at C:\GitRepo\blackberry-webworks\BB10-WebWorks-Framework\build\build\build-native.js:39:23
at Object.pass (C:\GitRepo\blackberry-webworks\BB10-WebWorks-Framework\node_modules\jWorkflow\lib\jWorkflow.js:41:52)
at C:\GitRepo\blackberry-webworks\BB10-WebWorks-Framework\build\build\utils.js:101:27
at ChildProcess.exithandler (child_process.js:281:7)
at ChildProcess.emit (events.js:70:17)
at maybeExit (child_process.js:361:16)
at Process.onexit (child_process.js:397:5)

@rwmtse
Copy link
Contributor

rwmtse commented Jan 25, 2013

I suspect this might actually have to do with node. Which version of node are you running?

@shamim1
Copy link
Author

shamim1 commented Jan 25, 2013

6.10

@shamim1
Copy link
Author

shamim1 commented Jan 25, 2013

v0.6.10

@rwmtse
Copy link
Contributor

rwmtse commented Jan 25, 2013

@shamim1 I think we have upgraded to the 0.8.14, please upgrade to latest node

@shamim1
Copy link
Author

shamim1 commented Jan 25, 2013

O, ok.

@shamim1
Copy link
Author

shamim1 commented Jan 25, 2013

I am in the process of uninstalling the old node.js and installing the new one. I am following the post below (for my windows XP OS)

http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x

Unfortunately I have only 1 hour today. But, I will make sure that on Monday this is my first priority and will make sure that the specific defect is fixed before I go home on Monday. Hopefully that won't be too late for you.

@tracyli
Copy link

tracyli commented Jan 28, 2013

tested in 10.0.10.225 with packager build http://wwci:8080/view/BB10-WebWorks-Packager/view/Jobs/job/BB10-Webworks-Packager-next/26/ and framework build http://wwci:8080/view/BB10-WebWorks-Framework/view/Jobs/job/BB10-WebWorks-Framework-next-payment-sdk/28/:

  1. automated functional test got passed except for one known issue of pim.calendar
    2.test app as suggested worked well
    some questions:
    1.there's no test suite for blackberry.payment in automatic test
    2.all error seems returning the same error id: eg, 'User Cancelled' or "Payment System Busy" both returns 0
    3.is it better for us to get special BBID and an account in Vendor Portal to do payment transaction with the server?

@rwmtse
Copy link
Contributor

rwmtse commented Jan 28, 2013

@tracyli There is no automated test because purchase would show a dialog, can't automate it w/o automation. As for the error value, @shamim1 can you confirm if the error id will always be 0 when we use developmentMode, the docs says so for one of the functions, if that's the case I'd add the note to all functions. Also, @shamim1 please update us about the findings from your team's SV&V ASAP.

@scdowney
Copy link

There was an issue in previous bps libraries where error id was always 0 on development mode, but this should have been fixed a while back. Ash can investigate to see if this is still happening for some reason, or if there is just an issue in the webworks implementation.

@shamim1
Copy link
Author

shamim1 commented Jan 28, 2013

I fixed the problem that we found on Friday. It was a easy fix. :)

@scdowney
Copy link

On further inspection, this is a known issue on release9 builds. The fix was only targeted for 10.1+.

As for the BBID question, we have a test environment which the devices can be configured to use, with test payment instruments etc, to facilitate this. See our wiki page (http://wikis.rim.net/display/bbaw/BB10+Payment+Service+Configuration+Guide)

Ultimately, our "proper" test app will be made available on eval and production servers, to allow the "full" testing of an app downloaded from AW, being used for WW purchases. This app is being completed by our SVV devs as we speak, as I understand.

@shamim1
Copy link
Author

shamim1 commented Jan 28, 2013

The time taken was to setup the environment and testing with few different variance.

@rwmtse
Copy link
Contributor

rwmtse commented Jan 28, 2013

@scdowney so can you confirm if this note in getExistingPurchases error callback param: "Note: The actual values may be different when developmentMode equals true. should be added to all functions? since the fix isn't in R9 builds yet?

@scdowney
Copy link

The fix only applies to purchases in development mode, actually. That is the only place where a "Simulated" error can be produced. All of the other calls just provide a "Canned" successful response in development mode. The only place I can think of another error happening in development mode, off the top of my head, would be the new -1 error we introduced for unknown app errors.  Sent from my BlackBerry 10 smartphone. From: Rosa TseSent: Monday, January 28, 2013 1:28 PMTo: blackberry/BB10-WebWorks-FrameworkReply To: blackberry/BB10-WebWorks-FrameworkCc: Shawn DowneySubject: Re: [BB10-WebWorks-Framework] First Attempt to implement Payment SDK for WebWorks. (#455)@scdowney so can you confirm if this note in getExistingPurchases error callback param: "Note: The actual values may be different when developmentMode equals true. should be added to all functions? since the fix isn't in R9 builds yet?

          —
          Reply to this email directly or view it on GitHub.

@rwmtse
Copy link
Contributor

rwmtse commented Jan 28, 2013

I've fixed the docs to move the note from getExistingPurchases to purchase. As far as I understand, this is now good to go? Anyone who has concern please voice out ASAP.

@scdowney
Copy link

@rwmtse has that change been pushed somewhere? I can't seem to find it...

I'd like to just take a scan over the "final" docs, since it sounds like this is wrapping up

@rwmtse
Copy link
Contributor

rwmtse commented Jan 28, 2013

@scdowney you can find the latest built docs here
The github pull request for the docs is here: blackberry/WebWorks-API-Docs#447

Reviewed by: Eric Pearson <epearson@rim.com>, Jeffrey Heifetz <jheifetz@rim.com>
Tested by: Tracy Li <tli@rim.com>
@jeffheifetz
Copy link
Contributor

Merged Manually

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

Successfully merging this pull request may close these issues.

None yet

7 participants