{"action":"created","issue":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/234","labels_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/234/comments","events_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/234/events","html_url":"https://github.com/paypal/PayPal-PHP-SDK/issues/234","id":56403983,"number":234,"title":"Billing plans & agreements","user":{"login":"MartyIX","id":203266,"avatar_url":"https://avatars.githubusercontent.com/u/203266?v=3","gravatar_id":"","url":"https://api.github.com/users/MartyIX","html_url":"https://github.com/MartyIX","followers_url":"https://api.github.com/users/MartyIX/followers","following_url":"https://api.github.com/users/MartyIX/following{/other_user}","gists_url":"https://api.github.com/users/MartyIX/gists{/gist_id}","starred_url":"https://api.github.com/users/MartyIX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartyIX/subscriptions","organizations_url":"https://api.github.com/users/MartyIX/orgs","repos_url":"https://api.github.com/users/MartyIX/repos","events_url":"https://api.github.com/users/MartyIX/events{/privacy}","received_events_url":"https://api.github.com/users/MartyIX/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-03T16:48:47Z","updated_at":"2015-02-10T07:54:53Z","closed_at":"2015-02-03T19:14:08Z","body":"Hello,\r\n\r\nI received the following error when I wanted to create a billing agreement (https://developer.paypal.com/docs/api/#create-an-agreement):\r\n\r\n    [03-02-2015 04:37:19] PayPal\\Core\\PayPalHttpConnection: FINE: Response : {\"name\":\"SUBSCRIPTION_UNMAPPED_ERROR\",\"message\":\"The field Shipping Address State is required\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#SUBSCRIPTION_UNMAPPED_ERROR\",\"debug_id\":\"38d423b8845c8\"}\r\n\r\nThe agreement was created with the shipping address specified as follows (the only interesting line is that `state` is commented out):\r\n\r\n        $shippingAddress = new ShippingAddress();\r\n        $shippingAddress\r\n            ->setLine1($userEntity->street) // Line 1 of the address (e.g., Number, street, etc). 100 characters max. Required.\r\n            ->setCity($userEntity->city) // City name. 50 characters max. Required.\r\n            //->setState($userEntity->state) // 2-letter code for US states, and the equivalent for other countries. 100 characters max.\r\n            ->setState($userEntity->state) // 2-letter code for US states, and the equivalent for other countries. 100 characters max.\r\n            ->setPostalCode($userEntity->postalCode) // Zip code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries.\r\n            ->setCountryCode($userEntity->country); // 2-letter country code. 2 characters max. Required.\r\n        $agreement->setShippingAddress($shippingAddress);\r\n\r\nHowever, the documentation clearly states that `state` is not required: https://developer.paypal.com/webapps/developer/docs/api/#address-object If I use a valid 2-letter code for state, everything is OK.\r\n\r\nMoreover, the link https://developer.paypal.com/webapps/developer/docs/api/#SUBSCRIPTION_UNMAPPED_ERROR is invalid. \r\n\r\nHave a nice day!"},"comment":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/comments/73658116","html_url":"https://github.com/paypal/PayPal-PHP-SDK/issues/234#issuecomment-73658116","issue_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/234","id":73658116,"user":{"login":"deepakkailashgupta","id":7921825,"avatar_url":"https://avatars.githubusercontent.com/u/7921825?v=3","gravatar_id":"","url":"https://api.github.com/users/deepakkailashgupta","html_url":"https://github.com/deepakkailashgupta","followers_url":"https://api.github.com/users/deepakkailashgupta/followers","following_url":"https://api.github.com/users/deepakkailashgupta/following{/other_user}","gists_url":"https://api.github.com/users/deepakkailashgupta/gists{/gist_id}","starred_url":"https://api.github.com/users/deepakkailashgupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepakkailashgupta/subscriptions","organizations_url":"https://api.github.com/users/deepakkailashgupta/orgs","repos_url":"https://api.github.com/users/deepakkailashgupta/repos","events_url":"https://api.github.com/users/deepakkailashgupta/events{/privacy}","received_events_url":"https://api.github.com/users/deepakkailashgupta/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T07:54:53Z","updated_at":"2015-02-10T07:54:53Z","body":"Hi MartyIX\r\n\r\nwe removed the shipping and billing address both still getting the same error\r\n\r\n[09-02-2015 11:54:07] PayPal\\Core\\PayPalHttpConnection: FINE: Payload : {\"name\":\"Touristlink Subscription\",\"description\":\"TouristLink.com Silver Package Subscription\",\"start_date\":\"2015-02-10T00:04:04-08:00\",\"plan\":{\"id\":\"P-7H43018605829513POJ5RXZI\"},\"payer\":{\"payment_method\":\"credit_card\",\"payer_info\":{\"email\":\"deepakkailashgupta@gmail.com\"},\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"4032036946538822\",\"expire_month\":2,\"expire_year\":\"2018\",\"cvv2\":\"121\"}}]}}\r\n\r\n[09-02-2015 11:54:09] PayPal\\Core\\PayPalHttpConnection: FINE: Response : {\"name\":\"SUBSCRIPTION_UNMAPPED_ERROR\",\"message\":\"This transaction cannot be processed.\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#SUBSCRIPTION_UNMAPPED_ERROR\",\"debug_id\":\"1658985a76194\"}\r\n\r\n"}}