So, I integrated Paypal into my payment stream, and this happens:
- The user comes to the page. Click the "Billing" button
- The user is first redirected to a page that calls
SetExpressCheckout and redirected to Paypal. (He should be billed once, say, $ 77, and then every month for 1 year for the same amount. Therefore, I do not set the initial amount, but subtract it directly.) - Upon returning, he presses the confirmation button and is subtracted once using
DoExpressCheckout and a billing profile is created.
Everything works perfectly. I get paid every month. The user is not exposed twice at the beginning.
PROBLEM: When a user was redirected to Paypal, he sees only the username and DESCRIPTION. That is, Paypal does not describe whether the transaction is a one-time or a subscription, for example, when you use a simple subscription button for payment. Paypal mentions the amount, but not the type of transaction.
NVPEncoder encoder = new NVPEncoder(); encoder.add("METHOD","SetExpressCheckout"); encoder.add("RETURNURL",returnURL); encoder.add("CANCELURL",cancelURL); encoder.add("CURRENCYCODE","USD"); encoder.add("AMT",amt); encoder.add("BILLINGPERIOD", "Month"); encoder.add("BILLINGFREQUENCY", "1"); encoder.add("PROFILESTARTDATE",dateFormatGmt.format(new Date())); encoder.add("L_BILLINGTYPE0", "RecurringPayments"); encoder.add("L_BILLINGAGREEMENTDESCRIPTION0",package_name); encoder.add("L_NAME0",package_name); encoder.add("L_AMT0",amt); encoder.add("L_QTY0","1"); String strNVPRequest = encoder.encode(); String ppresponse = (String) caller.call(strNVPRequest); NVPDecoder resultValues = new NVPDecoder(); resultValues.decode(ppresponse); String strAck = resultValues.get("ACK"); if (strAck !=null && !(strAck.equals("Success") || strAck.equals("SuccessWithWarning"))) { response.sendRedirect("APIError.jsp"); } else { response.sendRedirect(redirectUrl); }
source share