Announcement

Collapse
No announcement yet.

DRM Serveur inscription from ActinicV8 digital download shop

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    DRM Serveur inscription from ActinicV8 digital download shop

    For my new digital download shop, i need to register the purchaser on my DRM server for all products he has purchased on actinic.

    So if i have an order like this :
    adresse email : demo@demo.com
    products rreferencses: 12345, 67777 and 88899

    i need to execute 3 times (one per product ref) a php script like this :
    http://serveur.com/drm2/regusr?pb=pu...password1&uid=
    demo@demo.com&gid=12345&anum=2
    http://serveur.com/drm2/regusr?pb=pu...password1&uid=
    demo@demo.com&gid=67777&anum=2
    http://serveur.com/drm2/regusr?pb=pu...password1&uid=
    demo@demo.com&gid=88899&anum=2

    That simple !!!! but i'm not a perl programmer and cant do that alone.

    Who can help me ?

    Thanks, regards

    #2
    I don't know how you would do that online because you would need to work in the final checkout page and I don't think that product references are available there as UDPs, you could however work on the order once downloaded, you could write a program to process the orders and call the regsrv program from the PC.

    I expect someone better at websites will be along in a minute though with a online solution.

    Regards,
    Jan Strassen, Mole End Software - Plugins and Reports for Actinic V4 to V11, Sellerdeck V11 to V2018, Sellerdeck Cloud
    Visit our facebook page for the latest news and special offers from Mole End

    Top Quality Integrated label paper for Actinic and Sellerdeck
    A4 Paper with one or two peel off labels, free reports available for our customers
    Product Mash for Sellerdeck
    Link to Google Shopping and other channels, increase sales traffic, prices from £29.95
    Multichannel order processing
    Process Actinic, Sellerdeck, Amazon, Ebay, Playtrade orders with a single program, low cost lite version now available from £19.95

    Comment


      #3
      I'm afraid you need some script customisation for this. Just open Orderscript.pl in a plain text editor and locate
      Code:
      sub DisplayReceiptPhase
      Within this function you will find the following bit
      Code:
      	@Response = ACTINIC::GetDigitalContent($pCartList);
      	if ($Response[0] == $::FAILURE)
      		{
      		return (@Response);
      		}
      	my %hDDLinks = %{$Response[2]};
      After these lines you can insert a loop which processes the digital download products. E.g.
      Code:
      my $sDDProdRef;
      foreach $sDDProdRef (keys %hDDLinks)
         {
         my $sRequestData = sprintf('pb=publisher&wd=password1&uid=%s&gid=%s&anum=2', $::g_BillContact{EMAIL}, $sDDProdRef);
         ACTINIC::HTTP_SendAndReceive('serveur.com', 80, 'drm2/regusr', $sRequestData, 'GET');
         }
      Modifying the parameters of HTTP_SendAndReceive to point to the right server and script should work IMO. But please note I have typed it directly to the forum and didn't test it so it may require some finetunning.

      I hope this helps.
      Zoltan
      Actinic Software
      www.actinic.co.uk

      Comment


        #4
        Thanks a lot...

        Will try that this afternoon...

        I think for my production server, i need to test the payment type and only do this loop if the paiement is ok (Credit card or Paypal) and not execute it if the payment is refused or done by check.

        I really appreciate you help and will feedback to you.

        Regards

        Frederic

        Comment


          #5
          The modification not working

          as you said me i put on oderscript.pl :

          #
          # Add digital download info if required
          #
          @Response = ACTINIC::GetDigitalContent($pCartList);
          if ($Response[0] == $::FAILURE)
          {
          return (@Response);
          }
          my %hDDLinks = %{$Response[2]};
          my $sDDProdRef;
          foreach $sDDProdRef (keys %hDDLinks)
          {
          my $sRequestData = sprintf('pb=XXXX&wd=XXXX&uid=%s&gid=%s&anum=2', $::g_BillContact{EMAIL}, $sDDProdRef);
          ACTINIC::HTTP_SendAndReceive('http://xxxx.com', 80, 'drm2/regusr', $sRequestData, 'GET');
          }
          my $sDownloadMessage;

          No error on the script but nothing has been add on the DRM server.

          If i enter manualy le url with parameters on drm server the line has been add on it.

          Have you idea ?

          Regards

          Frederic

          Comment


            #6
            Send me the server address and details and I'm going to test it as soon as the time permits.
            Zoltan
            Actinic Software
            www.actinic.co.uk

            Comment


              #7
              Now I did some test and found an obvious mistake. The path requires a trailing slash. i.e. it should be
              Code:
              ACTINIC::HTTP_SendAndReceive('http://xxxx.com', 80, '/drm2/regusr', $sRequestData, 'GET');
              Applying this change it connects correctly to the server what you have sent to me. But the retrieved response is 'Invalid Parameter' which is down to the missing user and pwd I guess.

              If you would like to know what is the server response in case of errors you can get that by modifying the code to have
              Code:
              	my $sDDProdRef;
              	foreach $sDDProdRef (keys %hDDLinks)
              	   {
              	   my $sRequestData = sprintf('pb=publisher&wd=password1&uid=%s&gid=%s&anum=2', $::g_BillContact{EMAIL}, $sDDProdRef);
              	   @Response = ACTINIC::HTTP_SendAndReceive('asp9.digitalflip.com', 80, '/drm2/regusr', $sRequestData, 'GET');
              		if ($Response[0] != $::SUCCESS)
              			{
              			ACTINIC::RecordErrors($Response[1], ACTINIC::GetPath());
              			}
                 	}
              This will dump the response to the error.err file on the server.

              It may also make sense to encode the product reference and the email address before it is sent to the DRM server. If that is needed just replace
              Code:
              $::g_BillContact{EMAIL}
              with
              Code:
              ACTINIC::EncodeText2($::g_BillContact{EMAIL}, $::FALSE)
              and
              Code:
              $sDDProdRef
              with
              Code:
              ACTINIC::EncodeText2($sDDProdRef, $::FALSE)
              in the sprintf function call.

              I hope this will work on some way now. :-)
              Zoltan
              Actinic Software
              www.actinic.co.uk

              Comment

              Working...
              X