2016-04-25 39 views
0

我最近一直在爲託管經銷商的網站。 我做了一個表單,將用戶變量傳遞給創建用戶帳戶的頁面。通過PayPal PHP變量發送到購買頁後

<form id="form_14" action="https://1hosting1.co.uk/order/purchase.php" method="get" target="_self" class="OBJ-1" > 
    <input id="user" name="user" class="OBJ-2" maxlength="32" placeholder="Username" > 
    <input id="pwd" name="pwd" class="OBJ-2" maxlength="32" type="password" placeholder="Password" > 
    <input id="submit" disabled="" class="OBJ-3" type="submit" value="Submit"> 
    <div class="OBJ-4" id="txt_9"> 
     <p class="Body3 P-2"> 
      <span class="C-4">Hosting Signup</span> 
     </p> 
    </div> 
    <div id="txt_118"> 
     <h4 class="Heading-4 P-3"> 
      <span class="C-5">PASSWORD</span> 
     </h4> 
    </div> 
    <input id="edit_6" name="email" class="OBJ-2" maxlength="32" placeholder="Email Address"> 
</form> 

這將變量傳遞給使用GET方法從變量創建帳戶的文件。 但是我想要做的是,當用戶購買產品時,它還會向PayPal發送一個變量列表,然後將其發送到該文件。 有沒有辦法可以做到這一點? --- UPDATE ---- 好吧,我決定貝寶不會滿足我的需求。是否有另一個可以傳遞PHP變量的支付網關?

+2

您可能正在尋找Callback API https://developer.paypal.com/docs/classic/api/merchant/Callback_API_Operation_NVP/或即時更新API https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECInstantUpdateAPI/ –

+0

@ Fred-ii-我可能是錯的,但是這個API似乎只發送設置變量名和值到網站。 –

+0

也許,但是你可以漫遊他們的API列表來準確找到你想要做的事情。我認爲其中之一會有所幫助。 –

回答

0

您可以設置一個callback_url,如paypal的variables docu中所述。如果要傳遞變量,請將參數放入url中作爲get參數。

或者將它們保存在會話中並檢查出來,如果回調從貝寶回來。