Invalid 'custom' parameter

vtchg
New Community Member

<script>
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'paypal'
},
createSubscription: function(data, actions) {
return actions.subscription.create({
/* Creates the subscription */
plan_id: 'P-9PD8436790605970VMVNS5ZI',
custom: 'abcdefg',
});
},
onApprove: function(data, actions) {
console.log("2:");
console.log(data);
alert('Subscription successful');
}
}).render('#paypal-button-container-P-9PD8436790605970VMVNS5ZI'); // Renders the PayPal button
</script>

This is my HTML code, and there is a "custom" parameter in the order creation.

Array
(
[mc_gross] => 9.80
[period_type] => Regular
[outstanding_balance] => 0.00
[next_payment_date] => 02:00:00 Dec 20, 2023 PST
[protection_eligibility] => Eligible
[payment_cycle] => Monthly
[address_status] => confirmed
[tax] => 0.00
[payer_id] => CYBJ7U5KBFCJA
[address_street] => [removed]
[payment_date] => 06:59:43 Nov 20, 2023 PST
[payment_status] => Completed
[product_name] => vip menber
[charset] => gb2312
[recurring_payment_id] => I-DP6KWJNK4KT1
[address_zip] => 200000
[first_name] => John
[mc_fee] => 0.63
[address_country_code] => CN
[address_name] => Test Store
[notify_version] => 3.9
[amount_per_cycle] => 9.80
[payer_status] => verified
[currency_code] => USD
[business] => sb-lwbpb28275984
[address_country] => China
[address_city] => Shanghai
[verify_sign] => AK50lp7gRakC30DqGp1Lw3IPHQD8AbznbINVDulSpdhhyQUSy5hKiC.g
[payer_email] => sb-lzlzj28275979
[initial_payment_amount] => 0.00
[profile_status] => Active
[amount] => 9.80
[txn_id] => 36P02999LW315370N
[payment_type] => instant
[payer_business_name] => Test Store
[last_name] => Doe
[address_state] => Shanghai
[receiver_email] => sb-lwbpb28275984
[payment_fee] => 0.63
[receiver_id] => 8HK9RPS4UN2QY
[txn_type] => recurring_payment
[mc_currency] => USD
[residence_country] => CN
[test_ipn] => 1
[transaction_subject] => vip menber
[payment_gross] => 9.80
[shipping] => 0.00
[product_type] => 1
[time_created] => 06:59:43 Nov 20, 2023 PST
[ipn_track_id] => f6469133efd7b

)

The custom parameter is not present in the IPN echo.

Login to Me Too
1 REPLY 1

Kavyar
Moderator
Moderator

Good day @vtchg 

 

Thank you for posting to the PayPal community.

 

I have reviewed the code you provided, and it appears that you are using a REST API.

 

Considering that the REST API relies on Webhooks for event notifications, I suggest utilizing Webhooks for receiving notification alerts.

 

Please refer to the detailed guide link provided below:

 

https://developer.paypal.com/docs/api-basics/notifications/webhooks/

 

Note: For NVP/SOAP API integration, please use the Instant Payment Notification(IPN) service to get the payment notifications.

 

Guide link - https://developer.paypal.com/docs/api-basics/notifications/ipn/

 

If your still facing issues, please create an MTS ticket via - https://www.paypal-support.com/s/?language=en_US  with the detailed information and error details.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.