function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lescclarkcpdlescclarkcpd 

Inserting a paypal link

hi

 

I have this column set up as part of a related list, it all works fine but I want to use this column as an external link to a paypal cart. I am using a field "item.Paypal_button_text__c}" that replaces the v v long value in the original html so that I can refererence unique text foreach instance.  I get an errorwhen it redirects me.

 

 

 <apex:column headerValue="Availability" >
    <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_s-xclick"></input>
        <apex:inputHidden id="encrypted" value="{!item.Paypal_button_text__c}"/>
        <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."></input>
        <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"></img>
    </form>
</apex:column>   

 

It doesn't work,probably because I have thw HTML & Apex mixed up.

 

this is the original code from paypal

 

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="xxxxxxx-paypal v v long text !!!!, now in SF field">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

sorry about the format, but can you help

aballardaballard

What error do you get? 

lescclarkcpdlescclarkcpd

Hi, there's no sf error, it just doesn't pass the right info through to paypal & you get an error on the paypal page

lescclarkcpdlescclarkcpd

Hi

 

I couldn't get this to work by just passing a value through so am converting to apex., I've got this far but it only directs me tothe paypal home page

The original code is above & then my attempt to convert to apex.

 

item.Paypal_cmd__c contains "_s-xclick" & item.paypal_button_text__c contains "-------Begin etc  "

 


<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick"></input>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----"></input>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."></input>
</form>

<apex:column >
<apex:form target="paypal" >
<apex:inputHidden id="cmd" value="{!item.Paypal_cmd__c}"/>
<apex:inputHidden id="encrypted" value="{!item.Paypal_button_text__c}"/>
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" image="https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif" action="https://www.paypal.com/cgi-bin/webscr" id="submit" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:column>
Gregory512Gregory512

Try using a link instead of a form... I don't remember exactly how they are structured but I'm sure you could find it on the PayPal website.  All of the details in your hidden fields can be passed via a url.