Cope
Cope

Reputation: 1

Flutterwave recurring payments not working

I have this code to capture subscription payment from flutterwave but it sends to blank page on their server has anyone have a fix or solution my code is below and checkoutcode is from their end https://developer.flutterwave.com/reference/endpoints/subscriptions

<form method="POST" action="https://checkout.flutterwave.com/v3/hosted/pay">   
    <input type="hidden" name="payment_plan" value="106150" />   
    <button type="submit">Pay Now</button> 
</form> 

<form method="POST" action="https://checkout.flutterwave.com/v3/hosted/pay">   
    <input type="hidden" name="payment_plan" value="106150" />   
    <button type="submit">Pay Now</button> 
</form>

I am trying to implement flutterwave existing checkout code

Upvotes: 0

Views: 131

Answers (1)

maťo
maťo

Reputation: 1302

You're not sending all the required fields. You're sending only payment_plan, but this is not valid field. You have to send valid public_key and the rest required fields. E.g. this values working:

<form method="POST" action="https://checkout.flutterwave.com/v3/hosted/pay">
  <input type="hidden" name="public_key" value="FLWPUBK-58cc63c00e129204fb4e94ef95bb781f-X" />
  <input type="hidden" name="customer[email]" value="[email protected]" />
  <input type="hidden" name="customer[name]" value="Jesse Pinkman" />
  <input type="hidden" name="tx_ref" value="bitethtx-019203" />
  <input type="hidden" name="amount" value="3400" />
  <input type="hidden" name="currency" value="NGN" />
  <input type="hidden" name="meta[token]" value="54" />
  <input type="hidden" name="redirect_url" value="https://google.com" />
  <button type="submit" id="start-payment-button">Pay Now</button>
</form>

Upvotes: 0

Related Questions