razorpay / razorpay-ios-sample-app

:iphone: Sample app demonstrating integration of Razorpay iOS Framework
MIT License
14 stars 13 forks source link

How can I caputure Razorpay after success? #30

Closed maulikshah09 closed 3 years ago

maulikshah09 commented 3 years ago

Hello sir ,

I have integrated Sdk in ios app. I have problem with capture. I have successfully Integrated My razorpay. when user payment via rozar pay. my payment status is authorised. I want to automatically capture the payment in my account. my client told me how can i capture default to my bank account. He Is go to admin protal and capture payment every time. I want sent money directly to client bank account.

steps : -> Open payment screen -> User pay the payment -> success the payment -> here authorised status in admin -> here client want authorised to captured automatically. (auto payment to client bank account.)

please help me to sort out the issue .

AYAN249 commented 3 years ago

@maulikshah09 ​For auto-capture, available for integrations that have implemented Orders API. In automatic capture, the authorization is immediately followed by the capture of payments. Here no additional step is required to capture the payment explicitly. In the 'Create Order' request, add payment_capture = 1 to enable auto-capture. As a result, order_id along with razorpay_signature, a hexadecimal string, is returned. If the signature is valid, the payment is successful and auto captured.

Please Note:

While razorpay_signature is passed and verified in all cases, it signifies that payment has also been captured only when payment_capture = 1 value is set.

Please refer to this documentation for more details about the implementation of Orders API: https://razorpay.com/docs/payment-gateway/orders/integration/#capture-payments-in-orders

maulikshah09 commented 3 years ago

After payment success I have to implement? Do you have example ?

AYAN249 commented 3 years ago

@maulikshah09 You have to create an order_id by making a POST request to the orders API, using your API credentials. This will in turn give you an order_id in response. This Razorpay order_id has to further be sent to the checkout code. https://razorpay.com/docs/payment-gateway/orders/#request-parameters

maulikshah09 commented 3 years ago

Sir what you say i can't Understand.. I have Implement Sdk Like demo..Where to implement Order Api?

maulikshah09 commented 3 years ago

@AYAN249 Plese help me...

Nautiyalsachin commented 3 years ago

Hey @maulikshah09, do you have integrated backend APIs in your project? If you do then I'll suggest you add the Order API in your backend or else you can call this API from your app. Let me know if you still find any trouble integrating it.

maulikshah09 commented 3 years ago

@Nautiyalsachin sir I have integrated as it is like demo. In android auto capture feature works perfectly. there is no order api integrated in backend and appside In android.. In IOS Order api need to integrate? then how can i integrate after successful order ?

Nautiyalsachin commented 3 years ago

@maulikshah09 You have to create the order id before opening checkout because when you create the order id you tell us in the order API by passing payment_capture=1 that you want to automatically capture the payment click here for more details.

After the order id creation you have to pass it in order_id for more details and other options refer to Checkout Form Fields.

maulikshah09 commented 3 years ago

Just like This am i right ?

UIImage logo = [UIImage imageNamed:@"logo"]; NSDictionary options = @{ @"amount" : @"100", @"currency" : @"INR", @"payment_capture" : @"1", @"description" : @"Fine T-shirt", @"image" : logo, @"name" : @"Razorpay", @"external" : @{@"wallets" : @[ @"paytm" ]}, @"prefill" : @{@"email" : @"contact@razorpay.com", @"contact" : @"18002700323"}, @"theme" : @{@"color" : @"#3594E2"} };

[razorpay open:options];

maulikshah09 commented 3 years ago

Sir please help me today i have to live my app.

Nautiyalsachin commented 3 years ago

No @maulikshah09, you should call the order id first, get the order id and add it into options

UIImage logo = [UIImage imageNamed:@"logo"]; NSDictionary options = @{ @"amount" : @"100", @"currency" : @"INR", @"order_id" : your order id, @"description" : @"Fine T-shirt", @"image" : logo, @"name" : @"Razorpay", @"external" : @{@"wallets" : @[ @"paytm" ]}, @"prefill" : @{@"email" : @"contact@razorpay.com", @"contact" : @"18002700323"}, @"theme" : @{@"color" : @"#3594E2"} };

Nautiyalsachin commented 3 years ago

Closing this issue due to inactivity, please feel free to re-open the issue or add more comments.

maulikshah09 commented 3 years ago

NO. it's not solved...give me one example. we are moving to may be another example I have integrated SDK Like you provide.but not solved my issue. Can you give us demo for better understanding @Nautiyalsachin