phpCOIN

Forum Rules Miscellaneous Add-Ons

For questions and issues dealing with miscellaneous add-ons that do not warrant their own forum, including questions about non-existant addons.

Pages: (6) 1 2 [3] 4 5 ... Last » ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> how do I integrate JAM Phpcoin and paypal? Please
nimasdj
Posted: August 06, 2009 01:07 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



QUOTE
To nima:
We are NOT at the order stage.
So in this case (bank payment), we would NOT have ord_xxxxx available.
invoice_id would be available only if it was part of the paylink.
Remember that API is only what is in scope


Now the answer is easy to mike-sol: You cannot use "API Output Enable: Trans Created" for JAM because ord_xxx and invoice_id is not available within this function which are required for JAM code. Move back your JAM code within "API Output Enable: Order Out Proc" function and use this one.


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
nimasdj
Posted: August 06, 2009 01:12 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



QUOTE (mike-sol @ August 06, 2009 11:50 am)
QUOTE
add some text to be returned to the calling function. This will ensure that the API is getting called.
not sure what to do there?

Add this within that function and when you set an invoice as paid (whenever Trans Credted api should be called), you should see some information, copy/paste them here that I look at it.

CODE
print("<pre>");
print_r($_APIO_AData);
print("</pre>");


However with what cantex said, I am almost you sure you cannot use that function for JAM.


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
mike-sol
Posted: August 06, 2009 01:26 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



Well I put that code here:

$_APIO_Ret['dn'] = 1;
$_APIO_Ret['msg'] = 'none';
print("<pre>");
print_r($_APIO_AData);
print("</pre>");

# Return output

and it gave the following:


Array
(
[mod] => orders
[stage] => 4
[cor_flag] => 0
[ord_accept_tos] => 1
[ord_accept_aup] => 1
[b_continue] => Continue
[op] =>
[o] =>
[id] => 0
[cp] =>
[mode] => order
[cl_id] => 1
[ord_cl_id] => 1
[ord_user_name_orig] => 111111
[numrows] => 1
[os_s_id] => 6f9bbb4351106d4a5ccbfb49bb617098
[os_s_time_init] => 1249553994
[os_s_time_last] => 1249554032
[os_s_ip] => 85.243.127.151
[ord_processed] => 0
[ord_ret_processed] => 0
[ord_id] => 97
[ord_ts] =>
[ord_ip] => 85.243.127.151
[ord_status] =>
[ord_company] => Top secret
[ord_name_first] => micky
[ord_name_last] => mouse
[ord_addr_01] => disney land
[ord_addr_02] => Top secret
[ord_city] => Top secret
[ord_state_prov] => Top secret
[ord_country] => Top secret
[ord_zip_code] => Top secret
[ord_phone] => Top secret
[ord_email] => Top secret
[ord_domain] =>
[ord_domain_action] => 0
[ord_user_name] => Top secret
[ord_user_pword] => Top secret
[ord_vendor_id] => 3
[ord_prod_id] => 1
[ord_unit_cost] => 10
[ord_referred_by] =>
[ord_comments] =>
[ord_optfld_01] =>
[ord_optfld_02] =>
[ord_optfld_03] =>
[ord_optfld_04] =>
[ord_optfld_05] =>
[ord_cbflag] => 0
[ord_cbpaid] => 0
[cor_type] =>
[cor_opt_bill_cycle] =>
[cor_opt_payment] =>
[cor_disk] => 0
[cor_disk_units] => Mb
[cor_traffic] => 0
[cor_traffic_units] => Gb
[cor_dbs] => 0
[cor_mailboxes] => 0
[cor_unique_ip] => 0
[cor_shop_cart] => 0
[cor_sec_cert] => 0
[cor_site_pages] => 0
[cor_comments] =>
[cor_optfld_01] =>
[cor_optfld_02] =>
[cor_optfld_03] =>
[cor_optfld_04] =>
[cor_optfld_05] =>
[prod_id] => 1
[prod_name] => ID-0001
[prod_desc] => Top secret
[prod_unit_cost] => 10
[prod_cost] => 10
[prod_apply_tax_01] => 1
[prod_apply_tax_02] => 0
[prod_calc_tax_02_pb] => 0
[prod_dom_type] => 1
[prod_allow_domains] => 0
[prod_allow_subdomains] => 0
[prod_allow_disk_space_mb] => 0
[prod_allow_traffic_mb] => 0
[prod_allow_mailboxes] => 0
[prod_allow_databases] => 0
[invc_id] => 98
)
PMEmail Poster
Top
mike-sol
Posted: August 06, 2009 03:00 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



I posted the info you asked for but it has not yet passed the board moderator.

Since then I realized that I did not complete the payment from within admin so here it is:

Array
(
[mod] => invoices
[mode] => add
[obj] => trans
[it_ts_year] => 2009
[it_ts_month] => 08
[it_ts_day] => 06
[it_type] => 2
[it_origin] => 1
[it_desc] =>
[it_amount] => 12.00
[it_set_paid] => 1
[stage] => 2
[it_id] => 177
[it_invc_id] => 98
[b_edit] => Add
[op] =>
[o] =>
[id] => 0
[cp] =>
[invc_ts] =>
[invc_ts_due] =>
[invc_ts_paid] =>
[it_ts] => 1249534800
)

Hope this help to see if this is possible

Thanks

Mike
PMEmail Poster
Top
nimasdj
Posted: August 06, 2009 03:21 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



Assuming [it_amount] shows the invoice amount and [it_set_paid] = 1 shows the invoices status as paid and [it_invc_id] shows the invoice id number. Then you could use below within Trans Created function. order id cannot be used in JAM transaction id any more.

CODE
if ($_APIO_AData['it_set_paid']== '1') {
                  $JAMIntegrate = file_get_contents("http://www.mydomain.com/affiliates/sale.php?amount=".$_APIO_AData['it_amount']."&trans_id=".$_APIO_AData['it_invc_id']."&custom_mid=".$_COOKIE['jrox']."");
}


Cantex, please correct me if I am wrong about [it_amount] and [it_set_paid] and [it_invc_id] above? and what does [it_id] refer too?


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
nimasdj
Posted: August 06, 2009 04:11 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



sorry, you posted two arrays. which one is from Trans Created?


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
mike-sol
Posted: August 06, 2009 04:20 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



Thank for the reply.

Ok

[it_amount]=12 yes this is the invoice amount

[it_set_paid] =1 I assume this means paid, I don't know for sure.

[it_invc_id]=101 yes this is the invoice number

This is my api.php

CODE
// Added by nimasdj for JAM integration
               // Do edit http://www.yourdomain.com/affiliates below to your JAM installation URL
               // This php block works for both Wire Transfer and cheque payment options on return page.
               // Consult manual at http://docs.phpcoin.com/index.php/JAM_Affiliate_Tracking for more details.
               if ($_APIO_AData['it_set_paid']== '1') {
                 $JAMIntegrate = file_get_contents("http://www.removed.com/affiliates/sale.php?amount=".$_APIO_AData['it_amount']."&trans_id=".$_APIO_AData['it_invc_id']."&custom_mid=".$_COOKIE['jrox']."");
}
               // End of JAM integration

 $_APIO_Ret['dn'] = 1;
 $_APIO_Ret['msg'] = 'none';
 print("<pre>");
 print_r($_APIO_AData);
 print("</pre>");


# Return output
 return $_APIO_Ret;
}



And these are the results - NO commission in jam.




[/CODE]Array
(
[mod] => orders
[stage] => 4
[cor_flag] => 0
[ord_accept_tos] => 1
[ord_accept_aup] => 1
[b_continue] => Continue
[op] =>
[o] =>
[id] => 0
[cp] =>
[mode] => order
[cl_id] => 1
[ord_cl_id] => 1
[ord_user_name_orig] => 111111
[numrows] => 1
[os_s_id] => ad890f329b847e100ee0cc818843c5bb
[os_s_time_init] => 1249564168
[os_s_time_last] => 1249564220
[os_s_ip] => 85.243.127.151
[ord_processed] => 0
[ord_ret_processed] => 0
[ord_id] => 100
[ord_ts] =>
[ord_ip] => 85.243.127.151
[ord_status] =>
[ord_company] => removed
[ord_name_first] => removed
[ord_name_last] => removed
[ord_addr_01] => removed
[ord_addr_02] => removed
[ord_city] => removed
[ord_state_prov] => removed
[ord_country] => removed
[ord_zip_code] => removed
[ord_phone] => removed
[ord_email] => removed
[ord_domain] =>
[ord_domain_action] => 0
[ord_user_name] => removed
[ord_user_pword] => removed
[ord_vendor_id] => 3
[ord_prod_id] => 1
[ord_unit_cost] => 10
[ord_referred_by] =>
[ord_comments] =>
[ord_optfld_01] =>
[ord_optfld_02] =>
[ord_optfld_03] =>
[ord_optfld_04] =>
[ord_optfld_05] =>
[ord_cbflag] => 0
[ord_cbpaid] => 0
[cor_type] =>
[cor_opt_bill_cycle] =>
[cor_opt_payment] =>
[cor_disk] => 0
[cor_disk_units] => Mb
[cor_traffic] => 0
[cor_traffic_units] => Gb
[cor_dbs] => 0
[cor_mailboxes] => 0
[cor_unique_ip] => 0
[cor_shop_cart] => 0
[cor_sec_cert] => 0
[cor_site_pages] => 0
[cor_comments] =>
[cor_optfld_01] =>
[cor_optfld_02] =>
[cor_optfld_03] =>
[cor_optfld_04] =>
[cor_optfld_05] =>
[prod_id] => 1
[prod_name] => ID-0001
[prod_desc] => removed
[prod_unit_cost] => 10
[prod_cost] => 10
[prod_apply_tax_01] => 1
[prod_apply_tax_02] => 0
[prod_calc_tax_02_pb] => 0
[prod_dom_type] => 1
[prod_allow_domains] => 0
[prod_allow_subdomains] => 0
[prod_allow_disk_space_mb] => 0
[prod_allow_traffic_mb] => 0
[prod_allow_mailboxes] => 0
[prod_allow_databases] => 0
[invc_id] => 101
)



After admin made the payment which also sets the invoice as paid and zeros the account.


Array
(
[mod] => invoices
[mode] => add
[obj] => trans
[it_ts_year] => 2009
[it_ts_month] => 08
[it_ts_day] => 06
[it_type] => 2
[it_origin] => 1
[it_desc] =>
[it_amount] => 12.00
[it_set_paid] => 1
[it_email_ack] => 1
[stage] => 2
[it_id] => 183
[it_invc_id] => 101
[b_edit] => Add
[op] =>
[o] =>
[id] => 0
[cp] =>
[invc_ts] =>
[invc_ts_due] =>
[invc_ts_paid] =>
[it_ts] => 1249534800
)[CODE]

No commission in JAM :-(


??

Thanks
PMEmail Poster
Top
cantex
Posted: August 06, 2009 04:21 pm
Quote Post


Chief Cook & Bottle Washer
***

Group: Archive
Posts: 3,252
Member No.: 1
Joined: August 25, 2006



it_xxxxx means InvoiceTransaction_xxxxxx

SO.....

it_id -> IT record ID

it_amount -> IT amount (invoice amount/payment amount/etc.)

it_invc_id -> record ID of invoice that this transaction applies to, whether transaction is an invoice or a payment.

it_set_paid -> this is NOT a database field. It is flag that is ONLY set IF you click the "Set invoice to paid" checkbox when manually adding/editing a payment.

Checking [it_set_paid] to see if the "SET AS PAID" flag was set is not a good idea.
What if admin did not click the checkbox?
What if it is a partial payment?
Instead, check [it_type] which will be:
0 -> This transaction is a new/edited Invoice
1 -> This transaction is a new/edited Credit Memo or other bill reduction
2 -> This transaction is an actual payment via cash/paypal/etc.

So, if [it_type] == 2 then give a commission based on the payment amount [it_amount] applied to the invoice [it_invc_id]


--------------------
================================================================
Please do not email or PM me with a question:
1: I handle over a thousand emails a day, so chances are yours would be buried in the pile.
2: All questions will only be answered in the support forums, so the answers will be useful to others.

Help will be given to install/configure/use phpCOIN, but not programming help to modify phpCOIN operations. If you are competent enough to make programming changes, you should be competent enough to read the source code and figure things out :)

If you are trying to integrate posted sample code into your website, please take into account any changes in phpCOIN made after the code sample was posted. It is discouraging to spend hours answering questions or trying to track down an issue only to find that the user has a version of phpCOIN that makes the sample irrelevant
PM
Top
mike-sol
Posted: August 06, 2009 04:22 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



i just posted another attempt but noshowing yet! Moderator??
PMEmail Poster
Top
lightman
Posted: August 06, 2009 05:06 pm
Quote Post


The Janitor
***

Group: Admin
Posts: 3,639
Member No.: 3
Joined: August 25, 2006



Sorry, but I do have other work to do other than just monitoring this forum 24/7 mad.gif


--------------------
***** Unless otherwise stated, all replies refer to the following *****
====================================================================
--- The latest unmodified version of phpCOIN available from the phpCOIN download page on the date and time of this post.
--- All relevant HotFix files applied - One of the four included unmodified themes - The original language files .
--- Help will be given to install/configure/use phpCOIN, but not programming help to modify phpCOIN operations. If you are competent enough to make programming changes, you should be competent enough to read the source code and figure things out :)
PM
Top
nimasdj
Posted: August 06, 2009 05:51 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



@mike-sol

I'd prefer to use "Order Ret Proc" as no invoice id nor order id is available in "Trans Created" api function.

If you still insist to use "Trans Created" then replace


CODE
if ($_APIO_AData['it_set_paid']== '1') {


with:

CODE
if ($_APIO_AData['it_type'] == '2') {


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
nimasdj
Posted: August 06, 2009 05:59 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



sorry I meant to say as no order id is available to set as jam transaction id as you desired. if you go use invoice id as jam transaction id, then you'd be fine with the change I said in previous post.


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
mike-sol
Posted: August 06, 2009 06:09 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



I have totally lost the plot now and getting really tired.

This is what I have in my api.php

if ($_APIO_AData['it_type'] == '2') {
$JAMIntegrate = file_get_contents("http://www.removed.com/affiliates/sale.php?amount=".$_APIO_AData['it_amount']."&trans_id=".$_APIO_AData['it_invc_id']."&custom_mid=".$_COOKIE['jrox']."");
}

It did not work I tried as soon as cantex posted.

Maybe there is something wrong in that code?

Would appreciate it if you could correct it.

Thanks

Mike
PMEmail Poster
Top
nimasdj
Posted: August 07, 2009 02:33 am
Quote Post


Advanced Member
***

Group: Members
Posts: 510
Member No.: 6
Joined: August 26, 2006



It is correct if this is in "Trans Created" function and it is not working on payment time, then may be your cookie is expired or deleted, make sure you have a new and unique cookie for a new test order. If it is still not working, then it seems Trans Created is not working for JAM and you should use Order Ret Proc function.


--------------------
:: My Contributions to phpCOIN:
:: Geographic whois
:: JAM Integration

If you need help/assistance for phpCOIN and/or addon modules installation. Please read here.

Affiliate marketing is the best way to attract clients for your hosting. Why not starting an Affiliate Program with your phpCOIN? please read here.
PMEmail Poster
Top
mike-sol
Posted: August 07, 2009 04:52 am
Quote Post


Advanced Member
***

Group: Members
Posts: 126
Member No.: 3,910
Joined: July 22, 2009



Well it would have been cool to have had the commissions go through on admin payment bank transfer but it just is not happening so yes back to the paylink confirm button.

If you figure it out for JAM please let me know on here.

Thanks for your help.

Mike
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic OptionsPages: (6) 1 2 [3] 4 5 ... Last » Reply to this topicStart new topicStart Poll

 


Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: support@phpcoin.com