richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
219 stars 77 forks source link

postal code is missing in ngx-stripe-payment [BUG] #210

Closed ahammadfaishal closed 11 months ago

ahammadfaishal commented 1 year ago

Describe the bug Postal code is missing in ngx-stripe-payment component, and I didn't find any configuration to add it manually.

To Reproduce I tried ` <ng-container *ngIf="elementsOptions?.clientSecret"> <ngx-stripe-payment [appearance]="appearance" [clientSecret]="elementsOptions?.clientSecret"

`

and public elementsOptions: StripeElementsOptions = { locale: 'en', clientSecret: '****secret_key****', currency: 'aud', capture_method: 'automatic' }; @ViewChild(StripePaymentElementComponent) paymentElement: StripePaymentElementComponent; appearance: Appearance = { theme: 'stripe', variables: { colorPrimary: '#673ab7', } }, }; stripeTest: FormGroup;

"@angular/common": "^12.0.5", "@stripe/stripe-js": "^1.53.0", "ngx-stripe": "v12",

Expected behavior image

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

richnologies commented 1 year ago

Hi @ahammadfaishal,

This repo only maintains the Angular wrapper for StripeJS. We don't handle that functionality. Stripe does it. It automatically decides whether or not to show the post code and the format it should have depending on the country. If you see the Stripe Docs you will notice the same happens for Australia:

image

There is an option to do the exact opposite and never ask for it. This way you can add a field to collect the postcode. In that case you'll have to pass the value of that field when you try to confirm the payment. https://stripe.com/docs/js/elements_object/create_payment_element

You can also raise this issue in the main StripeJS repo: https://github.com/stripe/stripe-js

Sorry I don't have a better answer.

Let me know if there is anything else I can help you with

Regards,

R