Is it legal to use Paypal instead of InAppPurchase?

I have diets app, and to use the app you need to purchase 30 days diet plan.
Is it legal to use Paypal to purchase it?
I heard from friend that I have to use InAppPurchase in order to be legal app in Play Market or AppStore.

What is the correct anwser?

the InAppPurchase, but i never try it

I have to use InAppPurchase?
Could you bring me source for this please?

Any one that know the answer?