Forum

2 questions
This thread is public.
avatar
bizaro


Hello Sorry to bother you again, I have 2 questions:

1. in the API integration example I have a report.php page FOr example if after the payment I want to update the users’s account with some value, I will place that update string there in the report.php page? Or in the pay.php script in the ”// Fourth step: check payment” area ?

2. I registered as a bussiness, do I need to make an invoice before receiving the payment? Or, can you explain me how the payments are done?

Thank you for your time

avatar
bastiaan


Hi Bizaro,

No problem at all.

1. I think you should use our reporting-feature to trigger business-logic, and use the pay.php for presenting the user with an appropriate interface. One can imagine “smart” users will try to mess with the query-string of the page they see in their browser after making or canceling a payment. Nobody knows the url we report to, and you could check it’s us by checking the IP that the request came from, so you can consider using reporting safe for businesslogic and good practice as such.

2. You need to get the minimum amount for payout (€50) of ‘gained’ revenue (meaning the payments are paid, and transfered to our accounts by our suppliers). Then you can withdraw. Zaypay.com makes you a ‘self billing invoice’, and at the same time, wires the money into the specified bank-account. You can configure to withdraw periodically, or wait at least the 2-week cooldown until you withdraw again. Note that whenever you have more than €1000,- gained you can always withdraw.

(By the way, if you don’t answer ’ok’ on our report-requests, we schedule them for 7 repetitions (until one gets satisfied with an ’ok’). This is nice when your DB goes down, and are temporarily unable to respond (and process). So it’s best to return ’ok’ when you correctly process a status-report, to minimize traffic.)

avatar
bizaro


Thank you I don’t really get it with all the reports and stuff with your server, my server, etc. i’m at the begginning with php programming and I don’t really know all the stuff.

Basically I want to do the following thing:

The user pays for some game points in my game, they do the proces like in your pay.php from the example script… and then I want to give them the points after the payment is complete.

My first thought was to implement in the pages/4-paid.php the query to give the point, but I thought that they may try refreshing the page and then they get huderds of points for one pay.

Then I tried to add into a new table in the pay.php this: // mysql_query(“INSERT INTO `payment` (payment_id, status, datetime) VALUES (‘{$ZayPay->getPaymentId()}’, ‘prepared’, NOW”);

but When I get to the payment step (where that string should go) I get a strange error.:

Notice: Undefined variable: ZayPay in /home/sites/easternmob.com/public_html/pay/pay.php on line 51 Fatal error: Call to a member function getPaymentId() on a non-object in /home/sites/easternmob.com/public_html/pay/pay.php on line 51

That variable should be in the class, it is there but still I get this error.

So

How much would it cost me to have a script done to do what I want? Because It seems I don’t manage to do it by myself. Thank you

avatar
bastiaan


Hi Bizaro,

If you don’t know much PHP, how did you build that site? Is it something you downloaded? If it is, we could try to make something generic for it.

Best regards,

Bastiaan

avatar
bizaro


Hello I know the basics but I get confused when I have to deal with relationship between 2 servers and stuff, the script that is now online is based on an old script adapted by me. I’ll try to make the example work

Thank you for your time

avatar
Adriaan
Zaypay


Perfect. Please let us know if you still got any questions.

avatar
bizaro


Hello How can I check if the aplication is working? Do I need to send sms each time I want to check, or there is some testing tool that creates some codes or something. Thank you

avatar
bizaro


I have a problem I integrated your example but when I try to call the function: $ZayPay->getPaymentId() into the pay.php script I get this error:

Notice: Undefined variable: ZayPay in /home/sites/easternmob.com/public_html/pay/pay.php on line 50

Fatal error: Call to a member function getPaymentId() on a non-object in /home/sites/easternmob.com/public_html/pay/pay.php on line 50

on line 50 I have this: mysql_query(“INSERT INTO payment (payment_id, status, datetime) VALUES (‘{$ZayPay->getPaymentId()}’, ‘prepared’, NOW)”);

I created the table and tried to input some stuff without the function and it works, but with the function at the payment_id, I get the error

Thank you

avatar
Adriaan
Zaypay


If you want to test without actually paying every time you can create a payment, then go to Transaction page click the drop down and set to show “All transactions” instead of only “Paid transactions”. Then click the created payment and merge to a test payment. Now you can alter the status of this payment without paying.

This error looks like the variable $ZayPay isn’t defined where you execute this line. Are you sure you have included the Zaypay PHP class and created a new instance of the class?