RocHack / bb

Command line Blackboard client
MIT License
72 stars 8 forks source link

Add command for paying tuition #14

Closed clehner closed 9 years ago

clehner commented 9 years ago

:warning: :money_with_wings:

This adds a pay command for making tuition payments. Currently it works for me with my payment profile that is one word, but doesn't work if the payment profile is more than one word. I am still looking into this. Be careful with testing that you are sure you want to make a payment (or otherwise don't let execution get to quikpay_payment_process_path

I also added an abstract pick_item function for use with picking payment profiles, which could be used to replace parts of get_course and get_assignment as they implement mostly the same logic.

clehner commented 9 years ago

Anyone have comments or want to test this?

jthurst3 commented 9 years ago

Quikpay wasn't working for me with bb bill, but I will test out this new functionality and get back to you hopefully tomorrow.

clehner commented 9 years ago

The quikpay issues (#5) might be fixed in 8cd4abc. Let me know if those work for you.

jeremywrnr commented 9 years ago

payments works perfectly for me, and bill works, but with some parsing errors: image

clehner commented 9 years ago

@jeremywrnr Parsing issue produced. Moving it to #5.

jthurst3 commented 9 years ago

For me, bb pay shows no output if given with no arguments. Also, the call to pick_item fails, so bb pay exits early. I've traced the problem to methods=$(parse_payment_profiles < "$temp") not returning anything.

clehner commented 9 years ago

@jthurst3 does it work for you before 98b88b6e8e6d83910309b0493e09f3be42246ce0? If so, the issue is with the regexes matching carriage returns. Otherwise it is probably with the parsing in parse_payment_profiles, or the request to $quikpay_payment_path.

jthurst3 commented 9 years ago

@clehner: It doesn't work in 28f2fadb0a61c9702de9534c3a8be3734b5b5448 or 98b88b6e8e6d83910309b0493e09f3be42246ce0.

clehner commented 9 years ago

If it's an issue in parse_payment_profiles then it might be that some payment profiles are in a different format. I've changed it to produce output even if a certain replacement doesn't occur. Does that let it produce any output of payment profiles for you?

jthurst3 commented 9 years ago

It does! But it's not very helpful. Here is the output for me:

1)                       <select name="method" class="inputBox" id="paymentMethod"><option value="">Select One...</option><option value="_ECHECK_METHOD">&nbsp;&nbsp;eCheck&nbsp;&nbsp;</option><option value="_CREDIT_CARD_METHOD">&nbsp;&nbsp;Credit Card&nbsp;&nbsp;</option><option value="_WIRE_TRANSFER_METHOD">International Wire</option></select>
2)                       <select name="method" class="inputBox" id="paymentMethod"><option value="_ECHECK_METHOD">&nbsp;&nbsp;eCheck&nbsp;&nbsp;</option><option value="_CREDIT_CARD_METHOD">&nbsp;&nbsp;Credit Card&nbsp;&nbsp;</option><option value="_WIRE_TRANSFER_METHOD">International Wire</option></select>
3)                       <select name="method" class="inputBox" id="paymentMethod"><option value="_CREDIT_CARD_METHOD">&nbsp;&nbsp;Credit Card&nbsp;&nbsp;</option><option value="_WIRE_TRANSFER_METHOD">International Wire</option></select>
4)                       <select name="method" class="inputBox" id="paymentMethod"><option value="_WIRE_TRANSFER_METHOD">International Wire</option></select>
clehner commented 9 years ago

Looks like you don't have any saved payment profiles, from which the script would let you choose. Anyway, it is a bug that it produces the output you got. It should show an error message instead. (And should probably mention this in the readme). Allowing using new payment methods (i.e. interactively enter bank account or credit card info) would be additional functionality (Edit: #16)

jthurst3 commented 9 years ago

Great, looks merge-able to me! Anyone else have any comments? (@jeremywrnr)

jeremywrnr commented 9 years ago

I also don't have any stored payment profiles so I can't test the full functionality, but bb pay recognizes this and gives me a informative error. Looks good!