Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When ShippingPreference is NO_Shipping, always failed to create Subscription #278

Open
frankzhang210 opened this issue Dec 2, 2024 · 0 comments

Comments

@frankzhang210
Copy link

frankzhang210 commented Dec 2, 2024

The major issue is ShippingAddress is not reference type; PayerID is not omitempty.

Subscriber struct {
PayerID string json:"payer_id,**omitempty**"
ShippingAddress *ShippingDetail json:"shipping_address,omitempty"
Name CreateOrderPayerName json:"name,omitempty"
EmailAddress string json:"email_address,omitempty"
}

If not fixed as above indicated, always send shipping_address: {}, payerid:'' to paypal, then rejected with invalid address.

Sample payload without above fix,

{"plan_id":"P-9A585647VE5076042M4X5HUI","start_time":"2024-12-03T06:25:00Z","subscriber":{"payer_id":"","shipping_address":{},"name":{"given_name":"John","surname":"Doe"},"email_address":"[email protected]"},"application_context":{"brand_name":"Example Store","locale":"en-US","shipping_preference":"NO_SHIPPING","user_action":"SUBSCRIBE_NOW","payment_method":{"payee_preferred":"IMMEDIATE_PAYMENT_REQUIRED","standard_entry_class_code":"WEB"},"return_url":"https://example.com/return","cancel_url":"https://example.com/cancel"}}

Could you fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant