Hi,
I'm looking to build a payment button using Amazon Simple Marketplace Payments.
Here is some code:

<input type="hidden" name="recipientEmail" value="email_address yahoo.com" >

I would like value to be a variable but having trouble making this happen or finding info on how to do this. Any help would be awesome.

Recommended Answers

All 6 Replies

This is where php comes in. I assume that the email id is coming from other html or php file.Assuming your method post

<?php $email = $_POST['email']; ?>
<input type="hidden" name="recipientEmail" value=<?php echo "$email"; ?>>

This is not complete but do respond to it.

Yes, Thanks for reply.
That is the way for any form but I am having trouble coding that for code generated by Amazon payments. I'll try that again but usually get error.
Do you know any tutorials?

Can you just post the code if you don't mind?

Can you just post the code if you don't mind?

Hello!
Sorry for delayed response, I've been very busy.
Anyway, I working again on this dynamic payment button.
Here is the code for the button:

<form action="https://authorize.payments-sandbox.amazon.com/pba/paypipeline" method="post">
  <input type="hidden" name="immediateReturn" value="1" >
  <input type="hidden" name="collectShippingAddress" value="0" >
  <input type="hidden" name="signatureVersion" value="2" >
  <input type="hidden" name="signatureMethod" value="HmacSHA256" >
  <input type="hidden" name="accessKey" value="000000000000000" >
  <input type="hidden" name="recipientEmail" value="[B]<?php echo $email ?>[/B]" >
  <input type="hidden" name="amount" value="USD 1.00" >
  <input type="hidden" name="variableMarketplaceFee" value="0.0" >
  <input type="hidden" name="signature" value="c1HRWxtRIaPnuF5WBwEZnY/UGSugDAbrItodJT278kU=" >
  <input type="hidden" name="isDonationWidget" value="0" >
  <input type="hidden" name="fixedMarketplaceFee" value="USD .20" >
  <input type="hidden" name="description" value="widget" >
  <input type="hidden" name="amazonPaymentsAccountId" value="YJNQSVYSPDZL735389RBFAXXSUB5VDUS1LNE86" >
  <input type="hidden" name="returnUrl" value="http://test-3.php" >
  <input type="hidden" name="processImmediate" value="1" >
  <input type="hidden" name="cobrandingStyle" value="logo" >
  <input type="hidden" name="abandonUrl" value="http://test-2.php" >
  <input type="image" src="http://g-ecx.images-amazon.com/images/G/01/asp/beige_small_paynow_withlogo_whitebg.gif" border="0">
</form>

In bold is where problem is at.
The var. $email is defined properly but I get error message anyway only when use var. $email
I'm thinking I am missing something but not sure what.

Thanks!

Member Avatar for diafol

Is this right? Looks like a spoofed form to me. Is it secure?

Hello Ardav!
The form is created by Amazon Payments. I just filled in text fields to create the button except for the:

<input type="hidden" name="recipientEmail" value="[B]<?php echo $email ?>[/B]" >

The url's are shortened just for the posting.
Also access key I just used all 0's for posting
If the value for recipientEmail is my email address it works fine. Only error when using variable $email. I never made a dynamic payment button before so I'm not sure if I'm missing something else.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.