I use paypal standard subscription button for manage subscription system in my site
I configure ipn i got 2 ipn notification with txn_type subscr_signup and subscr_payment and i have subscr_id param there also.
So i have few questions:
1) how can i get subscription state (active, suspend, canceled, etc) by subscr_id? (i tried GetRecurringPaymentsProfileDetails but it can be used when subscription was created by express checkout only). i getting error 'Subscription Profiles not supported by Recurring Payment APIs'.
2) how to manage subscription state by subscr_id? (also tried ManageRecurringPaymentsProfileStatus, but getting error 'The profile ID is invalid' all the time)
You can use the "TransactionSearch" API to get the details for any profile( even for the one created using the PayPal subscription button ) .With this you can get the info like when profile was created , updated ,suspended etc . I have included the sample request and response , might be it can help you :
NVP Request:
USER=XXXXXXXXXX&PWD=XXXXXXXXXXXX&SIGNATURE=XXXXXX&VERSION=109.0&METHOD=TransactionSearch&STARTDATE=2014-01-24T00:00:00Z&TRANSACTIONCLASS=SUBSCRIPTION&PROFILEID=I-FXMKNUUEP6XL
NVP Response:
L_TIMESTAMP0=2014-02-17T16:19:50Z
L_TIMESTAMP1=2014-02-17T16:19:51Z
L_TIMESTAMP2=2014-03-17T14:02:39Z
L_TIMESTAMP3=2014-04-17T15:26:44Z
L_TIMESTAMP4=2014-05-09T17:18:37Z
L_TIMESTAMP5=2014-05-09T17:19:15Z
L_TIMESTAMP6=2014-05-09T17:19:40Z
L_TIMESTAMP7=2014-05-17T15:26:31Z
L_TIMESTAMP8=2014-06-17T15:55:14Z
L_TIMESTAMP9=2014-07-17T16:14:01Z
L_TIMESTAMP10=2014-08-17T16:06:44Z
L_TIMESTAMP11=2014-09-17T15:55:04Z
L_TIMEZONE0=GMT
L_TIMEZONE1=GMT
L_TIMEZONE2=GMT
L_TIMEZONE3=GMT
L_TIMEZONE4=GMT
L_TIMEZONE5=GMT
L_TIMEZONE6=GMT
L_TIMEZONE7=GMT
L_TIMEZONE8=GMT
L_TIMEZONE9=GMT
L_TIMEZONE10=GMT
L_TIMEZONE11=GMT
L_TYPE0=Recurring Payment
L_TYPE1=Recurring Payment
L_TYPE2=Recurring Payment
L_TYPE3=Recurring Payment
L_TYPE4=Recurring Payment
L_TYPE5=Recurring Payment
L_TYPE6=Recurring Payment
L_TYPE7=Recurring Payment
L_TYPE8=Recurring Payment
L_TYPE9=Recurring Payment
L_TYPE10=Recurring Payment
L_TYPE11=Recurring Payment
L_EMAIL1=XXXXXXXXXXXXXXXX
L_EMAIL2=XXXXXXXXXXXXXXXX
L_EMAIL3=XXXXXXXXXXXXXXXX
L_EMAIL7=XXXXXXXXXXXXXXXX
L_EMAIL8=XXXXXXXXXXXXXXXX
L_EMAIL9=XXXXXXXXXXXXXXXX
L_EMAIL10=XXXXXXXXXXXXXXXX
L_EMAIL11=XXXXXXXXXXXXXXXX
L_NAME0=Eshan Personal Test Account
L_NAME1=Eshan Personal Test Account
L_NAME2=Eshan Personal Test Account
L_NAME3=Eshan Personal Test Account
L_NAME4=Eshan Personal Test Account
L_NAME5=Eshan Personal Test Account
L_NAME6=Eshan Personal Test Account
L_NAME7=Eshan Personal Test Account
L_NAME8=Eshan Personal Test Account
L_NAME9=Eshan Personal Test Account
L_NAME10=Eshan Personal Test Account
L_NAME11=Eshan Personal Test Account
L_TRANSACTIONID0=I-FXMKNUUEP6XL
L_TRANSACTIONID1=0AR10991U1333214W
L_TRANSACTIONID2=1GX902663D9811358
L_TRANSACTIONID3=0K568033VD746381F
L_TRANSACTIONID4=I-FXMKNUUEP6XL
L_TRANSACTIONID5=I-FXMKNUUEP6XL
L_TRANSACTIONID6=I-FXMKNUUEP6XL
L_TRANSACTIONID7=4A4539330Y180244M
L_TRANSACTIONID8=94165672XW4156934
L_TRANSACTIONID9=12791760JH4394641
L_TRANSACTIONID10=36E095146V2526231
L_TRANSACTIONID11=5ED26578AA878723D
L_STATUS0=Created
L_STATUS1=Completed
L_STATUS2=Completed
L_STATUS3=Completed
L_STATUS4=Updated
L_STATUS5=Updated
L_STATUS6=Updated
L_STATUS7=Completed
L_STATUS8=Completed
L_STATUS9=Completed
L_STATUS10=Completed
L_STATUS11=Pending
L_AMT1=50.00
L_AMT2=50.00
L_AMT3=50.00
L_AMT7=50.00
L_AMT8=50.00
L_AMT9=50.00
L_AMT10=50.00
L_AMT11=50.00
L_CURRENCYCODE1=USD
L_CURRENCYCODE2=USD
L_CURRENCYCODE3=USD
L_CURRENCYCODE7=USD
L_CURRENCYCODE8=USD
L_CURRENCYCODE9=USD
L_CURRENCYCODE10=USD
L_CURRENCYCODE11=USD
L_FEEAMT1=-1.75
L_FEEAMT2=-1.75
L_FEEAMT3=-1.75
L_FEEAMT7=-1.75
L_FEEAMT8=-1.75
L_FEEAMT9=-1.75
L_FEEAMT10=-1.75
L_FEEAMT11=0.00
L_NETAMT1=48.25
L_NETAMT2=48.25
L_NETAMT3=48.25
L_NETAMT7=48.25
L_NETAMT8=48.25
L_NETAMT9=48.25
L_NETAMT10=48.25
L_NETAMT11=50.00
TIMESTAMP=2014-10-07T11:05:34Z
CORRELATIONID=5bb22082c58de
ACK=Success
VERSION=109.0
BUILD=000000
Related
I have been trying to save customer payment details on a site, so that if a customer is logged in they can pay with a single click, instead of having to log in to paypal. To do so I have been following the official paypal guide: https://developer.paypal.com/beta/vault/during-purchase/js-sdk/paypal/
I was able to successfully save payment details. The problem is that when I try to use the saved customer_id to use those saved payment details, I get the following error: "Error: cannot get vault - ID token context does not have required scope".
What I did was the following:
Generate an id_token and access_token by sending a request to https://api-m.sandbox.paypal.com/v1/oauth2/token and specifying response_type=id_token
When rendering the paypal button, pass the generated id_token to the script tags data-user-id-token attribute.
I click the paypal button on the website. This sends a request to my backend server which generates an order by sending a request to https://api-m.sandbox.paypal.com/v2/checkout/orders/. When generating the order I use the generated access_token as a Bearer token in the "Authorization" header, as well as pass the following payment_source.paypal configuration:
"paypal": {
"attributes": {
"vault": {
"store_in_vault": "ON_SUCCESS",
"usage_type": "MERCHANT",
"customer_type": "CONSUMER"
}
}
I get an order id in the response. I pass this order id back to the client side, where the paypal sdk initates a payment flow using this id.
I finish the payment flow, and on success call my server's captureOrder endpoint. This calls https://api-m.sandbox.paypal.com/v2/checkout/orders/$id/capture, where $id is the orderID used before. I also pass the Beares access_token generated in the first step. This request returns a response containing a generated user ID that looks something like this: 560837847
I send another request to https://api-m.sandbox.paypal.com/v1/oauth2/token, this time passing a target_customer_id parameter in the request's body. The value of the parameter is the customerId generated in the 5th step.
I render the page with the paypal button again, this time passing the new id_token to the script tags data-user-id-token attribute.
The error "Error: cannot get vault - ID token context does not have required scope" appears in the developer tools console.
I have turned on "Accept payments" on the Paypal developer console as well as Vault functionality:
The id_token generated in the 6th step has the following scopes:
https://uri.paypal.com/services/invoicing
https://uri.paypal.com/services/vault/payment-tokens/read
https://uri.paypal.com/services/disputes/read-buyer
https://uri.paypal.com/services/payments/realtimepayment
https://uri.paypal.com/services/disputes/update-seller
openid
https://uri.paypal.com/services/payments/payment/authcapture
https://uri.paypal.com/services/disputes/read-seller
Braintree:Vault
https://uri.paypal.com/services/payments/refund
https://api.paypal.com/v1/vault/credit-card
https://api.paypal.com/v1/payments/.*
https://uri.paypal.com/payments/payouts
https://uri.paypal.com/services/vault/payment-tokens/readwrite
https://api.paypal.com/v1/vault/credit-card/.*
https://uri.paypal.com/services/shipping/trackers/readwrite
https://uri.paypal.com/services/subscriptions
https://uri.paypal.com/services/applications/webhooks
I cannot find any information online about what else I should do to make this work.
$invoice->setRedirectURL('https://test/testett/');
// Set URL that Buyer will be redirected to after completing the payment, via GET Request
// Set URL that Buyer will be redirected to after closing the invoice or after the invoice expires, via GET Request
$invoice->setAutoRedirect(true);
// Optional. Learn more at: https://github.com/vrajroham/laravel-bitpay#1-setup-your-webhook-route
$invoice->setNotificationUrl('https://1ba5-45-112-243-81.ngrok.io/laravel-bitpay/webhook');
// This is the recommended IPN format that BitPay advises for all new implementations
$invoice->setExtendedNotifications(true);
I'm developing an affiliate script with the Paypal Adaptive Payments SDK. I have the following code:
$payRequest = new PayRequest(new RequestEnvelope("en_US"), 'PAY',$arrPaypal ['paypal_return'] , 'USD', $receiverList, $arrPaypal['paypal_return']);
$payRequest->IpnNotificationUrl = $arrPaypal['paypal_callback'];
$payRequest->memo = 'Payment for ' . $arrUserInfo['plan_title'];
$payRequest->trackingId = $intID;
However it is not firing the callback script. The url is my http:// ipaddress /script.php. If I set it in the paypal sandbox I get a hit but it's not an adaptive payments response as detailed in the sdk. Could someone please explain how to enable it?
You may have gotten the case of the IPN setter wrong. Try ipnNotificationUrl instead of IpnNotificationUrl
I'm integrating Log In with PayPal - JavaScript Button.
https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/js_button/
I need "payer_id" of the user who logged in with paypal.
But it's NOT included in a response.
A response of "4. Get User's PayPal Profile Data" in above integration guide is like this :
{
"family_name":"Ito",
"name":"Gen Ito",
"account_type":"BUSINESS",
"given_name":"Gen",
"user_id":"ttps://www.paypal.com/webapps/auth/identity/user/xxxxxxxxxxxxxxxxx",
"verified_account":"true",
"language":"ja_JP",
"zoneinfo":"Asia/Tokyo",
"locale":"ja_JP",
"email":"xxx#xxx",
"account_creation_date":"2011-11-18",
"birthday":"1982-08-02",
"age_range":"26-30"
}
"payer_id" is listed in below, so I thought payer_id is available.
https://developer.paypal.com/webapps/developer/docs/api/#get-user-information
Can I get payer_id with "Login with Paypal" ?
Then should I use another/other request ?
you need to submit a support ticket at www.paypal.com/mts and request access to this attribute.
I'm trying to get PayPal's chained payments working in their sandbox env. but whenever I click on "Pay" at the very last stage after signing in I always get redirected to a page with the generic error message "Your payment can't be completed. Please return to the participating website and try again."
I've tried doing both chained and parallel payments with the same results.
I've also followed a few suggestions from around the web which inc tweaking the merchant account settings making sure certain fields were unchecked under the "blocked" options. As well checking currency and country code. Initially country code was en_GB and currency GBP, that didn't work I tried doing en_US with USD but in all cases I get the same message.
I've also tried adding an IPN url on the off chance PayPal would post some error code/message to it but got nadda! If you click "Return to test store" it goes to the cancel URL without any POST/GET parameters.
I'm using their PHP SDK from http://paypal.github.io/#adaptive-payments-tab-php-5-3
So the question, does anyone have any suggestion as to how I can find out what exactly is going wrong or other things I can try to fix it?
I had this problem in the sandbox environment because I was not including an application ID. I used APP-80W284485P519543T which one of examples indicated as the Sandbox Application ID, and then it worked.
Mobile Payments Library Developer Guide and Reference
–
Android OS
Edition
Oct 2016
5
Preface
**Important:
The Mobile Payments Library is based on the PayPal Adaptive Payments API.
As of October 6, 2016, Adaptive Payments is now a limited releas
e product. It is restricted to
select partners for approved use cases and should not be used for new integrations without guidance from PayPal**
=============================================
first implement method
private void initLibrary() {
PayPal pp = PayPal.getInstance();
if(pp == null) {
pp = PayPal.initWithAppID(this, PAYPAL_APP_ID, PayPal.ENV_SANDBOX);
pp.setLanguage("en_US"); // Sets the language for the library.
pp.setFeesPayer(PayPal.FEEPAYER_EACHRECEIVER);
// pp.setShippingEnabled(true);
pp.setDynamicAmountCalculationEnabled(false);
}
}
**paypal button click event code**
double secondary_payment = 0;
double primary_payment = 0;
PayPalAdvancedPayment advPayment = makeChainedPayment(secondary_payment,primary_payment,"primary_email","secondary_email");
Intent checkoutIntent = PayPal.getInstance().checkout(advPayment, your_current_activity);
startActivityForResult(checkoutIntent, 1);
=============================================
private PayPalAdvancedPayment makeChainedPayment(double priceSecondary, double pricePrimary, String primary_email, String secondary_email) {
PayPalAdvancedPayment payment = new PayPalAdvancedPayment();
payment.setCurrencyType("USD");
// payment.setMerchantName("PushND");
BigDecimal bigDecimalPrimary=new BigDecimal(pricePrimary);
PayPalReceiverDetails receiverPrimary = new PayPalReceiverDetails();
receiverPrimary.setRecipient(primary_email);
//receiverPrimary.setRecipient("adaptive_receiver_1#pushnd.com");
receiverPrimary.setSubtotal(bigDecimalPrimary);
receiverPrimary.setIsPrimary(true);
payment.getReceivers().add(receiverPrimary);
PayPalReceiverDetails receiverSecondary= new PayPalReceiverDetails();
receiverSecondary.setRecipient(secondary_email);
BigDecimal bigDecimalSecond=new BigDecimal(priceSecondary);
receiverSecondary.setSubtotal(bigDecimalSecond);
payment.getReceivers().add(receiverSecondary);
return payment;
}