Happy Business Starts Here

Valued Scholar

Creating ACH payment method via CORS

Hi. I am able to successfully create new credit cards using the CORS-enabled endpoint (https://rest.zuora.com/v1/payment-methods/credit-cards) as described by https://www.zuora.com/developer/api-reference/#operation/POST_PaymentMethods. However, when I attempt to create an ACH payment method via the same method, I get the response:


"Invalid parameter(s): 'AchAbaCode,AchAccountName,AchAccountType,AchBankName'."


So, is ACH creation even available via this method? From the documation, it appears as though it's only available through the standard CRUD create operation: https://www.zuora.com/developer/api-reference/#operation/Object_POSTPaymentMethod which uses the endpoint https://rest.zuora.com/v1/object/payment-method. Is this assumption correct? Or am I just doing something wrong?

Tags (2)
Valued Scholar

Re: Creating ACH payment method via CORS

Okay, since posting my original question, I found https://knowledgecenter.zuora.com/CA_Commerce/T_Hosted_Commerce_Pages/B_Payment_Pages_2.0/P_Implemen..., which is similar to the CORS solution. Instead of creating a form that posts directly to Zuora, I am submitting an ajax post request to https://apisandbox.zuora.com/apps/PublicHostedPageLite.do. Unfortunately, I'm getting this response:


XMLHttpRequest cannot load https://apisandbox.zuora.com/apps/PublicHostedPageLite.do. Redirect from 'https://apisandbox.zuora.com/apps/PublicHostedPageLite.do' to 'https://apisandbox.zuora.com/apps/login.do?method=redirect&retURL=%2Fapps%2FPublicHostedPageLite.do' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://<my-origin>' is therefore not allowed access.


It looks like a response I'd get if not authenticated. The only header I'm sending is Content-Type of application/x-www-form-urlencoded. Unlike the other CORS requests, I'm not sending in signature and token with the headers - when I do, the request comes back with a preflight error. The fields I'm posting with the request are:


field_key - public key
field_style - iframe
host - my host
id - hosted page id (created in zuora)
method - submitPage
signature - one time key provided by zuora
tenantId - provided by zuora
token - one time key provided by zuora


Are there any good examples of creating ACH payment methods via the API or solutions for fixing the problem above? Thanks!

Valued Scholar

Re: Creating ACH payment method via CORS

Ok, I've dug into this further. Looks like it's not possible to submit an ajax request to the public hosted pages - it must be a literal form submit. Hopefully some day zuora will provide a CORS-enabled way to submit ACH payment methods!

Zuora Staff

Re: Creating ACH payment method via CORS

HI Phil,


Apolgoize for the delayed repsonse. This is actually a great idea. I have a couple of suggestions for you. We have a Product Feedback forum where you can post your feature request and solicit direct input from the Product Management Team. You can also vote on features and post comments. The Product Management Team actively monitors the community and provide updates on feature requests when available.

If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √